/* ==========================================================================
   Anurag Nepal - site styles
   ========================================================================== */

:root {
  --bg: #07080c;
  --bg-elev: #0c0e14;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceef3;
  --text-2: #b3b9c6;
  --muted: #7c8494;
  --accent: #6b8cff;
  --accent-2: #3dd5f3;
  --accent-soft: rgba(107, 140, 255, 0.14);
  --success: #4ade80;
  --danger: #f87171;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
ul[class], ol[class] { list-style: none; }
::selection { background: rgba(107, 140, 255, 0.35); color: #fff; }

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

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0f1f;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Scroll progress ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .progress {
    animation: grow-x linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes grow-x { to { transform: scaleX(1); } }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(7, 8, 12, 0.72);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

/* Header starts transparent and gains glass as the page scrolls */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-glass linear both;
    animation-timeline: scroll(root);
    animation-range: 0 120px;
  }
}

@keyframes header-glass {
  from {
    background: rgba(7, 8, 12, 0);
    border-bottom-color: transparent;
    -webkit-backdrop-filter: saturate(100%) blur(0);
    backdrop-filter: saturate(100%) blur(0);
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #0a0f1f;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 6px 20px -6px rgba(107, 140, 255, 0.6);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.925rem;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current] { color: var(--text); }
.nav-links a[aria-current]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.nav-links .nav-cta { margin-left: 8px; }
.nav-links .nav-cta a { color: var(--text); }
.nav-links .nav-cta a::after { display: none; }

.menu-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease);
}
.menu-toggle span + span { margin-top: 5px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease), box-shadow 0.35s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: translateY(0); }
.btn .icon { transition: transform 0.35s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }

.btn-primary {
  border-color: transparent;
  background: var(--grad);
  color: #081024;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(107, 140, 255, 0.7);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn-primary:hover { border-color: transparent; box-shadow: 0 16px 40px -12px rgba(107, 140, 255, 0.85); }
.btn-primary:hover::after { transform: translateX(120%); }

.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.875rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 500;
}
.link-arrow .icon { transition: transform 0.35s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 48px) 0 96px;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.orb-1 {
  top: -140px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(107, 140, 255, 0.55), transparent 65%);
  animation: drift-1 18s ease-in-out infinite alternate;
}
.orb-2 {
  bottom: -160px;
  left: -140px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(61, 213, 243, 0.35), transparent 65%);
  animation: drift-2 22s ease-in-out infinite alternate;
}

@keyframes drift-1 { to { transform: translate3d(-80px, 60px, 0) scale(1.08); } }
@keyframes drift-2 { to { transform: translate3d(90px, -50px, 0) scale(1.1); } }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.85rem;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: ping 2s var(--ease) infinite;
}

@keyframes ping {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(2.8); opacity: 0; }
}

.hero h1 {
  margin: 22px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero h1 span { display: block; }

.hero-role {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  letter-spacing: 0.02em;
}

.hero-lede {
  max-width: 36ch;
  margin-top: 18px;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.socials { display: flex; align-items: center; gap: 8px; margin-top: 30px; }

.social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  transition: color 0.25s, border-color 0.25s, background-color 0.25s, transform 0.35s var(--ease);
}
.social:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-3px); }
.social .icon { width: 18px; height: 18px; }

/* Hero entrance, staggered */
.hero-copy > *,
.hero-visual {
  animation: enter 0.9s var(--ease) both;
}
.hero-copy > :nth-child(1) { animation-delay: 0.1s; }
.hero-copy > :nth-child(2) { animation-delay: 0.2s; }
.hero-copy > :nth-child(3) { animation-delay: 0.3s; }
.hero-copy > :nth-child(4) { animation-delay: 0.4s; }
.hero-copy > :nth-child(5) { animation-delay: 0.5s; }
.hero-copy > :nth-child(6) { animation-delay: 0.6s; }
.hero-visual { animation-delay: 0.35s; }

@keyframes enter {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* Code window */
.code-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 24, 34, 0.9), rgba(12, 14, 20, 0.9));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  animation: float 7s ease-in-out infinite;
}
.code-window::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(107, 140, 255, 0.55), transparent 40%, transparent 60%, rgba(61, 213, 243, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.code-bar i { width: 11px; height: 11px; border-radius: 50%; }
.code-bar i:nth-child(1) { background: #ff5f57; }
.code-bar i:nth-child(2) { background: #febc2e; }
.code-bar i:nth-child(3) { background: #28c840; }
.code-file { margin-left: 10px; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }

.code {
  padding: 18px 0 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.05vw, 0.84rem);
  line-height: 1.85;
  white-space: pre;
  tab-size: 4;
}
.code code {
  display: block;
  counter-reset: ln;
  animation: type-lines 1.5s steps(15, end) 0.8s both;
}
.code .l { display: block; padding-right: 20px; }
.code .l::before {
  content: counter(ln);
  counter-increment: ln;
  display: inline-block;
  width: 3.2em;
  padding-right: 1.2em;
  color: #3c4252;
  text-align: right;
  user-select: none;
}

/* Reveals the snippet one line at a time */
@keyframes type-lines {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.tk-an { color: #fbbf24; }
.tk-kw { color: #c792ea; }
.tk-ty { color: #7dd3fc; }
.tk-fn { color: #82aaff; }
.tk-st { color: #a5e3a0; }
.tk-cm { color: #5c6478; font-style: italic; }
.tk-pl { color: #cfd5e1; }

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.scroll-cue span {
  position: relative;
  width: 1px;
  height: 36px;
  overflow: hidden;
  background: var(--border);
}
.scroll-cue span::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--accent);
  animation: cue 2.2s var(--ease) infinite;
}

@keyframes cue { to { top: 100%; } }

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  padding: 22px 0;
  border-block: 1px solid var(--border);
  background: var(--bg-elev);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; }
.marquee li {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marquee li::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section { position: relative; padding: clamp(80px, 12vw, 140px) 0; }
.section-alt { border-block: 1px solid var(--border); background: var(--bg-elev); }

.section-head { max-width: 680px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}
.section-head-row > div { max-width: 680px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }

.section h2,
.page-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-sub { max-width: 58ch; margin-top: 16px; color: var(--text-2); font-size: 1.075rem; }

/* ---------- Cards with cursor spotlight ---------- */

.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(107, 140, 255, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card-static:hover { transform: none; }

.card-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(107, 140, 255, 0.25);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon .icon { width: 20px; height: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
}
.chips-mono .chip { padding: 5px 10px; color: var(--text-2); font-family: var(--font-mono); font-size: 0.75rem; }

/* ---------- Services ---------- */

.services-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.service { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 34px); }
.service-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.service h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.service p { flex-grow: 1; margin-bottom: 22px; color: var(--text-2); font-size: 0.975rem; }

/* ---------- Projects ---------- */

.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 32px); }
.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.project-num { color: var(--muted); font-family: var(--font-mono); font-size: 0.82rem; }
.project-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-2);
  transition: transform 0.45s var(--ease), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.project:hover .project-arrow { border-color: var(--text); background: var(--text); color: var(--bg); transform: rotate(-45deg); }
.project h3 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
.project h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project-kicker { margin-top: 6px; color: var(--accent); font-size: 0.9rem; }
.project-desc { flex-grow: 1; margin: 16px 0 26px; color: var(--text-2); font-size: 0.975rem; }

.center-row { display: flex; justify-content: center; margin-top: 44px; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 80px);
}
.about-copy p { color: var(--text-2); font-size: 1.1rem; line-height: 1.8; }
.about-copy p + p { margin-top: 18px; }
.about-copy strong { color: var(--text); font-weight: 500; }

.facts { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.facts li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.facts li + li { border-top: 1px solid var(--border); }
.facts .k { color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.facts .v { font-weight: 500; text-align: right; }
.facts .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--success); }

.process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(48px, 7vw, 80px);
  counter-reset: step;
}
.step { padding: 28px; }
.step::after {
  content: "0" counter(step);
  counter-increment: step;
  position: absolute;
  top: 24px;
  right: 26px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.step h3 { margin: 18px 0 8px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.step p { color: var(--text-2); font-size: 0.95rem; }

/* ---------- Blog cards ---------- */

.posts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 32px); }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.post-meta .tag { color: var(--accent); }
.post-card h3,
.post-card .post-card-title {
  margin: 16px 0 12px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.post-card h3 a::after,
.post-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card p { flex-grow: 1; margin-bottom: 22px; color: var(--text-2); font-size: 0.975rem; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 80px);
}
.contact-grid .section-head { margin-bottom: 32px; }
.contact-links { display: grid; gap: 12px; }
.contact-link { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.contact-link .card-icon { width: 42px; height: 42px; }
.contact-link .meta { display: grid; min-width: 0; }
.contact-link small { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.contact-link .meta span { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.contact-link .icon-arrow { margin-left: auto; color: var(--muted); transition: transform 0.35s var(--ease), color 0.3s; }
.contact-link:hover .icon-arrow { color: var(--text); transform: translate(3px, -3px); }

.form { display: grid; gap: 18px; padding: clamp(24px, 3.5vw, 36px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--text-2); font-size: 0.875rem; font-weight: 500; }
.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field ::placeholder { color: #565d6d; }
.field input:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(107, 140, 255, 0.15);
}
.field [aria-invalid="true"] { border-color: var(--danger); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.form-status { min-height: 1.5em; font-size: 0.925rem; }
.form-status.is-ok { color: var(--success); }
.form-status.is-error { color: var(--danger); }
.form-status a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(8, 16, 36, 0.3);
  border-top-color: #081024;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .spinner { display: block; }
.btn.is-loading .icon { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */

.site-footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer p { color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { color: var(--text-2); font-size: 0.9rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }

/* ---------- FAQ ---------- */

.faq-head { margin-inline: auto; text-align: center; }
.faq-head .section-sub { margin-inline: auto; }

.faq-tabs {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto clamp(36px, 5vw, 56px);
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  scrollbar-width: none;
}
.faq-tabs::-webkit-scrollbar { display: none; }
.faq-tabs[hidden] { display: none; }
.faq-tabs [role="tab"] {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.925rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.faq-tabs [role="tab"]:hover { color: var(--text); background: var(--surface-2); }
.faq-tabs [aria-selected="true"],
.faq-tabs [aria-selected="true"]:hover { color: var(--bg); background: var(--text); }
.faq-count { font-family: var(--font-mono); font-size: 0.72rem; opacity: 0.55; }

.faq-panels { max-width: 860px; margin-inline: auto; }
.faq-panel { border-bottom: 1px solid var(--border); }
.faq-panel + .faq-panel { margin-top: 56px; }
.faq-panel-title {
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* With JS the panels become tabs */
.is-tabbed .faq-panel + .faq-panel { margin-top: 0; }
.is-tabbed .faq-panel:not([hidden]) { animation: faq-in 0.5s var(--ease); }
.is-tabbed .faq-panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.faq-item { border-top: 1px solid var(--border); }
.faq-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 3vw, 30px) 0;
  list-style: none;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  transition: color 0.35s var(--ease);
}
.faq-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.5s var(--ease);
}
.faq-toggle::before,
.faq-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  translate: -50% -50%;
  transition: transform 0.5s var(--ease);
}
.faq-toggle::after { transform: rotate(90deg); }

.faq-item summary:hover .faq-q { color: #fff; }
.faq-item summary:hover .faq-toggle { border-color: var(--text-2); }
.faq-item[open] .faq-toggle { border-color: transparent; background: var(--grad); transform: rotate(180deg); }
.faq-item[open] .faq-toggle::before,
.faq-item[open] .faq-toggle::after { background: var(--bg); }
.faq-item[open] .faq-toggle::after { transform: rotate(0deg); }

.faq-a { padding: 0 64px clamp(26px, 3vw, 32px) 0; }
.faq-a p { max-width: 64ch; color: var(--text-2); font-size: 1.025rem; line-height: 1.8; }
.faq-item[open] .faq-a { animation: faq-in 0.5s var(--ease); }

@keyframes faq-in {
  from { opacity: 0; translate: 0 -8px; }
  to { opacity: 1; translate: 0 0; }
}

/* Smooth height animation where the browser supports it */
@supports (interpolate-size: allow-keywords) {
  .faq-item { interpolate-size: allow-keywords; }
  .faq-item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.5s var(--ease), content-visibility 0.5s allow-discrete;
  }
  .faq-item[open]::details-content { block-size: auto; }
}

.faq-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 860px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding: clamp(24px, 3vw, 32px);
}
.faq-cta h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.faq-cta p { margin-top: 6px; color: var(--text-2); font-size: 0.95rem; }
.faq-cta-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 12px; }

/* ---------- Inner pages (blog) ---------- */

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(56px, 9vw, 104px)) 0 clamp(48px, 7vw, 72px);
  border-bottom: 1px solid var(--border);
}
.page-hero .hero-grid { z-index: -1; }
.page-hero .orb-1 { top: -260px; opacity: 0.4; }
.page-title { font-size: clamp(2.2rem, 5.5vw, 3.8rem); }
.page-hero .section-sub { font-size: 1.15rem; }
.page-hero + .section { padding-top: clamp(48px, 7vw, 72px); }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.875rem; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; color: #454b59; }
.breadcrumbs a { transition: color 0.25s; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text-2); }
.breadcrumbs + * { margin-top: 28px; }

/* ---------- Article ---------- */

.article-head > * { max-width: 820px; }
.article-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.article-head .post-meta { margin-top: 24px; font-size: 0.82rem; }
.article-lede { margin-top: 20px; color: var(--text-2); font-size: 1.2rem; line-height: 1.65; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 64px;
  padding-block: clamp(48px, 7vw, 80px) clamp(80px, 10vw, 120px);
}

.toc { position: sticky; top: calc(var(--header-h) + 24px); padding: 22px; font-size: 0.9rem; }
.toc h2 { margin-bottom: 12px; color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.toc ol { display: grid; gap: 8px; list-style: none; }
.toc a { color: var(--text-2); transition: color 0.25s; }
.toc a:hover { color: var(--text); }

.prose { max-width: 72ch; color: var(--text-2); font-size: 1.075rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 {
  margin-top: 2.4em;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.prose h3 { margin-top: 1.8em; color: var(--text); font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(107, 140, 255, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose :not(pre) > code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86em;
}
.prose pre {
  overflow-x: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b0d13;
  color: #cfd5e1;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  tab-size: 4;
}
.prose pre code { font-family: inherit; }
.prose blockquote,
.callout {
  padding: 18px 22px;
  border: 1px solid rgba(107, 140, 255, 0.25);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
}

/* Prism tokens, tuned to the site palette */
.token.comment, .token.prolog { color: #5c6478; font-style: italic; }
.token.keyword, .token.boolean, .token.important { color: #c792ea; }
.token.string, .token.char, .token.attr-value { color: #a5e3a0; }
.token.number, .token.constant { color: #f78c6c; }
.token.function { color: #82aaff; }
.token.class-name, .token.builtin, .token.tag { color: #7dd3fc; }
.token.punctuation, .token.operator { color: #8a93a6; }
.token.annotation, .token.attr-name, .token.property, .token.key { color: #fbbf24; }

.article-cta { margin-top: 3em; padding: clamp(24px, 4vw, 36px); }
.article-cta h2 { margin-top: 0; font-size: 1.5rem; }
.article-cta p { margin: 10px 0 22px; color: var(--text-2); }

.author { display: flex; align-items: center; gap: 16px; margin-top: 2.5em; padding-top: 2em; border-top: 1px solid var(--border); }
.author .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 1.05rem; }
.author strong { display: block; color: var(--text); }
.author span { color: var(--muted); font-size: 0.925rem; }

/* ---------- 404 ---------- */

.not-found { display: grid; place-items: center; min-height: 100svh; padding: 24px var(--gutter); text-align: center; }
.not-found code { color: var(--accent); font-family: var(--font-mono); font-size: 0.9rem; }
.not-found h1 { margin: 12px 0 10px; font-family: var(--font-display); font-size: clamp(5rem, 22vw, 9rem); line-height: 1; letter-spacing: -0.05em; }
.not-found p { max-width: 36ch; margin: 0 auto 28px; color: var(--text-2); }

/* ---------- Scroll reveal (CSS scroll-driven, no JS) ---------- */

/* Uses `translate` so it never fights the `transform` used by hover states */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal var(--ease) both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .stagger > .reveal:nth-child(2) { animation-range: entry 8% entry 63%; }
    .stagger > .reveal:nth-child(3) { animation-range: entry 16% entry 71%; }
    .stagger > .reveal:nth-child(4) { animation-range: entry 24% entry 79%; }
  }
}

@keyframes reveal {
  from { opacity: 0; translate: 0 36px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-bottom: 72px; }
  .hero-visual { max-width: 560px; }
  .scroll-cue { display: none; }
  .process { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 62px; }

  .menu-toggle { display: grid; }

  .nav-menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    padding: 12px var(--gutter) 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 8, 12, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-links a { padding: 14px 12px; border-radius: 12px; font-size: 1.05rem; }
  .nav-links a[aria-current]::after { top: 50%; right: 14px; bottom: auto; left: auto; transform: translateY(-50%); }
  .nav-links .nav-cta { margin: 10px 0 0; }
  .nav-links .nav-cta a { width: 100%; }
  .site-header.menu-open { background: rgba(7, 8, 12, 0.97); }

  .services-grid, .projects-grid, .posts-grid, .form-row { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
  .orb-1 { width: 340px; height: 340px; }
  .orb-2 { width: 300px; height: 300px; }
  .prose { font-size: 1.025rem; }
  .faq-item summary { gap: 16px; }
  .faq-toggle { width: 34px; height: 34px; }
  .faq-a { padding-right: 0; }
  .faq-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 22px; }
  .faq-tabs [role="tab"] { justify-content: center; padding: 0 12px; border-radius: 16px; }
  .faq-cta { flex-direction: column; align-items: flex-start; }
  .prose pre { margin-inline: calc(var(--gutter) * -1); border-inline: 0; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  .progress { display: none; }
}
.not-found .hero-actions { justify-content: center; }
