/* Arsh Kumar site kit: tokens and the shared chrome (header, theme switch, footer, cursor) for
   arshkumar.com, play.arshkumar.com and search.arshkumar.com. Served from https://arshkumar.com/kit/.
   Load before a site's own stylesheet. Pairs with kit.js. */

/* Fonts are self-hosted (OFL, licences in /kit/fonts/), so no visitor request goes to a third party */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/geist-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-latin-italic.woff2) format("woff2"); }

/* Arsh Kumar design system: tokens (from project/tokens.json) */
:root {
  color-scheme: dark;
  --paper: #12110f; --paper-raised: #1b1a17; --paper-sunk: #0b0a09;
  --ink: #ece8df; --ink-muted: #a39d91; --ink-faint: #6f6a61; --on-ink: #12110f;
  --rule: #2d2b27; --rule-strong: #6e695f;
  --oxide: #3ddc84; --oxide-ink: #6ee7a0; --oxide-soft: #12301e; --on-oxide: #12110f;
  --cobalt: #9aaaf0; --cobalt-soft: #1e2440; --on-cobalt: #12110f;
  --live: #6fcf97;
  --shadow-float: 0 12px 32px -12px rgba(0, 0, 0, .6);
  --font-display: "Instrument Serif", "Iowan Old Style", "Times New Roman", Georgia, serif;
  --font-sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-pill: 999px;
  --size-content: 1120px; --size-measure: 64ch; --size-hairline: 1px; --size-focus: 2px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f4f2ec; --paper-raised: #fbfaf7; --paper-sunk: #e9e6de;
  --ink: #191814; --ink-muted: #433f38; --ink-faint: #8b867c; --on-ink: #f4f2ec;
  --rule: #d8d4ca; --rule-strong: #8a8478;
  --oxide: #0f6b38; --oxide-ink: #0b5a2e; --oxide-soft: #b9e3c9; --on-oxide: #fbfaf7;
  --cobalt: #1d2f8a; --cobalt-soft: #c5cff0; --on-cobalt: #fbfaf7;
  --live: #2f6b45;
  --shadow-float: 0 12px 32px -12px rgba(25, 24, 20, .18);
}

.ak-root, .ak-root * { box-sizing: border-box; }
.ak-root { background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 26px; -webkit-font-smoothing: antialiased; }
.ak-mono { font-family: var(--font-mono); }
.ak-label { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.ak-meta { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.ak-focus:focus-visible, .ak-btn:focus-visible, .ak-card:focus-visible, .ak-nav a:focus-visible, .ak-link:focus-visible {
  outline: var(--size-focus) solid var(--oxide); outline-offset: 2px;
}
.ak-link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); transition: color 160ms cubic-bezier(.2,.7,.2,1); }
.ak-link:hover { color: var(--oxide-ink); text-decoration-color: currentColor; }


/* ---------- Wordmark ---------- */
.ak-wordmark { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.ak-logo { display: block; height: 30px; width: auto; overflow: visible; }
.ak-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ak-logo .lg-t, #ak-wordmark .lg-t { fill: var(--ink); }
.ak-logo .lg-th, #ak-wordmark .lg-th { fill: var(--oxide); animation: ak-breathe 2.4s ease-in-out infinite; }
.ak-wordmark--l .ak-logo { height: 52px; }
@keyframes ak-breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ak-logo .lg-th, #ak-wordmark .lg-th { animation: none; } }

/* ---------- Nav bar ---------- */
.ak-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding: var(--space-3) var(--space-6); background: var(--paper-raised); border-bottom: var(--size-hairline) solid var(--rule); }
.ak-nav .ak-logo { height: 26px; }
.ak-nav__links { display: flex; align-items: center; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.ak-nav__links a { color: var(--ink-muted); text-decoration: none; transition: color 160ms cubic-bezier(.2,.7,.2,1); }
.ak-nav__links a { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 6px; transition: color 160ms cubic-bezier(.2,.7,.2,1), text-decoration-color 160ms cubic-bezier(.2,.7,.2,1); }
.ak-nav__links a:hover, .ak-nav__links a[aria-current="page"] { color: var(--ink); }
.ak-nav__links a:hover { text-decoration-color: var(--oxide); }
.ak-nav__links a[aria-current="page"]::before { content: "/"; color: var(--oxide-ink); margin-right: 2px; }

/* ---------- page ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.skip { position: absolute; left: var(--space-4); top: -48px; z-index: 20; padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--on-ink); }
.skip:focus { top: var(--space-2); }
.wrap { width: 100%; max-width: calc(var(--size-content) + 2 * var(--space-12)); margin: 0 auto; padding: 0 var(--space-12); }
@media (max-width: 720px) { .wrap { padding: 0 var(--space-4); } }

.site-nav { position: sticky; top: 0; z-index: 10; }
.site-nav .ak-nav { padding-left: max(var(--space-6), calc((100vw - var(--size-content)) / 2)); padding-right: max(var(--space-6), calc((100vw - var(--size-content)) / 2)); }

/* light/dark switch: sun and moon either side of a sliding knob */
.theme-switch { position: relative; display: inline-flex; align-items: center; justify-content: space-between; width: 52px; height: 26px; padding: 0 5px; background: var(--paper-sunk); border: var(--size-hairline) solid var(--rule-strong); border-radius: var(--radius-pill); color: var(--ink-faint); cursor: pointer; vertical-align: middle; }
.theme-switch svg { position: relative; z-index: 1; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: color .2s; }
.theme-switch__knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--oxide); transition: transform .22s cubic-bezier(.4, 0, .2, 1); }
.theme-switch[aria-checked="true"] .theme-switch__knob { transform: translateX(26px); }
.theme-switch[aria-checked="false"] .theme-switch__sun, .theme-switch[aria-checked="true"] .theme-switch__moon { color: var(--on-oxide); }
.theme-switch:hover { border-color: var(--ink); }
.theme-switch:focus-visible { outline: var(--size-focus) solid var(--oxide); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .theme-switch__knob, .theme-switch svg { transition: none; } }

.foot { border-top: var(--size-hairline) solid var(--rule); padding: var(--space-6) 0 var(--space-12); color: var(--ink-muted); }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.foot a { color: inherit; }

/* nav: glass once scrolled */
.site-nav .ak-nav { transition: background-color 240ms cubic-bezier(.2,.7,.2,1); }
.site-nav.is-scrolled .ak-nav { background: color-mix(in srgb, var(--paper-raised) 80%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); }
.ak-nav__links a[aria-current="location"] { color: var(--ink); }
.ak-nav__links a[aria-current="location"]::before { content: "/"; color: var(--oxide-ink); margin-right: 2px; }

/* custom cursor: white arrow, black outline, a green light running round it */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input:not([type="submit"]):not([type="button"]), .has-cursor textarea, .has-cursor [contenteditable="true"] { cursor: text !important; }
.cursor { position: fixed; top: 0; left: 0; z-index: 2147483647; width: 24px; height: 24px; pointer-events: none; opacity: 0; will-change: transform; }
.has-cursor .cursor { opacity: 1; }
.cursor.is-out, .cursor.is-text { opacity: 0 !important; }
.cursor svg { display: block; overflow: visible; transition: transform 120ms cubic-bezier(.2,.7,.2,1); transform-origin: 3px 2px; }
.cursor.is-down svg { transform: scale(.88); }
.cursor__body { fill: #fff; stroke: #111; stroke-width: 1.5; stroke-linejoin: round; }
.cursor__trace { fill: none; stroke: #3ddc84; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 14 86; filter: drop-shadow(0 0 2px #3ddc84); animation: cursor-trace 1.8s linear infinite; }
.cursor.is-link .cursor__trace { stroke-dasharray: 12 38; animation-duration: .9s; }
@keyframes cursor-trace { to { stroke-dashoffset: -100; } }

/* easter egg: the θ spins once */
.ak-logo .lg-th, #ak-wordmark .lg-th { transform-box: fill-box; transform-origin: center; }
.ak-logo .lg-th.spin, #ak-wordmark .lg-th.spin { animation: ak-breathe 2.4s ease-in-out infinite, th-spin 900ms cubic-bezier(.2,.7,.2,1); }
@keyframes th-spin { to { transform: rotate(360deg); } }

/* custom elements are layout-transparent, so the sticky header sticks to the page, not to <ak-header> */
ak-header, ak-footer { display: contents; }
.foot__notes { display: block; margin-bottom: var(--space-4); }
.foot__notes p { margin: 0 0 var(--space-2); }
/* hidden after a theme flip until the mouse moves, so Chrome's briefly re-shown native arrow is never doubled */
.cursor.is-hold { opacity: 0 !important; }

/* ---------- nav menus: Projects dropdown, mobile panel ---------- */
.ak-nav { position: relative; }
.ak-nav__links { margin-left: auto; }
.ak-nav__end { display: flex; align-items: center; gap: var(--space-4); }
.ak-nav__drop, .ak-nav__burger { display: inline-flex; align-items: center; gap: 6px; padding: 0; margin: 0; background: none; border: 0; color: var(--ink-muted); cursor: pointer; transition: color 160ms cubic-bezier(.2,.7,.2,1); }
.ak-nav__drop:hover, .ak-nav__drop[aria-expanded="true"], .ak-nav__burger:hover, .ak-nav__burger[aria-expanded="true"] { color: var(--ink); }
.ak-nav__drop:focus-visible, .ak-nav__burger:focus-visible { outline: var(--size-focus) solid var(--oxide); outline-offset: 4px; }
.ak-nav__caret { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms cubic-bezier(.2,.7,.2,1); }
.ak-nav__drop[aria-expanded="true"] .ak-nav__caret { transform: rotate(180deg); }
.ak-nav__menu:has(a[aria-current]) .ak-nav__drop { color: var(--ink); }
.ak-nav__menu:has(a[aria-current]) .ak-nav__drop::before { content: "/"; color: var(--oxide-ink); margin-right: -4px; }
.ak-nav__menu { position: relative; }
.ak-nav__sub { position: absolute; top: calc(100% + 14px); left: -16px; z-index: 11; min-width: 190px; margin: 0; padding: var(--space-2); list-style: none;
  background: var(--paper-raised); border: var(--size-hairline) solid var(--rule); border-radius: var(--radius-sm); box-shadow: var(--shadow-float);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 160ms cubic-bezier(.2,.7,.2,1), transform 160ms cubic-bezier(.2,.7,.2,1), visibility 0s linear 160ms; }
.ak-nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -15px; height: 15px; } /* hover bridge */
.ak-nav__sub a { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs); white-space: nowrap; }
.ak-nav__sub a:hover { background: var(--oxide-soft); color: var(--oxide-ink); text-decoration-color: transparent; }
.ak-nav__drop[aria-expanded="true"] + .ak-nav__sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) {
  .ak-nav__menu:hover .ak-nav__sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .ak-nav__menu:hover .ak-nav__drop { color: var(--ink); }
}
.ak-nav__burger { display: none; }
.ak-nav__burger svg { width: 18px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (max-width: 720px) {
  .ak-nav__burger { display: inline-flex; }
  .ak-nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4); background: var(--paper-raised); border-bottom: var(--size-hairline) solid var(--rule); box-shadow: var(--shadow-float);
    max-height: calc(100svh - 56px); overflow-y: auto; }
  .site-nav.is-open .ak-nav__links { display: flex; }
  .site-nav.is-open .ak-nav { background: var(--paper-raised); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ak-nav__links > li { border-bottom: var(--size-hairline) solid var(--rule); }
  .ak-nav__links > li:last-child { border-bottom: 0; }
  .ak-nav__links a { display: block; padding: var(--space-3) 0; }
  /* on mobile the dropdown is just an inline group */
  .ak-nav__drop { display: none; }
  .ak-nav__sub { position: static; display: block; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  .ak-nav__sub::before { display: none; }
  .ak-nav__sub li + li { border-top: var(--size-hairline) solid var(--rule); }
  .ak-nav__sub a { padding: var(--space-3) 0; border-radius: 0; }
  .ak-nav__sub a:hover { background: none; }
}
.foot__notrack { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); cursor: pointer; }
.foot__notrack:hover, .foot__notrack:focus-visible { color: var(--ink); }
.foot__notrack[aria-pressed="true"] { color: var(--oxide-ink); }
