/* ============================================================
   미니유공방 — editorial atelier redesign
   paper & clay palette, typography-led, borderless layout
   ============================================================ */

:root {
  --paper: #f6f1e8;
  --paper-deep: #ede4d3;
  --ink: #2a211a;
  --ink-soft: #74655a;
  --terra: #bc5b33;
  --terra-deep: #96431f;
  --serif: "Gowun Batang", "Nanum Myeongjo", serif;
  --sans: "Noto Sans KR", "Pretendard", sans-serif;
  --wrap: 1160px;
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 34px);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.nav-links a:hover { color: var(--ink); }

.nav-cta {
  color: var(--terra);
  font-weight: 700;
}
.nav-cta:hover { color: var(--terra-deep); }

.nav-toggle {
  display: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 2px;
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(40px, 8vh, 96px) clamp(56px, 10vh, 120px); }

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--terra);
  margin-bottom: 18px;
}

.hero-brand {
  display: block;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.hero-display {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.hero-text {
  margin-top: 26px;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.button:active { transform: scale(0.97); }

.button-primary {
  background: var(--terra);
  color: #fff;
}
.button-primary:hover { background: var(--terra-deep); }

.button-ghost {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.button-ghost:hover { background: color-mix(in srgb, var(--ink) 13%, transparent); }

.hero-media {
  position: relative;
  padding-bottom: 56px;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  border-radius: 120px 28px 28px 28px;
}

.hero-polaroid {
  position: absolute;
  left: -8%;
  bottom: 0;
  width: min(46%, 220px);
  background: #fff;
  padding: 10px 10px 12px;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgb(42 33 26 / 0.18);
  transform: rotate(-5deg);
}
.hero-polaroid img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}
.hero-polaroid figcaption {
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 8px;
}

.hero-badge {
  position: absolute;
  top: -22px;
  right: -6px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  display: grid;
  place-content: center;
  text-align: center;
  transform: rotate(8deg);
}

/* ---------- marquee ---------- */

.marquee {
  display: flex;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding-block: 16px;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 0 0 auto;
  min-width: 100%;
  padding-right: 40px;
  white-space: nowrap;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  animation: marquee 38s linear infinite;
}

.marquee-track > span:nth-child(even) { color: var(--terra); font-size: 0.75rem; }

@keyframes marquee {
  to { transform: translateX(-100%); }
}

/* ---------- sections ---------- */

.section { padding-block: clamp(72px, 12vh, 140px); }

.section-head { max-width: 640px; }

.section-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.section-lead {
  margin-top: 18px;
  color: var(--ink-soft);
}

/* ---------- programs ---------- */

.programs .section-head { margin-bottom: clamp(48px, 8vh, 90px); }

.program-row {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}
.program-row + .program-row { margin-top: clamp(56px, 9vh, 110px); }

.program-row.is-flipped .program-text { order: 2; }
.program-row.is-flipped .program-media { order: 1; }

.program-index {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.5vw, 3.6rem);
  font-weight: 700;
  color: color-mix(in srgb, var(--terra) 32%, var(--paper));
  line-height: 1;
  margin-bottom: 14px;
}

.program-text h3 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.program-text p { color: var(--ink-soft); max-width: 30em; }

.program-refs {
  margin-top: 16px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--terra-deep);
}

.program-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.program-row:nth-of-type(odd) .program-media img { transform: rotate(0.6deg); }
.program-row:nth-of-type(even) .program-media img { transform: rotate(-0.6deg); }

/* ---------- classes ---------- */

.classes { background: var(--paper-deep); }

.classes .section-head { margin-bottom: clamp(36px, 6vh, 64px); }

.class-strip {
  display: flex;
  gap: clamp(18px, 2.5vw, 30px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-inline: max(clamp(20px, 5vw, 48px), calc((100vw - var(--wrap)) / 2 + clamp(20px, 5vw, 48px)));
  scroll-padding-inline: max(clamp(20px, 5vw, 48px), calc((100vw - var(--wrap)) / 2 + clamp(20px, 5vw, 48px)));
  padding-bottom: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--terra) transparent;
}

.class-item {
  flex: 0 0 min(70vw, 300px);
  scroll-snap-align: start;
}

.class-item img {
  width: 100%;
  aspect-ratio: 3 / 3.8;
  object-fit: cover;
  border-radius: 18px;
  transition: transform 0.35s ease;
}
.class-item:hover img { transform: translateY(-6px); }

.class-item figcaption {
  padding-top: 14px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.class-item figcaption strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ---------- academy ---------- */

.academy-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}

.academy-photo img {
  width: 100%;
  aspect-ratio: 4 / 4.8;
  object-fit: cover;
  border-radius: 28px 28px 120px 28px;
}

.academy-list {
  list-style: none;
  margin-top: clamp(32px, 5vh, 48px);
  counter-reset: academy;
  display: grid;
  gap: clamp(26px, 4vh, 38px);
}

.academy-list li {
  counter-increment: academy;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
}

.academy-list li::before {
  content: counter(academy, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--terra);
  line-height: 1.4;
}

.academy-list h3, .academy-list p { grid-column: 2; }

.academy-list h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.academy-list p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- about ---------- */

.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(48px, 7vw, 100px);
  align-items: center;
}

.about-copy h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.38;
}

.about-quote {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.9;
  color: var(--terra-deep);
  margin-block: 30px;
}

.about-copy > p { color: var(--ink-soft); max-width: 32em; }

.about-media {
  position: relative;
  padding: 0 24px 48px 0;
}

.about-photo-back {
  width: 88%;
  margin-left: auto;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  border-radius: 18px;
  transform: rotate(2.5deg);
}

.about-photo-front {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 22px 44px rgb(42 33 26 / 0.22);
  transform: rotate(-3deg);
  outline: 8px solid #fff;
}

/* ---------- gallery ---------- */

.gallery { background: var(--paper-deep); }

.gallery .section-head { margin-bottom: clamp(36px, 6vh, 60px); }

.gallery-grid {
  columns: 3 260px;
  column-gap: 18px;
}

.gallery-grid figure {
  break-inside: avoid;
  margin-bottom: 18px;
}

.gallery-grid img {
  width: 100%;
  border-radius: 14px;
}

.gallery-grid figcaption {
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 8px 4px 2px;
}

/* ---------- contact ---------- */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding-bottom: 40px;
}

.contact .eyebrow { color: var(--terra); }

.contact .section-head h2 { color: var(--paper); }

.contact-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: end;
  margin-top: clamp(44px, 7vh, 72px);
}

.contact-phone {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.contact-phone:hover { color: var(--terra); }

.contact-mail {
  display: inline-block;
  margin-top: 14px;
  font-size: 1.05rem;
  color: color-mix(in srgb, var(--paper) 75%, transparent);
  text-decoration: underline;
  text-underline-offset: 5px;
}
.contact-mail:hover { color: var(--paper); }

.contact-address {
  margin-top: 26px;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-size: 0.95rem;
}
.contact-address span {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin-top: 4px;
  color: color-mix(in srgb, var(--paper) 45%, transparent);
}

.contact-channels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
}

.contact-channels a {
  color: color-mix(in srgb, var(--paper) 78%, transparent);
  transition: color 0.2s ease, transform 0.2s ease;
}
.contact-channels a:hover {
  color: var(--terra);
  transform: translateX(4px);
}
.contact-channels a::before {
  content: "→ ";
  color: var(--terra);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: clamp(60px, 10vh, 100px);
  padding-top: 26px;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--paper) 45%, transparent);
}
.site-footer a:hover { color: var(--paper); }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-inner,
  .program-row,
  .academy-inner,
  .about-inner,
  .contact-body {
    grid-template-columns: 1fr;
  }

  .program-row.is-flipped .program-text { order: 1; }
  .program-row.is-flipped .program-media { order: 2; }
  .program-media { max-width: 560px; }

  .hero-media { max-width: 520px; }
  .academy-photo { max-width: 480px; }
  .about-media { max-width: 520px; }

  .contact-body { align-items: start; }
  .contact-channels { flex-direction: row; flex-wrap: wrap; gap: 10px 22px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--paper);
    padding: 12px clamp(20px, 5vw, 48px) 24px;
    box-shadow: 0 24px 40px rgb(42 33 26 / 0.12);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding-block: 10px; font-size: 1rem; }

  .only-wide { display: none; }
  .gallery-grid { columns: 2 150px; column-gap: 12px; }
  .gallery-grid figure { margin-bottom: 12px; }
}

@media (max-width: 480px) {
  body { font-size: 0.96rem; }

  .hero { padding-top: 28px; }
  .hero-polaroid { left: -4px; }
  .hero-badge { width: 78px; height: 78px; font-size: 0.72rem; top: -14px; right: 0; }

  .button { padding: 13px 24px; font-size: 0.92rem; }

  .class-item { flex-basis: 76vw; }

  .site-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; white-space: normal; min-width: 0; }
  .marquee { flex-wrap: wrap; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .class-item img, .contact-channels a, .button { transition: none; }
}
