/* ------------------------------------------------------------------
   yonatan harrison — site styles
   Dark-only, Raycast-inspired: near-black blue-tinted canvas, Inter with
   positive tracking, red used as punctuation, hairline borders.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var-v4.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-400-v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the swap to Inter doesn't shift the layout
   (same trick next/font uses on raycast.com). */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  --bg: #07080a;
  --bg-raised: #0d0e11;
  --bg-card: #101114;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #6b6b74;
  --accent: #ff6363;
  --accent-soft: rgba(255, 99, 99, 0.14);
  --ok: #59d499;

  --sans: "Inter", "Inter Fallback", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --page: 960px;
  --gutter: 24px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Faint glow at the top of every page — the only "decoration". */
body::before {
  content: "";
  position: fixed;
  inset: -40vh -20vw auto -20vw;
  height: 80vh;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 99, 99, 0.07), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
p a, li a { color: var(--text); border-bottom: 1px solid var(--line-strong); transition: border-color .15s; }
p a:hover, li a:hover { border-color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(7, 8, 10, 0.72);
  border-bottom: 1px solid var(--line);
  view-transition-name: nav;
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: 0.1px; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(89, 212, 153, 0.15); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-2);
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: color .15s, background-color .15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links kbd { display: none; }
@media (hover: hover) and (min-width: 760px) { .nav-links kbd { display: inline-flex; } }

/* ---------- keycaps (the Raycast motif) ---------- */
kbd, .key {
  font-family: var(--mono);
  font-size: 11px; line-height: 1;
  color: var(--text-2);
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: linear-gradient(180deg, #1b1c20, #121316);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.04);
  letter-spacing: 0;
}

/* ---------- type ---------- */
main { flex: 1; view-transition-name: main; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.4px;
  color: var(--text-3); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(40px, 7vw, 64px); letter-spacing: -0.035em; }
h2 { font-size: clamp(26px, 3.6vw, 34px); }
h3 { font-size: 18px; letter-spacing: -0.01em; line-height: 1.3; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 600px; margin: 20px 0 0; line-height: 1.55; }
.lede strong { color: var(--text); font-weight: 500; }
.muted { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 36px; }
.section-head p { color: var(--text-2); margin: 10px 0 0; max-width: 560px; }

/* ---------- hero ---------- */
.hero { padding: 96px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.avatar {
  width: 148px; height: 148px; border-radius: 50%;
  filter: grayscale(1) contrast(1.05);
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 0 8px rgba(255, 255, 255, 0.02), 0 30px 80px -20px rgba(255, 99, 99, 0.25);
}
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  padding: 5px 12px 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.02);
  margin-bottom: 28px;
}
.status .brand-dot { width: 6px; height: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.1px;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: hsla(0, 0%, 100%, 0.88); color: #18191a; }
.btn-primary:hover { background: #fff; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn svg { width: 16px; height: 16px; }

/* ---------- feature grid ---------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.cell { background: var(--bg-raised); padding: 26px 24px 28px; }
.cell .key { margin-bottom: 22px; }
.cell b { display: block; font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 6px; letter-spacing: 0; }
.cell p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }

/* ---------- now / pills ---------- */
.now { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.now dt { color: var(--text-3); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; padding-top: 4px; }
.now dd { margin: 0; color: var(--text-2); }
.now dd strong { color: var(--text); font-weight: 500; }
.now > div { display: contents; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pills li {
  font-size: 13.5px; color: var(--text);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.pills.dim li { color: var(--text-2); }
.skills { display: grid; gap: 28px; }
.skills h3 { font-size: 13px; font-family: var(--mono); font-weight: 400; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 12px; }

/* ---------- experience ---------- */
.role { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 36px 0; border-top: 1px solid var(--line); }
.role:first-of-type { border-top: 0; padding-top: 0; }
.role-meta { font-size: 14px; color: var(--text-3); }
.role-meta .company { display: block; font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
.role-meta .mono { display: block; margin-top: 2px; }
.role-body h3 { margin-bottom: 4px; }
.role-body .when { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); letter-spacing: 0; }
.role-body > p { color: var(--text-2); margin: 12px 0 0; }
.step { padding: 0 0 0 20px; margin-top: 26px; border-left: 1px solid var(--line-strong); position: relative; }
.step::before { content: ""; position: absolute; left: -4px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--text-3); }
.step.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
ul.points { margin: 12px 0 0; padding: 0; list-style: none; }
ul.points li { position: relative; padding-left: 18px; color: var(--text-2); margin: 6px 0; }
ul.points li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1px; background: var(--text-3); }
ul.points strong { color: var(--text); font-weight: 500; }

/* ---------- case studies ---------- */
.cases { display: grid; gap: 20px; }
.case {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: border-color .2s;
}
.case:hover { border-color: var(--line-strong); }
.case-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.case-top h3 { font-size: 21px; }
.case-top .mono { color: var(--text-3); }
.case dl { display: grid; grid-template-columns: 110px 1fr; gap: 14px 24px; margin: 0; }
.case dt { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; padding-top: 3px; }
.case dd { margin: 0; color: var(--text-2); }
.case dd strong { color: var(--text); font-weight: 500; }
.case dd.result { color: var(--text); }
.case .pills li { font-size: 12.5px; padding: 3px 10px; }

/* ---------- colophon ---------- */
.stack { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stack li { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 18px 22px; background: var(--bg-raised); border-top: 1px solid var(--line); }
.stack li:first-child { border-top: 0; }
.stack li span:first-child { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); padding-top: 2px; letter-spacing: 0; }
.stack li span:last-child { color: var(--text-2); }
.stack strong { color: var(--text); font-weight: 500; }
pre.flow {
  font-family: var(--mono); font-size: 13px; line-height: 1.7; letter-spacing: 0;
  color: var(--text-2); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin: 0; overflow-x: auto;
}
pre.flow b { color: var(--text); font-weight: 400; }
pre.flow i { color: var(--accent); font-style: normal; }

/* ---------- contact + footer ---------- */
.contact { text-align: left; }
.contact h2 { max-width: 560px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--text-3); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; gap: 18px; }
.footer a:hover { color: var(--text); }
.hint { display: inline-flex; align-items: center; gap: 6px; }
@media (hover: none), (max-width: 759px) { .hint { display: none; } }

/* ---------- motion: snappy, never showy ---------- */
@view-transition { navigation: auto; }
::view-transition-old(main) { animation: 120ms ease-in both vt-out; }
::view-transition-new(main) { animation: 180ms cubic-bezier(.2, .8, .2, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  * { transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 759px) {
  :root { --gutter: 16px; }
  section { padding: 56px 0; }
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .avatar { width: 96px; height: 96px; }
  .hero-grid picture { order: -1; }
  .nav .wrap { gap: 12px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: 13.5px; }
  .brand-name { display: none; }
  .now, .role, .stack li { grid-template-columns: 1fr; gap: 8px; }
  .now dd { margin-bottom: 16px; }
  .case { padding: 24px 20px; }
  .case dl { grid-template-columns: 1fr; gap: 4px; }
  .case dd { margin-bottom: 12px; }
}
@media (max-width: 480px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- print: a clean light CV ---------- */
@media print {
  :root { --bg: #fff; --bg-raised: #fff; --text: #111; --text-2: #333; --text-3: #666; --line: #ddd; --line-strong: #ccc; }
  body { font-size: 11pt; background: #fff; }
  body::before, .nav, .footer, .actions, .no-print, kbd, .key { display: none !important; }
  section { padding: 18px 0; break-inside: avoid-page; }
  .hero { padding: 0 0 12px; }
  .case, .cell, .stack li { background: #fff; break-inside: avoid; }
  a { border: 0 !important; }
  .avatar { box-shadow: none; width: 90px; height: 90px; }
}

/* ---------- page-level helpers (no inline styles: CSP style-src 'self') ---------- */
.page-hero { padding-bottom: 40px; }
section.after-hero { border-top: 0; padding-top: 24px; }
.step.first { margin-top: 0; }
p.intro { margin: 12px 0 0; }
button.btn { font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.case dd.result ul.points { margin-top: 0; }
.case dd.result ul.points li { color: var(--text-2); }
.story { max-width: 680px; }
.story p { color: var(--text-2); margin: 0 0 16px; font-size: 17px; line-height: 1.65; }
.story strong { color: var(--text); font-weight: 500; }
.story p.muted { color: var(--text-3); font-size: 15.5px; border-left: 2px solid var(--accent); padding-left: 16px; margin-top: 24px; }
