/* ============================================================
   KIN — shared foundation
   Tokens, reset, typography, motion primitives, shared blocks.
   Brand skins live in hub.css / cafe.css / biryani.css
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Neutral ground — warm, paper-like */
  --bone:      #EFE9DE;
  --cream:     #FBF7EF;
  --ink:       #141210;
  --ink-soft:  #2E2823;
  --muted:     #7C7167;
  --line:      rgba(20, 18, 16, .14);
  --line-soft: rgba(20, 18, 16, .07);

  /* Brand accents — overridden per site */
  --bg:     var(--bone);
  --fg:     var(--ink);
  --accent: #B4553A;
  --accent-ink: #FBF7EF;

  /* Type */
  --display: "Fraunces", "Times New Roman", serif;
  --sans:    "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid scale — mobile first, capped at large desktop */
  --t-hero:  clamp(3.4rem, 15.5vw, 13rem);
  --t-xxl:   clamp(2.6rem, 8.5vw, 6.5rem);
  --t-xl:    clamp(2rem, 5.6vw, 4rem);
  --t-lg:    clamp(1.5rem, 3.4vw, 2.25rem);
  --t-md:    clamp(1.125rem, 2.1vw, 1.4rem);
  --t-body:  clamp(1rem, 1.35vw, 1.075rem);
  --t-sm:    .8125rem;
  --t-micro: .6875rem;

  /* Rhythm */
  --gut:     clamp(1.25rem, 5vw, 4.5rem);
  --section: clamp(5rem, 13vw, 11rem);
  --maxw:    1560px;

  /* Motion */
  --ease:      cubic-bezier(.22, 1, .36, 1);
  --ease-io:   cubic-bezier(.65, .05, .36, 1);

  --header-h: 68px;
}

@media (min-width: 900px) { :root { --header-h: 84px; } }

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}

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

/* The menu filters hide items with the [hidden] attribute, which only works
   through the UA default display:none. Components like .dish and .menu-item
   set display:grid, and an author rule beats the UA sheet — so [hidden] needs
   to win explicitly or filtered-out items stay on screen. */
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--fg); color: var(--bg);
  padding: .75rem 1.25rem; font: 400 var(--t-sm)/1 var(--mono);
}
.skip:focus { left: 1rem; top: 1rem; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 300;
  line-height: .94;
  letter-spacing: -.035em;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 100;
  text-wrap: balance;
}

.display   { font-size: var(--t-xxl); }
.display-l { font-size: var(--t-hero); line-height: .84; letter-spacing: -.05em; }
.display-s { font-size: var(--t-xl); }

.serif-it { font-style: italic; font-variation-settings: "SOFT" 40, "WONK" 1; }

/* Tiny tracked-out mono label — connective tissue across all three sites */
.label {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.label--fg { color: var(--fg); opacity: .55; }

.lede { font-size: var(--t-md); line-height: 1.45; letter-spacing: -.015em; max-width: 34ch; text-wrap: pretty; }
.body-lg { font-size: clamp(1.02rem, 1.6vw, 1.2rem); line-height: 1.6; max-width: 58ch; text-wrap: pretty; }
.dim { color: var(--muted); }

/* ---------- 4. Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: clamp(3.5rem, 8vw, 7rem); }
.rule { height: 1px; background: var(--line); border: 0; }

.sec-head { display: grid; gap: 1.75rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.sec-head__top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .sec-head--split { grid-template-columns: 1fr 1fr; align-items: end; }
  .sec-head--split .sec-head__top { grid-column: 1 / -1; }
}

/* ---------- 5. Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .8rem;
  padding: .95rem 1.6rem;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: .18em;
  text-transform: uppercase;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
.btn > * { position: relative; z-index: 1; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--fg);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .55s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleY(1); }
.btn:hover, .btn:focus-visible { color: var(--bg); }

.btn--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--solid::before { background: var(--accent); }
.btn--solid:hover, .btn--solid:focus-visible { color: var(--accent-ink); }

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

.tlink { display: inline-block; position: relative; padding-bottom: 3px; }
.tlink::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.tlink:hover::after, .tlink:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.tlink--on::after { transform: scaleX(1); }
.tlink--on:hover::after { transform: scaleX(0); transform-origin: right; }

/* ---------- 6. Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: transform .5s var(--ease), background-color .5s var(--ease), border-color .5s var(--ease);
}
.header.is-stuck {
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--line);
}
.header.is-hidden { transform: translateY(-102%); }
body.nav-open .header { transform: none; }

.header__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.wordmark {
  font-family: var(--display); font-size: 1.35rem; font-weight: 400;
  letter-spacing: -.03em; line-height: 1;
  display: inline-flex; align-items: baseline; gap: .5rem; white-space: nowrap;
}
.wordmark span {
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .2em; text-transform: uppercase; opacity: .55;
}
@media (min-width: 900px) { .wordmark { font-size: 1.6rem; } }

.nav { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 2.75rem); }
  .nav a { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .18em; text-transform: uppercase; }
}
.header__cta { display: none; }
@media (min-width: 1100px) { .header__cta { display: inline-flex; } }

.menu-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .18em; text-transform: uppercase;
  padding: .5rem 0; z-index: 101;
}
@media (min-width: 900px) { .menu-btn { display: none; } }

.menu-btn__bars { display: block; width: 22px; height: 9px; position: relative; }
.menu-btn__bars i {
  position: absolute; left: 0; width: 100%; height: 1px; background: currentColor;
  transition: transform .45s var(--ease);
}
.menu-btn__bars i:first-child { top: 0; }
.menu-btn__bars i:last-child  { bottom: 0; }
body.nav-open .menu-btn__bars i:first-child { transform: translateY(4px) rotate(45deg); }
body.nav-open .menu-btn__bars i:last-child  { transform: translateY(-4px) rotate(-45deg); }

/* ---------- 7. Mobile drawer ---------- */
.drawer {
  position: fixed; inset: 0; z-index: 95;
  background: var(--bg);
  padding: calc(var(--header-h) + 2.5rem) var(--gut) 2.5rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  transform: translateY(-100%);
  transition: transform .7s var(--ease);
  visibility: hidden;
  overflow-y: auto; overscroll-behavior: contain;
}
body.nav-open .drawer { transform: translateY(0); visibility: visible; }
@media (min-width: 900px) { .drawer { display: none; } }

.drawer__list li { overflow: hidden; border-bottom: 1px solid var(--line); }
.drawer__list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .85rem 0;
  font-family: var(--display); font-size: clamp(2.1rem, 11vw, 3.2rem);
  font-weight: 300; letter-spacing: -.04em; line-height: 1.05;
  transform: translateY(105%);
  transition: transform .7s var(--ease);
}
body.nav-open .drawer__list a { transform: translateY(0); }
.drawer__list li:nth-child(1) a { transition-delay: .10s; }
.drawer__list li:nth-child(2) a { transition-delay: .16s; }
.drawer__list li:nth-child(3) a { transition-delay: .22s; }
.drawer__list li:nth-child(4) a { transition-delay: .28s; }
.drawer__list li:nth-child(5) a { transition-delay: .34s; }
.drawer__list li:nth-child(6) a { transition-delay: .40s; }
.drawer__list a i { font: 400 var(--t-micro)/1 var(--mono); font-style: normal; opacity: .45; letter-spacing: .1em; }

.drawer__foot { display: grid; gap: 1.25rem; }

/* ---------- 8. Reveal / motion primitives ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal="fade"] { transform: none; }

/* Line-by-line masked text reveal (JS wraps each line in .ln > i) */
.ln { display: block; overflow: hidden; }
.ln > i {
  display: block; font-style: inherit;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease);
  transition-delay: var(--ld, 0s);
}
.in .ln > i, .ln.in > i { transform: translateY(0); }

/* Image mask reveal */
.mask { overflow: hidden; position: relative; }
.mask > img, .mask > .plate { transform: scale(1.16); transition: transform 1.5s var(--ease); }
.mask.in > img, .mask.in > .plate { transform: scale(1); }
.mask::after {
  content: ""; position: absolute; inset: 0;
  background: var(--bg); transform-origin: bottom;
  transition: transform 1.2s var(--ease);
}
.mask.in::after { transform: scaleY(0); }

/* Figures */
.fig { position: relative; }
.fig img, .fig .plate { width: 100%; height: 100%; object-fit: cover; }
.fig figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--line);
}
.r-1x1  { aspect-ratio: 1 / 1; }
.r-4x5  { aspect-ratio: 4 / 5; }
.r-3x4  { aspect-ratio: 3 / 4; }
.r-3x2  { aspect-ratio: 3 / 2; }
.r-16x9 { aspect-ratio: 16 / 9; }

/* ---------- 9. Marquee ---------- */
.marquee {
  overflow: hidden; display: flex; user-select: none;
  border-block: 1px solid var(--line);
  padding-block: clamp(.9rem, 2vw, 1.5rem);
}
.marquee__track {
  display: flex; align-items: center; flex-shrink: 0; min-width: 100%;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-right: clamp(1.5rem, 4vw, 3.5rem);
  animation: slide 34s linear infinite;
}
.marquee--slow .marquee__track { animation-duration: 55s; }
.marquee--rev .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track > * {
  flex-shrink: 0;
  font-family: var(--display); font-size: clamp(1.6rem, 4.5vw, 3.25rem);
  font-weight: 300; letter-spacing: -.03em; line-height: 1; white-space: nowrap;
}
.marquee__track .dot { font-size: clamp(.5rem, 1.2vw, .8rem); color: var(--accent); }
@keyframes slide { to { transform: translateX(-100%); } }

/* ---------- 10. Footer ---------- */
.footer { padding-top: clamp(3.5rem, 8vw, 6rem); padding-bottom: 2rem; border-top: 1px solid var(--line); }
.footer__grid { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 780px)  { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 1100px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.1fr; } }
.footer__col { display: grid; gap: 1rem; align-content: start; }
.footer__col ul { display: grid; gap: .65rem; }
.footer__big {
  font-family: var(--display); font-size: clamp(3.4rem, 13vw, 9rem);
  font-weight: 300; letter-spacing: -.055em; line-height: .8;
  margin-top: clamp(3rem, 8vw, 5rem); opacity: .12; pointer-events: none;
}
.footer__base {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line);
}

/* Cross-brand switch card */
.sister {
  display: grid; gap: 1.1rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--line); border-radius: 4px;
  transition: border-color .5s var(--ease), transform .5s var(--ease);
}
.sister:hover { border-color: currentColor; transform: translateY(-3px); }
.sister__name { font-family: var(--display); font-size: var(--t-lg); font-weight: 300; letter-spacing: -.03em; line-height: 1; }

/* ---------- 11. Cursor (fine pointer only) ---------- */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  pointer-events: none; z-index: 500;
  mix-blend-mode: difference;
  transform: translate3d(-50%, -50%, 0);
  transition: width .35s var(--ease), height .35s var(--ease), opacity .3s;
  opacity: 0; display: none;
}
.cursor.on { opacity: 1; }
.cursor.grow { width: 58px; height: 58px; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }

/* ---------- 12. Plates — typographic panels, used instead of photography ----------
   A plate is a self-contained composition: a gradient ground, a fine pattern
   field, film grain, and type. It carries meaning rather than standing in for
   a picture that isn't coming. */
.plate {
  position: relative;
  width: 100%; height: 100%;
  min-height: 240px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.25rem;
  padding: clamp(1.15rem, 3vw, 2rem);
  border-radius: 3px;
  isolation: isolate;
  color: var(--plate-fg, #F6EFE2);
  background:
    radial-gradient(110% 90% at 12% 8%, var(--plate-b, #B9A488) 0%, transparent 58%),
    linear-gradient(155deg, var(--plate-a, #7E7156) 0%, var(--plate-c, #342C21) 100%);
}

/* Pattern field */
.plate::before {
  content: "";
  position: absolute; inset: -10%;
  z-index: -1;
  opacity: var(--pattern-o, .16);
  background-image: var(--pattern, none);
  background-size: var(--pattern-size, 30px 30px);
}

/* Film grain — keeps flat gradients from looking like plastic */
.plate::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  opacity: .3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.plate__top, .plate__bot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; width: 100%;
}
.plate__top, .plate__bot { opacity: .78; }
.plate__bot { border-top: 1px solid rgba(255,255,255,.2); padding-top: .8rem; }

.plate__body { display: grid; gap: .85rem; place-content: center; justify-items: center; text-align: center; }
.plate__mark {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: .88; letter-spacing: -.045em;
}
.plate__mark em { font-style: italic; }
.plate__note { max-width: 26ch; font-size: .95rem; opacity: .78; }

/* Pattern modifiers */
.p-rule { --pattern: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 13px); --pattern-o: .13; }
.p-arcs { --pattern: repeating-radial-gradient(circle at 50% 118%, currentColor 0 1px, transparent 1px 24px); --pattern-o: .16; }
.p-dots { --pattern: radial-gradient(currentColor 1.1px, transparent 1.2px); --pattern-size: 20px 20px; --pattern-o: .15; }
.p-grid { --pattern: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px); --pattern-size: 34px 34px; --pattern-o: .1; }
.p-weave { --pattern: repeating-linear-gradient(45deg, currentColor 0 1px, transparent 1px 11px), repeating-linear-gradient(-45deg, currentColor 0 1px, transparent 1px 11px); --pattern-o: .1; }

/* ---------- Seal — rotating circular lockup ---------- */
.seal { position: relative; display: grid; place-items: center; width: clamp(150px, 34vw, 230px); aspect-ratio: 1; }
.seal svg { width: 100%; height: 100%; overflow: visible; animation: spin 30s linear infinite; }
.seal text { font-family: var(--mono); font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; fill: currentColor; }
.seal__core {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 300; letter-spacing: -.04em; line-height: .9; text-align: center;
}
.seal__core small { display: block; font-family: var(--mono); font-size: .5rem; letter-spacing: .24em; opacity: .6; margin-top: .45rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Rings — the dum seal, drawn ---------- */
.rings { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-width: 480px; margin-inline: auto; }
.rings svg { width: 100%; height: 100%; }
.rings circle { fill: none; stroke: currentColor; }
.rings .ring { opacity: .3; }
.rings .ring--dash { opacity: .85; stroke-dasharray: 2 9; transform-origin: 50% 50%; animation: spin 44s linear infinite; }
.rings .ring--pulse { opacity: .5; transform-origin: 50% 50%; animation: breathe 5.5s var(--ease-io) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.97); opacity: .28; } 50% { transform: scale(1.03); opacity: .6; } }
.rings__core {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center;
  gap: .4rem; text-align: center;
}
.rings__core b { font-family: var(--display); font-weight: 300; font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -.04em; line-height: .9; }

/* ---------- 13. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .ln > i { transform: none !important; }
  .mask::after { display: none; }
  .mask > img, .mask > .plate { transform: none !important; }
  .cursor { display: none !important; }
}

/* Labels sitting on a plate inherit its colour rather than the page ink */
.plate .label, .plate .label--fg { color: inherit; opacity: .62; }

/* A plate with no bottom row — the body track runs to the padding edge so
   its contents centre against the whole panel. */
.plate--seal { grid-template-rows: auto 1fr; }
