/* Shared design tokens and base components for the four public ZENDAMA sites.
   Source of truth for colour and type: docs/01-brand-dna.md.
   Site stylesheets build on these and must not redefine the tokens. */
:root {
  --burgundy: #582936;
  --burgundy-deep: #3f1c27;
  --ivory: #f5f0e7;
  --porcelain: #fbf8f2;
  --sage: #adb9a5;
  --green: #3c554c;
  --brass: #aa9270;
  --ink: #292c25;
  --ink-soft: #55584f;
  --line: rgba(41, 44, 37, 0.14);
  --line-strong: rgba(41, 44, 37, 0.28);

  /* Each site sets --accent on <body> (data-site). */
  --accent: var(--burgundy);
  --accent-ink: var(--porcelain);

  --serif-latin: "Editorial", "Cormorant Garamond", Georgia, serif;
  --serif: "Editorial", "Noto Serif KR", "Noto Serif JP", Georgia, serif;
  --sans:
    "Manrope", "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans KR",
    "Noto Sans JP", system-ui, sans-serif;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --step-4: clamp(2.8rem, 1.7rem + 5.4vw, 6rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(4rem, 9vw, 9rem);
  --measure: 38rem;
  --max: 82rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
body[data-site="shop"] {
  --accent: var(--burgundy);
}
body[data-site="partner"] {
  --accent: var(--green);
}
body[data-site="media"] {
  --accent: var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="ko"] body {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html[lang="ja"] body {
  font-family:
    "Manrope", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui,
    sans-serif;
  line-height: 1.9;
  line-break: strict;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}
h1 {
  font-size: var(--step-4);
  line-height: 1.08;
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}
p {
  margin: 0 0 1em;
  max-width: var(--measure);
  text-wrap: pretty;
}
.latin {
  font-family: var(--serif-latin);
  letter-spacing: 0.02em;
}

/* Layout */
.wrap {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin-inline: auto;
}
.section {
  padding-block: var(--section);
}
.section--porcelain {
  background: var(--porcelain);
}
.section--accent {
  background: var(--accent);
  color: var(--accent-ink);
}
.section--ink {
  background: var(--ink);
  color: var(--porcelain);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-family: var(--serif-latin);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  /* Brass itself is too light for small text on ivory. */
  color: #776244;
}
.section--accent .eyebrow,
.section--ink .eyebrow {
  color: #dccdb1;
}
.section--accent a:hover,
.section--ink a:hover {
  color: inherit;
  opacity: 0.8;
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}
.lead {
  font-size: var(--step-1);
  line-height: 1.6;
}
.rule {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--porcelain);
}
.skip-link:focus {
  left: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}
.button:hover {
  background: transparent;
  color: var(--accent);
}
.button--ghost {
  background: transparent;
  color: var(--accent);
}
.button--ghost:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.15rem;
}
.text-link::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}
.text-link:hover::after {
  transform: translateX(0.3rem);
}

/* Header shared by all sites */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
/* The blur sits on a pseudo-element: a filter on the header itself would
   make it the containing block of the fixed mobile menu and clip it. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--ivory) 92%, transparent);
  backdrop-filter: blur(10px);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-lockup svg {
  width: 2rem;
  height: 2rem;
}
.brand-lockup__word {
  font-family: var(--serif-latin);
  font-size: 1.35rem;
  letter-spacing: 0.3em;
}
.brand-lockup__site {
  padding-left: 0.75rem;
  border-left: 1px solid var(--line-strong);
  font-family: var(--serif-latin);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
}
.site-nav a {
  text-decoration: none;
  padding-block: 0.4rem;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.site-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-switch {
  display: inline-flex;
  gap: 0.15rem;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
}
.lang-switch a {
  padding: 0.3rem 0.5rem;
  text-decoration: none;
  opacity: 0.55;
}
.lang-switch a[aria-current="true"] {
  opacity: 1;
  border-bottom: 1px solid currentColor;
}
.menu-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 1.4rem;
  height: 1px;
  margin: 0.4rem auto;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}
@media (max-width: 60rem) {
  .menu-toggle {
    display: block;
  }
  .site-nav {
    position: fixed;
    inset: 4.25rem 0 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1.5rem var(--gutter) 6rem;
    background: var(--ivory);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition:
      opacity 0.3s var(--ease),
      transform 0.3s var(--ease),
      visibility 0.3s;
  }
  .site-nav a {
    width: 100%;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: var(--step-1);
  }
  body[data-menu="open"] .site-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  body[data-menu="open"] {
    overflow: hidden;
  }
  body[data-menu="open"] .menu-toggle span:first-child {
    transform: translateY(0.225rem) rotate(45deg);
  }
  body[data-menu="open"] .menu-toggle span:last-child {
    transform: translateY(-0.225rem) rotate(-45deg);
  }
}

/* Family switcher: the four ZENDAMA sites */
.family {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.family a {
  display: block;
  padding: 1.5rem var(--gutter);
  text-decoration: none;
  border-right: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.family a:last-child {
  border-right: 0;
}
.family a:hover,
.family a[aria-current="true"] {
  background: var(--porcelain);
}
.family__name {
  display: block;
  font-family: var(--serif-latin);
  font-size: var(--step-1);
  letter-spacing: 0.12em;
}
.family__desc {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
@media (max-width: 48rem) {
  .family {
    grid-template-columns: repeat(2, 1fr);
  }
  .family a:nth-child(2) {
    border-right: 0;
  }
  .family a:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

/* Footer */
.site-footer {
  background: var(--burgundy-deep);
  color: var(--ivory);
  font-size: var(--step--1);
}
.site-footer a {
  color: inherit;
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-block: clamp(3rem, 6vw, 5rem);
}
.site-footer__brand .brand-lockup__word {
  font-size: 1.6rem;
}
.site-footer__brand svg {
  stroke: var(--ivory);
}
.site-footer h2 {
  margin-bottom: 0.9rem;
  font-family: var(--serif-latin);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer li {
  margin-bottom: 0.45rem;
}
.site-footer__legal {
  padding-block: 1.5rem;
  border-top: 1px solid rgba(245, 240, 231, 0.18);
  color: rgba(245, 240, 231, 0.7);
}
.site-footer__legal p {
  max-width: none;
  margin: 0 0 0.3rem;
}
@media (max-width: 48rem) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

/* Images */
.frame {
  position: relative;
  overflow: hidden;
  background: var(--sage);
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame--4x5 {
  aspect-ratio: 4 / 5;
}
.frame--4x3 {
  aspect-ratio: 4 / 3;
}
.frame--3x2 {
  aspect-ratio: 3 / 2;
}
.frame--1x1 {
  aspect-ratio: 1;
}
.caption {
  margin-top: 0.6rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.notice {
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--brass);
  background: var(--porcelain);
  font-size: var(--step--1);
}
.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line-strong);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Scroll reveal: elements start visible without JS. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 26rem) {
  .site-header__bar {
    gap: 0.5rem;
  }
  .brand-lockup {
    gap: 0.5rem;
  }
  .brand-lockup svg {
    width: 1.6rem;
    height: 1.6rem;
  }
  .brand-lockup__word {
    font-size: 1.05rem;
    letter-spacing: 0.2em;
  }
  .brand-lockup__site {
    padding-left: 0.5rem;
    letter-spacing: 0.12em;
  }
  .lang-switch a {
    padding: 0.3rem 0.3rem;
  }
}
