/* ==========================================================================
   THREAD & CELL — Design System
   Editorial K-Fashion × K-Beauty. Ink / Ivory / Copper.
   ========================================================================== */

:root {
  --ink: #101319;
  --ink-soft: #171b23;
  --graphite: #262b35;
  --ivory: #f5f1e9;
  --paper: #fbf8f2;
  --sand: #ebe4d8;
  --copper: #a56c3f;
  --copper-light: #c69a6d;
  --sage: #6f8579;
  --line: rgba(16, 19, 25, 0.13);
  --line-mid: rgba(16, 19, 25, 0.24);
  --line-light: rgba(245, 241, 233, 0.18);
  --muted: #6b6f78;
  --muted-light: rgba(245, 241, 233, 0.62);

  --font-serif: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif;
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;

  --shell: 1280px;
  --gutter: clamp(20px, 5vw, 72px);
  --header-h: 74px;

  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Korean typography: never break mid-word (어절) */
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

::selection {
  background: var(--copper);
  color: var(--ivory);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

/* ---------- Layout primitives ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(72px, 11vw, 152px);
  position: relative;
}

.section--tight { padding-block: clamp(56px, 7vw, 96px); }
.section--paper { background: var(--paper); }
.section--ivory { background: var(--ivory); }
.section--ink { background: var(--ink); color: var(--ivory); }
.section--sand { background: var(--sand); }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- Type scale ---------- */
.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 6.6vw, 5.4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.24;
  letter-spacing: -0.025em;
}

.h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.85;
  color: var(--graphite);
}

.body { font-size: 0.975rem; line-height: 1.9; color: var(--graphite); }
.small { font-size: 0.845rem; line-height: 1.8; }
.tiny { font-size: 0.75rem; line-height: 1.7; }

.muted { color: var(--muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section--ink .eyebrow { color: var(--copper-light); }
.section--ink .lead,
.section--ink .body { color: rgba(245, 241, 233, 0.78); }
.section--ink .muted { color: var(--muted-light); }

.serif { font-family: var(--font-serif); font-weight: 300; }
.latin { font-family: var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.45s var(--ease), color 0.45s var(--ease),
    border-color 0.45s var(--ease), transform 0.45s var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--ivory);
  transform: translateY(-2px);
}

.btn--solid {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

.btn--solid:hover {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
}

.btn--light {
  border-color: rgba(245, 241, 233, 0.42);
  color: var(--ivory);
}

.btn--light:hover {
  background: var(--ivory);
  color: var(--ink);
  border-color: var(--ivory);
}

.btn .arrow { transition: transform 0.45s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-mid);
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.textlink:hover { border-color: var(--copper); color: var(--copper); }
.textlink .arrow { transition: transform 0.4s var(--ease); }
.textlink:hover .arrow { transform: translateX(4px); }

.section--ink .textlink { border-color: var(--line-light); }
.section--ink .textlink:hover { border-color: var(--copper-light); color: var(--copper-light); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease), color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
  color: var(--ivory);
}

.site-header__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header.is-scrolled,
.site-header.is-solid {
  background: rgba(251, 248, 242, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--line);
  color: var(--ink);
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brandmark__glyph {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brandmark__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brandmark__name {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brandmark__sub {
  font-size: 0.53rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  opacity: 0.62;
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 34px);
}

.nav__link {
  position: relative;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding-block: 6px;
  opacity: 0.82;
  transition: opacity 0.35s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.nav__link:hover { opacity: 1; }
.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link.is-active { opacity: 1; font-weight: 600; }

.header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.site-header:not(.is-scrolled):not(.is-solid) .header__cta:hover {
  background: var(--ivory);
  color: var(--ink);
}

.site-header.is-scrolled .header__cta:hover,
.site-header.is-solid .header__cta:hover {
  background: var(--ink);
  color: var(--ivory);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  margin-right: -8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 1px;
  background: currentColor;
  transition: transform 0.4s var(--ease);
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--ink);
  color: var(--ivory);
  padding: calc(var(--header-h) + 40px) var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-out);
  pointer-events: none;
}

body.nav-open .mobile-menu {
  clip-path: inset(0 0 0 0);
  pointer-events: auto;
}

.mobile-menu__list { display: flex; flex-direction: column; }

.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid rgba(245, 241, 233, 0.1);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

body.nav-open .mobile-menu__link {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.16s + var(--i) * 0.045s);
}

.mobile-menu__link .num {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  opacity: 0.45;
}

.mobile-menu__foot {
  border-top: 1px solid rgba(245, 241, 233, 0.14);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(245, 241, 233, 0.6);
  letter-spacing: 0.04em;
}

body.nav-open { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--ivory);
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: 34px;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.footer__brand .brandmark__name { font-size: 1.02rem; }

.footer__claim {
  margin-top: 22px;
  max-width: 34ch;
  font-size: 0.9rem;
  line-height: 1.85;
  color: rgba(245, 241, 233, 0.62);
}

.footer__coltitle {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper-light);
  margin-bottom: 18px;
}

.footer__list { display: flex; flex-direction: column; gap: 9px; }

.footer__list a,
.footer__list span {
  font-size: 0.86rem;
  color: rgba(245, 241, 233, 0.72);
  transition: color 0.35s var(--ease);
}

.footer__list a:hover { color: var(--ivory); }

.footer__coords {
  font-size: 0.86rem;
  line-height: 1.9;
  color: rgba(245, 241, 233, 0.68);
  font-style: normal;
}

.footer__coords strong {
  display: block;
  color: var(--ivory);
  font-weight: 600;
  margin-bottom: 6px;
}

.footer__bottom {
  border-top: 1px solid rgba(245, 241, 233, 0.13);
  padding-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.footer__legal {
  font-size: 0.7rem;
  line-height: 1.95;
  color: rgba(245, 241, 233, 0.45);
  max-width: 78ch;
  letter-spacing: 0.01em;
}

.footer__legal span { margin-right: 14px; white-space: nowrap; }

.footer__copy {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(245, 241, 233, 0.38);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}

[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
