/* Base: design tokens (dark/light), reset, typography and pieces shared by the
   landing and the 404 page (logo, buttons, dot grid, caret). */

:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-alt: #101010;
  --text: #F5F5F5;
  --text-body: #C2C2C2;
  --text-muted: #8C8C8C;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.22);
  --header-bg: rgba(10,10,10,0.8);
  /* Accent — lime in dark mode, pastel orange in light mode (see light theme below).
     Tried before: orange #FF6B45 · pastel orange #FF9466 in dark
                   lime in light (#C2E62A, ink #5C7A00) */
  --accent: #D4F53C;
  --accent-ink: #D4F53C;       /* accent used as text color */
  --accent-soft: rgba(212,245,60,0.10);
  --accent-glow: rgba(212,245,60,0.30);
  --on-accent: #0A0A0A;
  --grid-dot: rgba(255,255,255,0.17);
  --dot-inactive: rgba(255,255,255,0.22);
  --danger: #FF7A7A;           /* form errors */
  --danger-soft: rgba(255,122,122,0.18);
}
html[data-theme="light"] {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-alt: #F2F2F2;
  --text: #0A0A0A;
  --text-body: #333333;
  --text-muted: #6B6B6B;
  --border: rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.2);
  --header-bg: rgba(250,250,250,0.85);
  --accent: #FF8A5C;           /* pastel orange, a touch deeper so lines/dots show on white */
  --accent-ink: #C24A1C;       /* darker so small accent text stays readable on white */
  --accent-soft: rgba(255,138,92,0.12);
  --accent-glow: rgba(255,138,92,0.35);
  --grid-dot: rgba(0,0,0,0.16);
  --dot-inactive: rgba(0,0,0,0.2);
  --danger: #C62828;
  --danger-soft: rgba(198,40,40,0.15);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(128,128,128,0.5) transparent; }
body { margin: 0; font-family: "IBM Plex Sans", system-ui, sans-serif; background: var(--bg); color: var(--text); transition: background .2s, color .2s; }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Space Grotesk", system-ui, sans-serif; margin: 0; }
.mono { font-family: "IBM Plex Mono", monospace; }
/* Icons from icons/sprite.svg: sized by font-size (1em) and painted with the text color */
.icon { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; }
.accent { color: var(--accent-ink); }
button { font-family: inherit; }
#about, #experience, #skills, #work, #contact { scroll-margin-top: 90px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgba(128,128,128,0.5); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128,128,128,0.8); background-clip: content-box; }
#case-carousel { scrollbar-width: none; -ms-overflow-style: none; }
#case-carousel::-webkit-scrollbar { display: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 32px; padding-right: 32px; width: 100%; }
.section-border { border-top: 1px solid var(--border); }

/* Section header: numbered kicker + big title */
.section-head { display: flex; flex-direction: column; gap: 14px; }
.kicker-label { font-size: 13px; color: var(--text-muted); letter-spacing: 0.02em; }
.kicker-label .idx { color: var(--accent-ink); margin-right: 8px; }
.section-head h2 { font-size: clamp(38px, 5.5vw, 64px); font-weight: 700; line-height: 1; letter-spacing: -0.035em; color: var(--text); }

/* Scroll reveal (only when JS is on, so content never stays hidden) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Shared with the 404 page ---------- */
.logo { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; font-family: "Space Grotesk", sans-serif; }
.logo { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.logo .icon { font-size: 22px; color: var(--accent-ink); transition: transform .25s ease; }
.logo:hover .icon { transform: rotate(-8deg) scale(1.08); }

.btn-primary { border: 0; background: var(--accent); color: var(--on-accent); padding: 15px 28px; border-radius: 2px; font-size: 15px; font-weight: 600; transition: transform .2s, box-shadow .2s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.btn-outline { background: transparent; color: inherit; border: 1px solid var(--border-strong); padding: 15px 28px; border-radius: 2px; font-size: 15px; font-weight: 600; transition: border-color .2s, color .2s; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-primary, .btn-outline, .btn-link { display: inline-flex; align-items: center; gap: 9px; }
.btn-primary .icon, .btn-outline .icon, .btn-link .icon { font-size: 19px; }
.btn-link { padding: 15px 6px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) {
  .btn-primary, .btn-outline { padding: 13px 20px; }
}

/* Hero sits on a faint dot grid that fades out toward the edges */
.hero-shell { position: relative; overflow: hidden; }
.hero-shell::before, .hero-shell::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-size: 26px 26px; }
.hero-shell::before {
  background-image: radial-gradient(var(--grid-dot) 1.6px, transparent 1.6px);
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 70% 40%, #000 35%, transparent 85%);
          mask-image: radial-gradient(ellipse 90% 85% at 70% 40%, #000 35%, transparent 85%); }
/* Same grid in the accent color, only visible in a spotlight around the cursor */
.hero-shell::after {
  background-image: radial-gradient(var(--accent) 1.6px, transparent 1.6px);
  -webkit-mask-image: radial-gradient(circle 190px at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 100%);
          mask-image: radial-gradient(circle 190px at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 100%);
  opacity: 0; transition: opacity .4s ease; }
.hero-shell.lit::after { opacity: 0.5; }

/* Blinking terminal caret (sizes are set where it's used) */
.caret { display: inline-block; background: var(--accent); animation: caret-blink 1.1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
