/* =========================================================
   SAI ANIKET — Portfolio
   Part 1 · Tokens, reset, global UI
   ========================================================= */

:root {
  --bg: #090909;
  --bg-soft: #0c0a0a;
  --panel: #100d0d;
  --panel-2: #151111;
  --ink: #f2efeb;
  --muted: #a09c9a;
  --muted-2: #777170;
  --accent: #e32b3c;
  --accent-deep: #8f0f1b;
  --accent-soft: #ff5d6b;
  --line: #2a2323;
  --line-soft: #1b1717;
  --display: "Anton", Impact, sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hand: "Caveat", cursive;
  --gutter: clamp(20px, 4vw, 72px);
  --max: 1760px;
  --header-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
svg:not(.svg-sprite) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1, h2, h3, h4, p, blockquote, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button, summary, select, label { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }

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

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

/* ---------- Shared type ---------- */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.01em;
}
.handwriting {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.1;
}
.accent { color: var(--accent); }
.muted { color: var(--muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow i {
  font-style: normal;
  color: var(--accent);
  letter-spacing: .06em;
}

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h200v200H0z'/%3E%3C/svg%3E");
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  background: transparent;
  z-index: 320;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 400;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Cursor ring ---------- */
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(227, 43, 60, .75);
  border-radius: 50%;
  z-index: 350;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity .3s, width .25s, height .25s, margin .25s, background .25s;
  will-change: transform;
}
.cursor-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--accent);
}
body.cursor-enabled,
body.cursor-enabled a,
body.cursor-enabled button { cursor: none; }
body.cursor-enabled input,
body.cursor-enabled textarea,
body.cursor-enabled select { cursor: auto; }
body.cursor-enabled .cursor-ring { opacity: 1; }
body.cursor-enabled .cursor-ring.is-hover {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  background: rgba(227, 43, 60, .12);
}
body.cursor-enabled .cursor-ring.is-hover::after { inset: 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(9, 9, 9, .84);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--line-soft);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  flex-shrink: 0;
}
.wordmark-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #0a0707;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1;
  padding-top: 3px;
  border-radius: 2px;
}
.wordmark-text {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .06em;
  line-height: 1;
  display: inline-flex;
  align-items: flex-start;
}
.wordmark-text sup {
  font-family: var(--body);
  font-size: 7px;
  font-weight: 700;
  color: var(--accent);
  margin: 2px 0 0 3px;
  letter-spacing: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
  margin-right: 2vw;
}
.desktop-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .25s;
}
.desktop-nav a::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .25s, transform .25s;
}
.desktop-nav a:hover,
.desktop-nav a.is-active { color: var(--ink); }
.desktop-nav a.is-active::before { opacity: 1; transform: scale(1); }

.header-actions { display: flex; align-items: center; gap: 22px; }

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .25s;
}
.motion-toggle:hover { color: var(--ink); }
.motion-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(227, 43, 60, .16);
  transition: background .25s, box-shadow .25s;
}
[data-motion="off"] .motion-dot {
  background: var(--muted-2);
  box-shadow: none;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #4a3034;
  font-size: 11px;
  font-weight: 600;
  transition: background .3s, border-color .3s, color .3s;
}
.header-cta svg { width: 14px; height: 14px; color: var(--accent); transition: transform .3s; }
.header-cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.header-cta:hover svg { color: #fff; transform: translate(2px, -2px); }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
}
.menu-toggle svg { width: 19px; height: 19px; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 190;
  display: flex;
  flex-direction: column;
  padding: 18px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  background: #0a0808;
  border-bottom: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.mobile-menu.is-open { opacity: 1; transform: translateY(0); }
body.menu-open { overflow: hidden; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: .02em;
}
.mobile-menu nav a span {
  font-family: var(--body);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: .1em;
}
.mobile-menu nav a svg { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
.mobile-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 28px;
  font-size: 10px;
  color: var(--muted);
}

/* ---------- Buttons & links ---------- */
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .3s, transform .3s var(--ease);
}
.primary-link svg { width: 15px; height: 15px; transition: transform .3s; }
.primary-link:hover { background: #c31e2f; }
.primary-link:hover svg { transform: translate(2px, -2px); }

.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #4b3438;
  font-size: 11px;
  font-weight: 600;
  transition: background .3s, border-color .3s;
}
.outline-button svg { width: 15px; height: 15px; }
.outline-button:hover { background: #241115; border-color: var(--accent); }

.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 48px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: background .3s;
}
.solid-button svg { width: 15px; height: 15px; }
.solid-button:hover { background: #c31e2f; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  transition: color .25s;
}
.text-link svg { width: 15px; height: 15px; transition: transform .3s; }
.text-link:hover { color: var(--accent); }
.text-link:hover svg { transform: translate(3px, -3px); }

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background .25s, border-color .25s;
}
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { background: #261417; border-color: #4b3438; }

/* ---------- Small utilities ---------- */
.dot { color: var(--accent); }
.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}
.availability i,
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.pulse-dot { box-shadow: 0 0 0 0 rgba(227, 43, 60, .45); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(227, 43, 60, .45); }
  70% { box-shadow: 0 0 0 9px rgba(227, 43, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 43, 60, 0); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 500;
  max-width: min(92vw, 460px);
  padding: 14px 18px;
  background: #1a1112;
  border: 1px solid #54262c;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .35s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reduced motion ---------- */
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
