/* ============================================================
   Ameya Vritti · Vaya (वय) · Heritage & Conservation imprint
   Shared foundation for /curated and /curated/[chapter].
   A warm sibling to the main site. Self-hosted fonts, no CDN.
   Contrast on --paper computed, not eyeballed:
     ink 15.4 · ink-soft 9.4 · terracotta 4.92 (all body-safe)
     gold-text 5.52 (body-safe) · gold 3.39 (large only)
     ochre 2.68 (hairline/decoration only on light)
   ============================================================ */

/* ---- self-hosted faces (build-time fetched, runtime local) ---- */
@font-face{
  font-family:'Fraunces';font-style:normal;font-weight:300 500;font-display:swap;
  src:url('/curated/fonts/fraunces-normal.woff2') format('woff2');
}
@font-face{
  font-family:'Fraunces';font-style:italic;font-weight:300 500;font-display:swap;
  src:url('/curated/fonts/fraunces-italic.woff2') format('woff2');
}
@font-face{
  font-family:'Inter Tight';font-style:normal;font-weight:400 600;font-display:swap;
  src:url('/curated/fonts/inter-tight.woff2') format('woff2');
}
@font-face{
  font-family:'JetBrains Mono';font-style:normal;font-weight:400 500;font-display:swap;
  src:url('/curated/fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face{
  font-family:'Noto Serif Devanagari';font-style:normal;font-weight:400 500;font-display:swap;
  src:url('/curated/fonts/noto-serif-devanagari.woff2') format('woff2');
}

:root{
  --ink:#1c1813; --ink-soft:#473c2d;
  --paper:#f6efe2; --paper-warm:#ece2cf; --paper-deep:#e2d5bb;
  --terracotta:#b0452a;         /* large display + decoration only */
  --terracotta-text:#a23f26;    /* body-safe accent for text: 4.99 on paper-warm, 5.61 on paper */
  --ochre:#be8a2c; --gold:#a37b22; --moss:#586643;
  --gold-text:#7c5a12;          /* body-safe gold for small text (5.5:1) */
  --line:#c8b794;
  --line-soft:rgba(200,183,148,.5);
  --rule-onDark:rgba(226,213,187,.16);
  --f-body:'Inter Tight',system-ui,sans-serif;
  --f-disp:'Fraunces',Georgia,serif;
  --f-dev:'Noto Serif Devanagari',Georgia,serif;
  --f-mono:'JetBrains Mono',ui-monospace,monospace;
  --ease:cubic-bezier(.22,1,.36,1);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  background:var(--paper);color:var(--ink);
  font-family:var(--f-body);font-size:17px;line-height:1.6;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x:clip;
}
img,video{display:block;width:100%;height:100%;object-fit:cover}

/* paper grain, fixed, does not tile visibly while scrolling */
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:200;opacity:.5;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.04 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}

/* type helpers */
.mono{font-family:var(--f-mono);font-size:11px;letter-spacing:.24em;text-transform:uppercase}
.fr{font-family:var(--f-disp)}
.dev{font-family:var(--f-dev)}
.kick{color:var(--terracotta-text)}
a{color:inherit;text-decoration:none}

/* focus, honest and visible */
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,
[tabindex]:focus-visible{outline:2px solid var(--terracotta);outline-offset:3px;border-radius:1px}

/* ---- masthead (shared) ---- */
.mast{position:fixed;top:0;left:0;right:0;z-index:150;
  display:flex;justify-content:space-between;align-items:center;
  padding:20px clamp(18px,4vw,34px)}
.mast.on-dark{mix-blend-mode:difference;color:#fff}
.mast.on-light{background:linear-gradient(180deg,rgba(246,239,226,.94),rgba(246,239,226,0));color:var(--ink)}
.mast .lockup{font-family:var(--f-disp);font-size:15px;letter-spacing:.14em}
.mast .lockup span{opacity:.55}
.mast .wm{font-family:var(--f-dev);font-size:17px;letter-spacing:.06em;opacity:.9}

/* ---- footer (shared): Sanskrit anchor leads, then a clean mark + nav row ---- */
.foot{background:var(--ink);color:var(--paper-deep);padding:clamp(66px,11vh,130px) clamp(20px,8vw,120px) 46px}
.foot-in{max-width:var(--max);margin:0 auto}
.foot-anchor{text-align:center;font-family:var(--f-dev);font-size:clamp(30px,5vw,56px);color:var(--gold);line-height:1.15;letter-spacing:.02em}
.foot-gloss{text-align:center;font-family:var(--f-disp);font-style:italic;font-weight:300;font-size:clamp(15px,1.8vw,18px);color:var(--paper-deep);margin-top:14px}
.foot-rule{height:1px;background:var(--rule-onDark);border:0;margin:clamp(40px,6vh,66px) 0 28px}
.foot-mid{display:flex;align-items:baseline;justify-content:space-between;gap:24px;flex-wrap:wrap}
.foot-mark{font-family:var(--f-disp);font-size:19px;letter-spacing:.1em;color:var(--paper)}
.foot-mark span{opacity:.5}
.foot-nav{display:flex;gap:clamp(18px,3vw,40px);flex-wrap:wrap}
.foot-nav a{font-family:var(--f-mono);font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--paper-deep);transition:color .18s var(--ease)}
.foot-nav a:hover{color:var(--ochre)}
.foot-base{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-top:26px}
.foot-base .en{font-family:var(--f-mono);font-size:9.5px;letter-spacing:.22em;text-transform:uppercase;color:var(--paper-deep);opacity:.78}
.foot-base .nm{font-family:var(--f-dev);font-size:16px;color:var(--gold);opacity:.9}
@media(max-width:640px){
  .foot-mid{flex-direction:column;align-items:flex-start;gap:18px}
  .foot-base{flex-direction:column;align-items:flex-start;gap:12px}
}

/* honour reduced motion everywhere */
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms !important;animation-iteration-count:1 !important;
    transition-duration:.001ms !important;scroll-behavior:auto !important}
}
