/* ════════════════════════════════════════════════════════════════════════
   Qyverix — shared site system (Nov 2026). Loaded by every page.
   Two worlds: [data-theme="ink"] Foundry · [data-theme="paper"] Press.
   Homepage-only sections live in css/home.css; subpage layouts in css/pages.css.
   ════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Archivo'; src: url('../assets/fonts/archivo-var.woff2') format('woff2-variations'), url('../assets/fonts/archivo-var.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../assets/fonts/instrument-serif-italic.woff2') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../assets/fonts/instrument-serif.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-var.woff2') format('woff2-variations'), url('../assets/fonts/jetbrains-mono-var.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Noto Sans Telugu'; src: url('../assets/fonts/noto-sans-telugu-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0C00-0C7F; }

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --f-sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-serif: 'Instrument Serif', 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --gut: clamp(16px, 3.2vw, 44px);
  --max: 1440px;
  --r: 6px;
}
[data-theme="ink"] {
  color-scheme: dark;
  --bg: #0c0b0a; --bg-2: #141210; --bg-3: #1b1815;
  --fg: #f1ebdf; --fg-2: #b4ab9c; --fg-3: #998f80;
  --line: rgba(241, 235, 223, .13); --line-2: rgba(241, 235, 223, .26);
  --a1: #d9a54a;            /* brass — the logo's metal */
  --a2: #ff6a2b;            /* copper — the circuit traces */
  --a1-ink: #120d03;
  --sel: #ff6a2b;
  --field-work: #12100e; --field-prod: #17140f; --field-team: #0f0e0c; --field-fn: #d9a54a; --field-fn-fg: #120d03;
  --grain-op: .09; --grain-blend: screen;
  --reg: none;              /* no print registration in the foundry */
  --wax-diffuse: #d49a37; --wax-spec: #fff3c8; --wax-shadow: #3f2304;
}
[data-theme="paper"] {
  color-scheme: light;
  --bg: #efeae0; --bg-2: #f8f6f1; --bg-3: #e5dfd2;
  --fg: #141210; --fg-2: #4a453d; --fg-3: #5c574e;
  --line: rgba(20, 18, 16, .16); --line-2: rgba(20, 18, 16, .34);
  --a1: #e2401f;            /* vermilion ink */
  --a2: #2337c6;            /* cobalt ink */
  --a1-ink: #fff8f0;
  --sel: #e2401f;
  --field-work: #fbfaf6; --field-prod: #2337c6; --field-team: #efeae0; --field-fn: #e2401f; --field-fn-fg: #fff8f0;
  --grain-op: .16; --grain-blend: multiply;
  --reg: .045em .03em 0 rgba(226, 64, 31, .5), -.035em -.02em 0 rgba(35, 55, 198, .38);
  --wax-diffuse: #d9502f; --wax-spec: #ffe1cf; --wax-shadow: #4a0f06;
}

/* ── Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--f-sans); font-stretch: 100%; background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background-color .6s var(--ease), color .6s var(--ease); }
body::after { /* procedural grain — no image */
  content: ""; position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-4%); } 60% { transform: translate(-4%,-2%); } 80% { transform: translate(3%,3%); } }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: var(--sel); color: #fff; }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 10px 14px; background: var(--a1); color: var(--a1-ink); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: calc(var(--max) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.label { color: var(--fg-3); display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.label b { color: var(--a2); font-weight: 600; }
.label::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--line-2); }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; font-stretch: 100%; }
.sec-head { display: grid; gap: 4px; margin-bottom: clamp(48px, 7vw, 96px); max-width: 1100px; }
.sec-title { font: 700 clamp(2.4rem, 6.4vw, 6.4rem)/.92 var(--f-sans); font-stretch: 78%; letter-spacing: -.035em; text-shadow: var(--reg); }
.sec-title em { font-size: 1.08em; color: var(--a1); text-shadow: none; }
.sec-sub { margin-top: 18px; color: var(--fg-2); max-width: 52ch; font-size: 1.1rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: 999px; font: 600 15px/1 var(--f-sans); font-stretch: 100%; text-decoration: none; white-space: nowrap; border: 1.5px solid transparent; transition: background .3s var(--ease), color .3s, border-color .3s, transform .5s var(--ease); will-change: transform; }
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: var(--a1); color: var(--a1-ink); }
.btn--line { border-color: var(--line-2); color: var(--fg); }
.btn--line:hover { border-color: var(--fg); }

/* ── Header ──────────────────────────────────────────────────────────── */
.hd { position: fixed; z-index: 120; inset: 14px var(--gut) auto; display: flex; align-items: center; gap: 20px; height: 58px; padding: 0 8px 0 16px; border-radius: 999px; transition: background .4s var(--ease), border-color .4s, transform .5s var(--ease); border: 1px solid transparent; }
.hd.is-solid { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-color: var(--line); }
.hd.is-hidden { transform: translateY(-140%); }
.hd__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; font: 700 17px/1 var(--f-sans); font-stretch: 112%; letter-spacing: -.01em; }
.hd__brand svg { width: 28px; height: 28px; }
.hd__body { fill: var(--fg); } .hd__circ { fill: var(--a2); }
.hd__nav { display: flex; gap: 2px; }
.hd__nav a { padding: 10px 12px; font-size: 14px; color: var(--fg-2); text-decoration: none; border-radius: 999px; transition: color .25s, background .25s; }
.hd__nav a:hover { color: var(--fg); background: var(--line); }
.hd__theme { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--fg); cursor: pointer; font: 500 13px/1 var(--f-sans); }
.hd__theme-dial { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 200deg, var(--a1), var(--a2), var(--a1)); }
.hd__theme-dial i { width: 12px; height: 12px; border-radius: 50%; background: var(--bg); transition: transform .6s var(--ease); }
[data-theme="paper"] .hd__theme-dial i { transform: translateX(4px) scale(.7); }
.hd__cta { min-height: 42px; }
.hd__menu { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; position: relative; cursor: pointer; }
.hd__menu span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease); }
.hd__menu span:first-child { top: 17px; } .hd__menu span:nth-child(2) { top: 25px; }
.hd__menu[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.hd__menu[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.menu { position: fixed; inset: 0; z-index: 110; background: var(--bg); padding: 100px var(--gut) 40px; }
.menu nav { display: grid; }
.menu a { padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font: 700 2.2rem/1 var(--f-sans); font-stretch: 80%; letter-spacing: -.03em; }
@media (max-width: 1080px) { .hd__nav { display: none; } }
@media (max-width: 720px) { .hd__cta, .hd__theme-label { display: none; } .hd__theme { padding: 0 6px; } .hd__menu { display: block; } }

/* ── Footer ──────────────────────────────────────────────────────────── */
.ft { padding: clamp(72px, 9vw, 120px) 0 0; border-top: 1px solid var(--line); overflow: hidden; }
.ft__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 28px; }
.ft__brand svg { width: 54px; height: 54px; }
.ft__brand p { margin-top: 18px; font: 700 1.6rem/1.05 var(--f-sans); font-stretch: 84%; letter-spacing: -.02em; }
.ft__brand em { color: var(--a1); }
.ft__col { display: grid; align-content: start; gap: 10px; font-size: 15px; }
.ft__col h2 { color: var(--fg-3); font-weight: 500; margin-bottom: 6px; }
.ft__col a, .ft__col address { color: var(--fg-2); text-decoration: none; font-style: normal; }
.ft__col a:hover { color: var(--a2); }
/* Footer wordmark: fitted to the exact width; letters swell and fill under the pointer (js: home.js / site.js) */
.ft__mark .kin { display: inline-flex; white-space: nowrap; }
.ft__mark .kin__c { display: inline-block; font-stretch: calc(var(--w, 100) * 1%); transform-origin: 50% 100%; transform: translateY(var(--y, 0%)) scale(var(--sx, 1), var(--sy, 1)); will-change: transform; }
.ft__mark { margin: clamp(48px, 7vw, 96px) var(--gut) 0; font: 900 20vw/.8 var(--f-sans); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px var(--line-2); user-select: none; white-space: nowrap; padding-bottom: .05em; cursor: default; }
.ft__mark-in { display: inline-block; }
.ft__mark .kin__c { --w: 125; color: color-mix(in srgb, var(--a1) calc(var(--k, 0) * 100%), transparent); -webkit-text-stroke-color: color-mix(in srgb, var(--a1) calc(var(--k, 0) * 100%), var(--line-2)); transition: transform .5s var(--ease), color .4s, -webkit-text-stroke-color .4s; }
.ft__bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px var(--gut); border-top: 1px solid var(--line); color: var(--fg-3); font-size: 11px; }
.ft__bar a { text-decoration: none; } .ft__bar a:hover { color: var(--a2); }
@media (max-width: 960px) { .ft__grid { grid-template-columns: 1fr 1fr; } .ft__brand { grid-column: 1 / -1; } }

/* ── WhatsApp float (lib/pagekit.php) ────────────────────────────────── */
.qx-wa { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--fg); color: var(--bg); text-decoration: none; font: 600 14px/1 var(--f-sans); opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s var(--ease); }
.qx-wa.is-ready { opacity: 1; transform: none; }
.qx-wa__icon { width: 22px; height: 22px; color: #25d366; } .qx-wa__icon svg { width: 22px; height: 22px; }
.qx-wa__dot { display: none; }
@media (max-width: 640px) { .qx-wa { width: 50px; padding: 0; justify-content: center; } .qx-wa__label { display: none; } }

/* ── Theme transition (View Transitions API) ─────────────────────────── */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

/* ── Reduced motion + print (shared) ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } *, *::before, *::after { transition-duration: .01ms !important; } }
@media print { body::after, .hd, .qx-wa { display: none !important; } }
