/* =========================================
   SONAMÈRE — design system
   Warm, organic, literary. Motion is the brand.
   ========================================= */

:root {
  /* Palette — ivory-forward warm organics */
  --ivory: oklch(0.965 0.012 75);
  --ivory-2: oklch(0.945 0.016 72);
  --parchment: oklch(0.92 0.022 68);
  --parchment-deep: oklch(0.86 0.028 65);
  --blush: oklch(0.88 0.035 30);
  --brass: oklch(0.68 0.10 62);
  --brass-deep: oklch(0.56 0.095 55);
  --ink: oklch(0.22 0.025 40);
  --ink-soft: oklch(0.36 0.022 40);
  --ink-mute: oklch(0.50 0.018 45);
  --line: oklch(0.80 0.022 60);
  --line-soft: oklch(0.86 0.018 60);

  /* Type */
  --f-display: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --f-body: 'Newsreader', 'Newsreader Display', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Rhythm */
  --page-max: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
  --radius: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle paper grain via layered radial noise — done with an SVG filter */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ——— Typography ——— */
.display {
  font-family: var(--f-display);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.02;
  color: var(--ink);
}
.display em, .display .it { font-style: italic; font-weight: 300; }
.h-hero {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(48px, 8.4vw, 132px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}
.h-section {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.h-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  font-weight: 400;
}
.prose {
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
  text-wrap: pretty;
}
.prose--lg { font-size: 22px; line-height: 1.55; color: var(--ink); }

.meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ——— Layout ——— */
.page { position: relative; z-index: 0; }
.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ——— Nav ——— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: normal;
  transition: background 400ms ease, backdrop-filter 400ms ease, color 400ms ease;
}
.nav.nav--scrolled {
  background: color-mix(in oklab, var(--ivory) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.nav.nav--over-dark { color: var(--ivory); }
.nav.nav--scrolled.nav--over-dark { color: var(--ink); }
.nav.nav--menu-open,
.nav.nav--menu-open.nav--over-dark { color: var(--ink); }
.nav__logo {
  height: 28px;
  width: auto;
  transition: opacity 300ms;
}
.nav__logo .st0 { fill: currentColor; }
.nav__links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav__link {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.78;
  transition: opacity 200ms;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 0;
  position: relative;
}
.nav__link:hover { opacity: 1; }
.nav__link.is-active { opacity: 1; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
}
.nav__cart {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: inherit;
  transition: background 200ms, color 200ms;
}
.nav__cart:hover {
  background: var(--ink);
  color: var(--ivory);
}
.nav--over-dark .nav__cart:hover {
  background: var(--ivory);
  color: var(--ink);
}

/* Logo sizing — defaults */
.logo-inline {
  width: 200px;
  height: 72px;
}

/* Right cluster (cart + menu button) */
.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  transition: background 200ms, color 200ms;
}
.nav__menu-icon {
  position: relative;
  width: 16px;
  height: 10px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}
.nav__menu-icon i {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transition: transform 240ms ease;
  transform-origin: center;
}
.nav__menu-icon.is-open i:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav__menu-icon.is-open i:last-child  { transform: translateY(-4.5px) rotate(-45deg); }

/* Mobile drawer (hidden on desktop) */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: var(--ivory);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 280ms ease, transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 88px 24px 32px;
}
.nav-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.nav-drawer__inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-drawer__link {
  background: none;
  border: none;
  text-align: left;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: baseline;
  gap: 18px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.nav-drawer__link:last-of-type { border-bottom: 1px solid var(--line-soft); }
.nav-drawer__num {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.nav-drawer__label {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.015em;
}
.nav-drawer__link.is-active .nav-drawer__label {
  font-style: italic;
  color: var(--brass-deep);
}
.nav-drawer__foot {
  margin-top: 36px;
  color: var(--ink-mute);
}

/* ———————————————————————————————————
   MOBILE NAV — collapse to logo + menu
   ——————————————————————————————————— */
@media (max-width: 880px) {
  .nav { padding: 12px 18px; }
  .logo-inline { width: 132px; height: 46px; }
  .nav__links { display: none; }
  .nav__cart {
    font-size: 10px;
    padding: 8px 14px;
    letter-spacing: 0.18em;
  }
  .nav__menu-btn { display: inline-flex; }
}

/* ——— Melody player (persistent) ——— */
.melody {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  background: color-mix(in oklab, var(--ivory) 85%, transparent);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  box-shadow: 0 14px 40px -18px oklch(0.3 0.05 50 / 0.25);
  cursor: pointer;
  user-select: none;
  transition: transform 300ms ease;
}
.melody:hover { transform: translateY(-1px); }
.melody__disc {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass) 0%, var(--brass-deep) 60%, oklch(0.32 0.05 55) 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px oklch(0.4 0.05 55 / 0.4);
}
.melody__disc::before {
  content: "";
  position: absolute;
  inset: 36%;
  border-radius: 50%;
  background: oklch(0.20 0.03 45);
  box-shadow: inset 0 0 0 1px oklch(0.4 0.05 55 / 0.4);
}
.melody.is-playing .melody__disc {
  animation: spin 4.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.melody__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.melody__wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}
.melody__wave i {
  display: block;
  width: 2px;
  background: var(--brass-deep);
  border-radius: 1px;
  height: 4px;
  transition: height 300ms ease;
}
.melody.is-playing .melody__wave i {
  animation: wave 1.2s ease-in-out infinite;
}
.melody.is-playing .melody__wave i:nth-child(2) { animation-delay: 0.12s; }
.melody.is-playing .melody__wave i:nth-child(3) { animation-delay: 0.24s; }
.melody.is-playing .melody__wave i:nth-child(4) { animation-delay: 0.36s; }
.melody.is-playing .melody__wave i:nth-child(5) { animation-delay: 0.48s; }
@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* ——— Reveal primitives ——— */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1200ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 1400ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal--line {
  overflow: hidden;
  display: block;
}
.reveal--line > span {
  display: block;
  padding: 0 0.08em;
  transform: translateY(110%);
  transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-in.reveal--line > span { transform: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 15px 28px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  transition: transform 260ms ease, background 260ms, color 260ms, border-color 260ms;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn--ghost:hover {
  background: currentColor;
  color: var(--ivory);
}
.btn--ghost.is-on-dark:hover { color: var(--ink); }
.btn__arrow {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 300ms;
}
.btn__arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .btn__arrow { width: 28px; }

/* Divider with brass dot */
.rule {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.rule--dot::before, .rule--dot::after { max-width: 180px; }

/* ——— Shared sections ——— */
.section {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
}
.section--tight { padding: clamp(60px, 8vw, 120px) 0; }

/* Photo placeholder — striped with label */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      var(--parchment) 0,
      var(--parchment) 10px,
      var(--parchment-deep) 10px,
      var(--parchment-deep) 11px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  overflow: hidden;
}
.placeholder__label {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ivory) 80%, transparent);
  padding: 6px 10px;
  border-radius: 2px;
}

/* ——— Footer ——— */
.footer {
  position: relative;
  background: oklch(0.17 0.02 40);
  color: var(--ivory);
  padding: 110px 0 40px;
  overflow: hidden;
}
.footer__container { position: relative; z-index: 2; }

.footer__letter {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  padding-bottom: 80px;
  margin-bottom: 80px;
  border-bottom: 1px solid oklch(0.3 0.02 40);
  align-items: end;
}
.footer__eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: oklch(0.85 0.06 68);
  display: block;
  margin-bottom: 22px;
}
.footer__letter-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  color: var(--ivory);
}
.footer__letter-title em { font-style: italic; color: oklch(0.88 0.08 72); }
.footer__letter-body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: oklch(0.82 0.02 50);
  max-width: 48ch;
}
.footer__letter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__letter-form {
  position: relative;
}
.footer__letter-form > input,
.footer__letter-form > button {
  grid-row: 1;
}
.footer__letter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  row-gap: 12px;
}
.footer__letter-form input {
  background: transparent;
  border: none;
  border-bottom: 1px solid oklch(0.5 0.02 45);
  padding: 16px 0;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 24px;
  color: var(--ivory);
  outline: none;
  transition: border-color 200ms;
  letter-spacing: -0.01em;
}
.footer__letter-form input::placeholder { color: oklch(0.55 0.02 45); }
.footer__letter-form input:focus { border-color: oklch(0.88 0.08 72); }
.footer__letter-form button {
  background: transparent;
  border: none;
  border-bottom: 1px solid oklch(0.5 0.02 45);
  padding: 16px 0 16px 20px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.88 0.08 72);
  cursor: pointer;
  transition: color 200ms;
  white-space: nowrap;
}
.footer__letter-form button:hover { color: var(--ivory); }
.footer__letter-form small {
  grid-column: 1 / -1;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.55 0.02 45);
}
.footer__letter-ok {
  grid-column: 1 / -1;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 20px;
  color: oklch(0.88 0.08 72);
  padding: 16px 0;
  border-bottom: 1px solid oklch(0.5 0.02 45);
}
.footer__letter-ok em { color: var(--ivory); }

@media (max-width: 900px) {
  .footer__letter { grid-template-columns: 1fr; gap: 32px; padding-bottom: 50px; margin-bottom: 50px; }
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 70px;
  border-bottom: 1px solid oklch(0.3 0.02 40);
  margin-bottom: 60px;
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.72 0.02 45);
  margin: 0 0 22px;
  font-weight: 400;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__col a {
  font-family: var(--f-display);
  font-size: 18px;
  color: oklch(0.9 0.02 70);
  cursor: pointer;
  transition: color 200ms;
}
.footer__col a:hover { color: oklch(0.88 0.08 72); }

.footer__about {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  color: oklch(0.82 0.02 50);
  margin: 0 0 24px;
  max-width: 40ch;
}
.footer__addr {
  font-style: normal;
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.7;
  color: oklch(0.78 0.02 50);
}
.footer__addr a { color: oklch(0.88 0.08 72); cursor: pointer; }
.footer__addr a:hover { color: var(--ivory); }

.footer__wordmark {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(120px, 22vw, 360px);
  line-height: 0.85;
  letter-spacing: -0.035em;
  opacity: 0.92;
  color: var(--ivory);
  margin: 0 -2vw 40px;
  text-align: center;
  background: linear-gradient(180deg, oklch(0.92 0.02 70) 0%, oklch(0.75 0.06 68) 60%, oklch(0.45 0.06 55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cream SVG wordmark — sits between grid and bottom legal */
.footer__mark {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0 60px;
  margin: 0 -2vw 30px;
}
.footer__mark-svg {
  display: block;
  width: clamp(280px, 70vw, 880px);
  aspect-ratio: 595.28 / 301.22;
  background-color: oklch(0.88 0.08 72);
  -webkit-mask-image: url("assets/sonamere-creme.svg");
  mask-image: url("assets/sonamere-creme.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  opacity: 0.95;
}
@media (max-width: 720px) {
  .footer__mark { padding: 10px 0 30px; margin-bottom: 18px; }
  .footer__mark-svg { width: clamp(220px, 78vw, 560px); }
}

.footer__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding-top: 30px;
  padding-bottom: 16px;
  border-top: 1px solid oklch(0.3 0.02 40);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.6 0.02 45);
  align-items: center;
}
.footer__bottom > span:last-child { text-align: right; }
.footer__bottom-mid {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: oklch(0.85 0.05 65);
  white-space: nowrap;
}
.footer__bottom-mid em { color: oklch(0.88 0.08 72); }

.footer__legal {
  display: flex;
  gap: 22px;
  padding-top: 18px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.footer__legal a {
  color: oklch(0.55 0.02 45);
  cursor: pointer;
  transition: color 200ms;
}
.footer__legal a:hover { color: oklch(0.88 0.08 72); }

@media (max-width: 900px) {
  .footer__bottom { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .footer__bottom > span:last-child { text-align: left; }
  .footer__bottom-mid { white-space: normal; }
  .footer__legal { flex-wrap: wrap; }
}

/* Cursor helper for clickable things */
[role="button"], button { cursor: pointer; }

/* Tweaks panel */
.tweaks {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 100;
  width: 280px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 20px 60px -20px oklch(0.3 0.05 50 / 0.3);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink);
  display: none;
}
.tweaks.is-open { display: block; }
.tweaks h5 {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
}
.tweaks__row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tweaks__opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks__opt {
  border: 1px solid var(--line);
  background: transparent;
  padding: 6px 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  color: var(--ink);
}
.tweaks__opt.is-selected {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}
.tweaks__swatch.is-selected::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

/* Page-specific: see pages.css */

/* ——— Legal panel ——— */
.legal {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.legal.is-open { pointer-events: auto; }
.legal__scrim {
  position: absolute; inset: 0;
  background: oklch(0.16 0.02 40 / 0.46);
  opacity: 0;
  transition: opacity 400ms ease;
}
.legal.is-open .legal__scrim { opacity: 1; }
.legal__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(720px, 100vw);
  background: var(--ivory);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto auto 1fr;
  transform: translateX(100%);
  transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: -24px 0 60px oklch(0.16 0.02 40 / 0.18);
}
.legal.is-open .legal__panel { transform: translateX(0); }
.legal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 40px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.legal__close {
  background: none;
  border: 1px solid var(--line-soft);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: background 200ms, color 200ms, border-color 200ms;
}
.legal__close:hover { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

.legal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 18px 40px 0;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, transparent 0%, oklch(0.96 0.01 80 / 0.6) 100%);
}
.legal__tab {
  flex: 1 1 auto;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 0 18px;
  margin-right: 28px;
  color: var(--ink-mute);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 200ms ease, border-color 200ms ease;
  min-width: 0;
}
.legal__tab:last-child { margin-right: 0; }
.legal__tab:hover { color: var(--ink); }
.legal__tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--brass);
}
.legal__tab-num {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.legal__tab.is-active .legal__tab-num { color: var(--brass-deep); }
.legal__tab-label {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.legal__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.legal__article {
  padding: 40px 56px 80px;
  max-width: 64ch;
}
.legal__article h2 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}
.legal__article h3 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 40px 0 12px;
  font-weight: 400;
}
.legal__article h3:first-of-type { margin-top: 36px; }
.legal__article p {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.legal__article p em { color: var(--ink); font-style: italic; }
.legal__article a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease, color 200ms ease;
  cursor: pointer;
}
.legal__article a:hover { color: var(--brass-deep); border-bottom-color: var(--brass); }
.legal__lede {
  font-family: var(--f-body);
  font-size: 17px !important;
  line-height: 1.65 !important;
  color: var(--ink) !important;
  margin-bottom: 8px !important;
  text-wrap: balance;
}
.legal__article dl {
  display: grid;
  gap: 0;
  margin: 8px 0 8px;
  border-top: 1px solid var(--line-soft);
}
.legal__article dl > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.legal__article dt {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 3px;
}
.legal__article dd {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}
.legal__updated {
  margin-top: 36px !important;
  font-family: var(--f-mono);
  font-size: 10px !important;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute) !important;
}

@media (max-width: 720px) {
  .legal__head { padding: 18px 22px 14px; }
  .legal__tabs { padding: 12px 22px 0; gap: 8px; }
  .legal__tab { margin-right: 16px; padding: 10px 0 14px; }
  .legal__tab-label { font-size: 16px; }
  .legal__article { padding: 28px 22px 60px; }
  .legal__article h2 { font-size: 30px; }
  .legal__article dl > div { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
}
