﻿:root {
  --bg: #efe8df;
  --bg-soft: #f7f1e8;
  --ink: #1b1714;
  --muted: #6d6258;
  --line: rgba(27, 23, 20, 0.16);
  --line-strong: rgba(27, 23, 20, 0.78);
  --oxblood: #7a2430;
  --lilac: #c8b4d0;
  --celery: #b5c58a;
  --mustard: #b58a3a;
  --charcoal: #2d2a26;
  --paper-shadow: 0 18px 40px rgba(27, 23, 20, 0.08);
  --rail-w: 220px;
  --page: clamp(22px, 3.6vw, 56px);
  --section: clamp(72px, 10vw, 148px);
  --font-display: "Syne", "Noto Sans KR", sans-serif;
  --font-serif: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  word-break: keep-all;
  overflow-wrap: break-word;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(27,23,20,0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 88% 8%, rgba(200,180,208,0.22), transparent 22%),
    var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
}
body.nav-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--oxblood); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 14px; top: 12px; z-index: 120;
  transform: translateY(-160%); padding: 8px 12px;
  background: var(--ink); color: var(--bg-soft);
}
.skip-link:focus { transform: none; }

.frame {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 28px;
  padding: 28px 22px;
  border-right: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(122,36,48,0.08), transparent 28%),
    #ebe2d6;
}

.rail-brand {
  display: grid;
  gap: 10px;
}
.rail-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--lilac);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
.rail-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.rail-tag {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rail-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}
.rail-nav a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}
.rail-nav a span {
  color: var(--oxblood);
  font-family: var(--font-mono);
  font-size: 11px;
}
.rail-nav a[aria-current="page"],
.rail-nav a:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.42);
}
.rail-meta {
  display: grid;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage {
  min-width: 0;
  padding: 0 var(--page) 48px;
}
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin: 0 calc(var(--page) * -1);
  padding: 0 var(--page);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(239,232,223,0.94);
  backdrop-filter: blur(10px);
}
.mobile-brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.nav-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.mono-label {
  margin: 0 0 12px;
  color: var(--oxblood);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5.4vw, 78px);
  line-height: 1.08;
}
h2 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.14;
}
h3 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
}
.lede, p {
  margin: 0;
}
.lede {
  max-width: 38ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}
.btn-primary,
.btn-ghost,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.btn-primary {
  margin-top: 28px;
  padding: 0 22px;
  border: 1.5px solid var(--ink);
  background: var(--oxblood);
  color: #fff8f2;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: 5px 5px 0 var(--ink);
}
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.btn-ghost {
  margin-top: 28px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.text-link {
  margin-top: 22px;
  color: var(--oxblood);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: end;
  padding: clamp(48px, 7vw, 96px) 0 var(--section);
}
.hero-media {
  margin: 0;
  position: relative;
  border: 1.5px solid var(--ink);
  background: var(--bg-soft);
  box-shadow: var(--paper-shadow);
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}
.hero-media figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-stitch {
  position: absolute;
  left: 6%;
  bottom: 8%;
  width: min(54%, 520px);
  opacity: 0.75;
  pointer-events: none;
}
.hero-stitch path {
  fill: none;
  stroke: var(--oxblood);
  stroke-width: 2.4;
  stroke-dasharray: 4 8;
}

.ticket-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--section);
}
.ticket-row article {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, transparent 0 12px, var(--bg-soft) 12px),
    #fff9f1;
  box-shadow: 4px 4px 0 rgba(27,23,20,0.08);
}
.ticket-row b {
  font-family: var(--font-display);
  font-size: 20px;
}
.ticket-row span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.objects-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(28px, 4vw, 64px);
  margin-bottom: var(--section);
}
.board-intro p:not(.mono-label) {
  margin-top: 16px;
  color: var(--muted);
  max-width: 30ch;
}
.pattern-board {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "a b"
    "c b"
    "c d";
  gap: 18px;
}
.piece {
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255,249,241,0.8);
}
.piece figure { margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); }
.piece img { width: 100%; object-fit: cover; }
.piece h3 { margin-bottom: 8px; }
.piece p:last-child { color: var(--muted); font-size: 14px; line-height: 1.55; }
.piece-a { grid-area: a; }
.piece-a img { aspect-ratio: 1 / 1; }
.piece-b { grid-area: b; }
.piece-b img { aspect-ratio: 4 / 5; min-height: 100%; }
.piece-c { grid-area: c; }
.piece-c img { aspect-ratio: 3 / 4; }
.piece-d { grid-area: d; }
.piece-d img { aspect-ratio: 3 / 2; }

.mend-path {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  margin-bottom: var(--section);
  padding: clamp(28px, 4vw, 48px);
  border: 1.5px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(181,197,138,0.18), transparent 40%),
    #f4ede3;
}
.mend-choices {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.mend-choices button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  background: rgba(255,255,255,0.5);
}
.mend-choices button span {
  color: var(--oxblood);
  font-family: var(--font-mono);
  font-size: 12px;
}
.mend-choices button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff8f1;
  box-shadow: 4px 4px 0 var(--oxblood);
}
.mend-choices button[aria-pressed="true"] span { color: var(--lilac); }
.mend-stage {
  display: grid;
  gap: 18px;
  align-content: start;
}
.stitch-route path {
  fill: none;
  stroke: var(--oxblood);
  stroke-width: 2.5;
  stroke-dasharray: 5 9;
  transition: d 0.35s ease, stroke-dashoffset 0.35s ease;
}
.stitch-route.route-button path { d: path("M18 130 C90 34 180 28 250 86 S360 176 542 42"); }
.stitch-route.route-sleeve path { d: path("M20 48 C110 150 190 160 280 96 S420 20 540 128"); }
.stitch-route.route-hem path { d: path("M16 96 C120 96 180 30 260 30 S390 150 544 88"); }
.mend-copy p:last-child {
  margin-top: 10px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.mend-stage figure {
  margin: 0;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: #fff;
}
.mend-stage img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.workroom {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
  margin-bottom: var(--section);
}
.workroom figure {
  margin: 0;
  border: 1.5px solid var(--ink);
  overflow: hidden;
}
.workroom img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}
.workroom aside {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(200,180,208,0.28), transparent 55%), var(--bg-soft);
}
.workroom aside p:not(.mono-label) { color: var(--muted); max-width: 32ch; }

.closing {
  margin-bottom: 36px;
  padding: clamp(36px, 5vw, 64px);
  border: 1.5px solid var(--ink);
  background:
    radial-gradient(circle at 90% 20%, rgba(122,36,48,0.12), transparent 28%),
    #f8f2e9;
}
.closing p:not(.mono-label) {
  max-width: 42ch;
  margin-top: 16px;
  color: var(--muted);
}

.page-hero {
  padding: clamp(48px, 7vw, 92px) 0 40px;
}
.page-hero .lede { max-width: 48ch; }
.material-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: var(--section);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.material-index p {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.material-index p:nth-child(odd) { padding-right: 18px; border-right: 1px solid var(--line); }
.material-index p:nth-child(even) { padding-left: 18px; }
.material-index span {
  color: var(--oxblood);
  font-weight: 500;
}

.object-stack {
  display: grid;
  gap: clamp(36px, 5vw, 72px);
  margin-bottom: 48px;
}
.stack-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
}
.stack-row.stack-right { grid-template-columns: 0.95fr 1.05fr; }
.stack-row figure {
  margin: 0;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--paper-shadow);
}
.stack-row img {
  width: 100%;
  object-fit: cover;
}
.stack-row:nth-child(1) img { aspect-ratio: 1 / 1; }
.stack-row:nth-child(2) img,
.stack-row:nth-child(3) img { aspect-ratio: 4 / 5; }
.stack-row:nth-child(4) img { aspect-ratio: 3 / 2; }
.stack-row h2 { margin: 8px 0 14px; }
.stack-row p { color: var(--muted); max-width: 36ch; }
.stack-row dl {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
}
.stack-row dl div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.stack-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.stack-row dd { margin: 0; color: var(--muted); }

.repair-hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  padding: clamp(48px, 7vw, 92px) 0 var(--section);
}
.repair-hero figure {
  margin: 0;
  border: 1.5px solid var(--ink);
  overflow: hidden;
}
.repair-hero img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.repair-steps { margin-bottom: var(--section); }
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.step-grid article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  background: #fff9f1;
}
.step-grid span {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--oxblood);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.step-grid h3 { margin-bottom: 12px; }
.step-grid p { color: var(--muted); }

.choice-band,
.invite {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
  margin-bottom: var(--section);
}
.choice-band figure,
.invite figure {
  margin: 0;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.choice-band img,
.invite img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}
.choice-band ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.choice-band li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.invite {
  padding: clamp(28px, 4vw, 48px);
  border: 1.5px solid var(--ink);
  background: linear-gradient(135deg, rgba(200,180,208,0.24), transparent 50%), #f7f0e6;
}
.invite p:not(.mono-label) {
  margin-top: 14px;
  color: var(--muted);
  max-width: 40ch;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 28px 0 12px;
  border-top: 1px solid var(--line-strong);
}
.site-footer strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .ticket-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .objects-board,
  .mend-path,
  .workroom,
  .repair-hero,
  .choice-band,
  .invite,
  .stack-row,
  .stack-row.stack-right {
    grid-template-columns: 1fr;
  }
  .pattern-board {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "a b"
      "c d";
  }
  .step-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --rail-w: 0px; }
  .frame { display: block; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 18px 0 40px rgba(27,23,20,0.16);
  }
  body.nav-open .rail,
  .rail.is-open { transform: none; }
  .mobile-bar { display: flex; }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }
  .hero-stitch { display: none; }
  .ticket-row { grid-template-columns: 1fr 1fr; }
  .pattern-board {
    grid-template-columns: 1fr;
    grid-template-areas: "a" "b" "c" "d";
  }
  .material-index { grid-template-columns: 1fr; }
  .material-index p:nth-child(odd),
  .material-index p:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
    border-right: 0;
  }
  h1 { font-size: clamp(34px, 11vw, 48px); line-height: 1.12; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn-primary:hover { transform: none; }
  .stitch-route path { transition: none; }
}
