/* ==========================================================================
   jobfishing — shared foundation
   Fonts, design tokens, reset, shell (nav / footer / buttons), motion.
   Page-specific rules stay in each page's own <style> block.
   ========================================================================== */

/* ---------- Fonts ------------------------------------------------------- */
/* Extracted from base64 data-URIs to real files: 26% smaller on the wire,
   cached once across all five pages instead of re-downloaded per page. */
@font-face { font-family: "Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/plex-mono-600.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/plex-mono-700.woff2) format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/plex-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/plex-sans-500.woff2) format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/plex-sans-600.woff2) format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/plex-sans-700.woff2) format("woff2"); }

/* ---------- Tokens ------------------------------------------------------ */
:root {
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --ink: #0f172a;
  --muted: #5b6478;
  --line: #e2e8f0;
  --line-soft: #edf1f6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;
  --hero-bg: #0b0f1a;
  --hero-ink: #eef1fa;
  --hero-muted: #9aa3ba;
  --hero-line: #232a3d;
  --hero-raise: #131a2b;

  --stage-applied: #0ea5e9;
  --stage-interview: #f59e0b;
  --stage-offer: #10b981;
  --stage-rejected: #f43f5e;

  /* Shadows are tinted to the background hue, never neutral grey. */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 22px 48px -20px rgba(15, 23, 42, 0.26);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* One easing curve for the whole site. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.34s;
  --dur-fast: 0.16s;

  --measure: 65ch;
  --gutter: 24px;
  --shell: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0b0f1a;
    --surface: #131a2b;
    --surface-2: #171f34;
    --ink: #e9edf7;
    --muted: #9aa3ba;
    --line: #232a3d;
    --line-soft: #1b2235;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1c2242;
    --accent-line: #313a63;
    --hero-bg: #05070d;
    --hero-ink: #eef1fa;
    --hero-muted: #7d879e;
    --hero-line: #1a2032;
    --hero-raise: #0e1524;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 22px 48px -20px rgba(0, 0, 0, 0.7);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

:root[data-theme="dark"] {
  --canvas: #0b0f1a;
  --surface: #131a2b;
  --surface-2: #171f34;
  --ink: #e9edf7;
  --muted: #9aa3ba;
  --line: #232a3d;
  --line-soft: #1b2235;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1c2242;
  --accent-line: #313a63;
  --hero-bg: #05070d;
  --hero-ink: #eef1fa;
  --hero-muted: #7d879e;
  --hero-line: #1a2032;
  --hero-raise: #0e1524;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 22px 48px -20px rgba(0, 0, 0, 0.7);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] {
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --ink: #0f172a;
  --muted: #5b6478;
  --line: #e2e8f0;
  --line-soft: #edf1f6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;
  --hero-bg: #0b0f1a;
  --hero-ink: #eef1fa;
  --hero-muted: #9aa3ba;
  --hero-line: #232a3d;
  --hero-raise: #131a2b;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 22px 48px -20px rgba(15, 23, 42, 0.26);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- Reset ------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
svg { display: block; }

h1, h2, h3 {
  font-family: "Plex Mono", ui-monospace, monospace;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* Hierarchy comes from weight and colour, not only from scale. */
h1 { font-size: clamp(2.05rem, 4.2vw, 3.05rem); line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.2; }
h3 { font-size: 1.05rem; line-height: 1.35; }

::selection { background: var(--accent); color: #fff; }

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

/* ---------- Layout ------------------------------------------------------ */
.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.lede {
  color: var(--muted);
  max-width: var(--measure);
  line-height: 1.65;
}

.eyebrow {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

/* Tactile push, so a press reads as a physical action. */
.btn:active { transform: translateY(1px) scale(0.985); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.24), 0 10px 24px -12px rgba(79, 70, 229, 0.55);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.26), 0 16px 32px -14px rgba(79, 70, 229, 0.62);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(1px) scale(0.985); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost-dark {
  background: transparent;
  color: var(--hero-ink);
  border-color: var(--hero-line);
}
.btn-ghost-dark:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

/* Arrow glyphs drift on hover — a small signal that the control is live. */
.btn .arr {
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.btn:hover .arr { transform: translateX(3px); }

/* ---------- Nav --------------------------------------------------------- */
nav.top {
  background: var(--hero-bg);
  border-bottom: 1px solid var(--hero-line);
  position: relative;
  z-index: 20;
}

nav.top .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.brand:hover { opacity: 0.82; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px -2px rgba(79, 70, 229, 0.5);
}

/* Defaults to the page ink so the lockup works on light surfaces (the guide
   header); the dark nav opts into the light ink explicitly. */
.brand-word {
  font-family: "Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
nav.top .brand-word { color: var(--hero-ink); }

/* Inner pages use a bare .btn in the dark nav as a ghost control, so a bare
   .btn must stay legible there — it inherits page ink everywhere else. */
nav.top .btn {
  border-color: var(--hero-line);
  color: var(--hero-ink);
}
nav.top .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}
nav.top .btn-primary,
nav.top .btn-primary:hover {
  border-color: transparent;
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Footer ------------------------------------------------------ */
footer {
  background: var(--canvas);
  border-top: 1px solid var(--line);
  padding: 32px 0;
}

footer .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

footer a.email {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
footer a.email:hover { text-decoration: underline; }

/* ---------- Motion ------------------------------------------------------ */
/* Scroll reveals are driven by IntersectionObserver (see the inline script),
   never a scroll listener. Elements are visible by default so the page still
   reads correctly with JS disabled — the observer opts them into animating. */
[data-reveal] { opacity: 1; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Once revealed, drop the compositor hint. */
.js [data-reveal].is-done { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive shell ------------------------------------------- */
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  nav.top .row { height: 60px; }
  .nav-actions { gap: 8px; }
  .btn { padding: 11px 16px; font-size: 0.9rem; }
}
