/* ==========================================================================
   Sebastine.com — Redesign
   Dark, technical, security-forward theme
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-alt: #0c1220;
  --surface: #101a2e;
  --surface-2: #141f38;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --text-dim: #9aa7c2;
  --text-faint: #6b7690;
  --accent: #22e6c1;
  --accent-soft: rgba(34, 230, 193, 0.12);
  --accent-2: #6c7cff;
  --accent-2-soft: rgba(108, 124, 255, 0.12);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --maxw: 1160px;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Sticky nav is 76px — keep anchor targets clear of it */
[id] { scroll-margin-top: 96px; }

/* Skip link — first tab stop on every page */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #06231d;
  font-weight: 700;
  font-size: 14px;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { color: var(--text-dim); margin: 0 0 1em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(34, 230, 193, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section-head p { font-size: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #17c4a3);
  color: #04140f;
  box-shadow: 0 8px 24px rgba(34, 230, 193, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(34, 230, 193, 0.35); }

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

.btn-block { width: 100%; }

/* Visually hidden, still announced by screen readers */
.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;
}

/* Arrow marking a link that leaves the site */
.btn-ext {
  margin-left: 2px;
  opacity: .75;
  transition: transform .25s cubic-bezier(.2, .7, .3, 1), opacity .25s ease;
}
.btn:hover .btn-ext { transform: translate(2px, -2px); opacity: 1; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand span { color: var(--accent); }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}
footer .brand-mark { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  gap: 34px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* Underline indicator for the active page / section in view */
.nav-links a { position: relative; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .25s cubic-bezier(.2, .7, .3, 1);
}
.nav-links a.active::after, .nav-links a:hover::after { transform: scaleX(1); }

/* Only ever shown inside the mobile drawer */
.nav-drawer-cta { display: none; }

.nav-cta { display: flex; align-items: center; gap: 18px; }

/* Hamburger — hidden on desktop, shown at <=720px */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle .bars {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: background .2s ease;
}
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease;
}
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 700px;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(34,230,193,0.14), transparent 60%),
    radial-gradient(500px 260px at 85% 0%, rgba(108,124,255,0.14), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(36px, 4.6vw, 58px);
  margin-bottom: 22px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 42px; }

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-stats .stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--text);
}
.hero-stats .stat span {
  font-size: 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-visual {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero-visual .term-head {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}
.hero-visual .term-head span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border);
}
.hero-visual pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 2.6vw, 13px);
  color: var(--text-dim);
  line-height: 1.9;
  white-space: pre-wrap;
  /* Reserve the full 11 lines up front so the typing animation
     doesn't grow the box and shift the page (CLS). */
  min-height: 20.9em;
}
.hero-visual .c-accent { color: var(--accent); }
.hero-visual .c-accent2 { color: var(--accent-2); }
.hero-visual .c-dim { color: var(--text-faint); }

/* ---------- Logos / trust strip ---------- */
.trust {
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
}
.trust .container {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.trust-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.trust-items {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
}
/* motion.js wraps the logos in a track so the row can scroll while the parent
   clips. The track must carry the layout in every state, marquee or not —
   otherwise the spans collapse into one run-on string. */
.trust-items .trust-track {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}
/* Keep multi-word entries ("Security Hub") on one line in both states */
.trust-items span { white-space: nowrap; }

/* ---------- Cards / Services ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 230, 193, 0.35);
  background: var(--surface-2);
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { font-size: 14.5px; margin: 0; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: start;
}
.about-photo {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.about-photo::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(300px 200px at 30% 20%, rgba(34, 230, 193, 0.14), transparent 60%),
    linear-gradient(180deg, transparent 55%, rgba(7, 11, 20, 0.55));
}
.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-photo .initials {
  font-family: var(--font-head);
  font-size: 72px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: -0.02em;
  z-index: 1;
}
.about-copy p { font-size: 16px; }
.about-highlights {
  list-style: none;
  padding: 0; margin: 28px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.about-highlights li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-dim);
  align-items: flex-start;
}
.about-highlights li svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---------- Skills ---------- */
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.skill-group h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}
.skill-group p { font-size: 14.5px; margin: 0; }
.role-when {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: none;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ---------- Projects ---------- */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  position: relative;
}
.project-card .tag-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border: 1px solid rgba(108,124,255,0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.project-card h3 { font-size: 19px; margin-bottom: 10px; }
.project-card p { font-size: 14.5px; }

/* ---------- Blog ---------- */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(34,230,193,0.3); }
.post-thumb {
  height: 150px;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-alt));
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.post-thumb svg { color: var(--accent); opacity: 0.55; }
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.post-card:hover .post-thumb img { transform: scale(1.06); }

/* Cover art banner at the top of an article */
.article-hero-wrap { margin-bottom: 4px; }
.article-hero {
  margin: 0 auto;
  max-width: 780px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.article-hero img { width: 100%; height: auto; display: block; }
@media (max-width: 720px) {
  .article-hero { border-radius: var(--radius-sm); }
}
.post-body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-body h3 { font-size: 17px; margin-bottom: 10px; }
.post-body p { font-size: 14px; flex: 1; }
.post-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, rgba(34,230,193,0.08), rgba(108,124,255,0.08));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  text-align: center;
}
.cta-band h2 { font-size: clamp(26px, 3.2vw, 36px); }
.cta-band p { max-width: 520px; margin: 0 auto 30px; font-size: 16px; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
}
.contact-info-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-item .ico {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info-item h4 { font-size: 15px; margin-bottom: 4px; }
.contact-info-item p { font-size: 14.5px; margin: 0; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dim);
}
.field input, .field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Honeypot — off-screen rather than display:none, which some bots skip */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border);
}
.form-status.is-ok {
  color: var(--accent);
  border-color: rgba(34, 230, 193, 0.4);
  background: var(--accent-soft);
}
.form-status.is-error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
}
.form-card button[aria-busy="true"] { opacity: 0.65; pointer-events: none; }

/* ---------- Footer ---------- */
footer {
  padding: 56px 0 32px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.footer-brand p { max-width: 320px; font-size: 14px; margin-top: 12px; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--text-dim); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint);
}
/* Back-to-top — a real control, so it works with motion disabled too */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(16, 26, 46, 0.86);
  backdrop-filter: blur(10px);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s, color .2s ease, border-color .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) {
  .to-top { right: 14px; bottom: 14px; }
}

.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.social-row a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Testimonials ---------- */
.testimonial-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .3s ease, transform .3s ease;
}
.testimonial-card:hover { border-color: rgba(34, 230, 193, 0.3); transform: translateY(-3px); }
.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: 6px; right: 20px;
  font-family: var(--font-head);
  font-size: 76px;
  line-height: 1;
  color: var(--accent);
  opacity: .16;
  pointer-events: none;
}
.testimonial-quote {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}
.testimonial-person {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.testimonial-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
  border: 1px solid var(--border);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }
.testimonial-person h4 { font-size: 14.5px; margin: 0 0 2px; color: var(--text); }
.testimonial-person p {
  margin: 0;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.testimonial-quote p { margin: 0 0 0.9em; }
.testimonial-quote p:last-child { margin-bottom: 0; }

/* Marks entries still awaiting a real quote — remove the attribute once filled in. */
.testimonial-card[data-placeholder] { border-style: dashed; opacity: .78; }
.testimonial-card[data-placeholder] .testimonial-quote { font-style: italic; }

/* ---------- Google Calendar booking embed ---------- */
/* Google renders this embed in its LIGHT theme with a transparent background.
   On our dark page that leaves dark text on dark navy — effectively invisible,
   and we can't reach inside a cross-origin iframe to restyle it. So we give it
   the light surface it's designed for and treat it as a deliberate white card. */
.calendar-embed {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.calendar-embed iframe {
  display: block;
  width: 100%;
  height: 660px;
  border: 0;
  border-radius: calc(var(--radius) - 8px);
  /* Pin the embedded document to light so it can't flip with the OS setting
     and strand us with light text on a white card. */
  color-scheme: light;
  background: #fff;
}
.calendar-fallback {
  text-align: center;
  font-size: 13px;
  margin: 16px 0 0;
}
.calendar-fallback a { color: var(--accent); }
@media (max-width: 720px) {
  .calendar-embed iframe { height: 560px; }
}

/* ---------- Journal index: search + topic filters ---------- */
.journal-controls { margin-bottom: 34px; }
.journal-search {
  position: relative;
  max-width: 420px;
  margin-bottom: 18px;
}
.journal-search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.journal-search input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
}
.journal-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.journal-search input::placeholder { color: var(--text-faint); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 7px 13px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.filter-chip span { color: var(--text-faint); margin-left: 4px; }
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.filter-chip.is-active span { color: rgba(7, 11, 20, 0.65); }

.journal-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin: 16px 0 0;
}
.journal-empty { text-align: center; padding: 48px 0; color: var(--text-dim); }
.linkish {
  background: none; border: 0; padding: 0;
  color: var(--accent); cursor: pointer;
  font: inherit; text-decoration: underline;
}
.post-card[hidden] { display: none; }
.dot-sep { margin: 0 7px; opacity: .5; }

/* ---------- Article / prose ---------- */
.article-shell {
  display: grid;
  grid-template-columns: 1fr min(680px, 100%) 1fr;
  padding: 0 24px;
}
.article-shell > * { grid-column: 2; }
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.article-prose {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-dim);
}
.article-prose h2 {
  color: var(--text);
  font-size: 24px;
  margin-top: 2.2em;
  margin-bottom: 0.6em;
}
.article-prose h3 {
  color: var(--text);
  font-size: 19px;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}
.article-prose p { margin-bottom: 1.3em; }
.article-prose ul, .article-prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.4em;
}
.article-prose li { margin-bottom: 0.5em; }
.article-prose strong { color: var(--text); }
.article-prose em { color: var(--text-dim); }
.article-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-prose a:hover { color: var(--text); }

/* Deeper headings — the migrated archive uses h4/h5/h6 */
.article-prose h4 {
  font-family: var(--font-head);
  font-size: 17px;
  margin: 1.8em 0 0.6em;
  color: var(--text);
}
.article-prose h5, .article-prose h6 {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.7em 0 0.5em;
}

/* Code */
.article-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.14em 0.42em;
  color: var(--accent);
  word-break: break-word;
}
.article-prose pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 1.4em;
  line-height: 1.6;
}
.article-prose pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 13.5px;
  white-space: pre;
}

/* Figures carried over from the old media library */
.article-prose .prose-figure {
  margin: 1.8em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.article-prose .prose-figure img { width: 100%; height: auto; display: block; }
.article-prose figcaption {
  font-size: 13px;
  color: var(--text-faint);
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

/* Tables */
.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.6em;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}
.article-prose th, .article-prose td {
  border: 1px solid var(--border);
  padding: 10px 13px;
  text-align: left;
  vertical-align: top;
}
.article-prose th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

/* Prev / next pager */
.article-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 52px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.article-pager a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}
.article-pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-pager .pager-next { text-align: right; }
.article-pager span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.article-pager strong {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
@media (max-width: 720px) {
  .article-pager { grid-template-columns: 1fr; }
  .article-pager .pager-next { text-align: left; }
}
.article-prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--text);
  font-style: italic;
}
.article-cta {
  margin-top: 3em;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.article-cta p { margin: 0; color: var(--text); font-weight: 600; }
.source-note {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
}
.external-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 8px;
}

/* ---------- Page header (sub-pages) ---------- */
.page-header {
  padding: 70px 0 50px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: clamp(30px, 4vw, 44px); }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb .sep { margin: 0 8px; }

/* ---------- 404 ---------- */
.error-page { padding-bottom: 90px; }
.error-term {
  max-width: 560px;
  margin-top: 30px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.error-term .term-head { display: flex; gap: 7px; margin-bottom: 16px; }
.error-term .term-head span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border);
}
.error-term pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 2.6vw, 13px);
  color: var(--text-dim);
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.error-term .c-accent { color: var(--accent); }
.error-term .c-dim { color: var(--text-faint); }
.error-term .c-danger { color: var(--danger); }

/* ==========================================================================
   Motion layer
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.16,.8,.24,1), transform .7s cubic-bezier(.16,.8,.24,1);
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal.in-view { opacity: 1; transform: translateY(0); }

  .reveal-scale {
    opacity: 0;
    transform: scale(.94);
    transition: opacity .6s ease, transform .6s cubic-bezier(.16,.8,.24,1);
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal-scale.in-view { opacity: 1; transform: scale(1); }

  /* stagger children of a grid automatically via JS-set --reveal-delay */

  /* Pulse on eyebrow dot */
  .eyebrow::before { animation: pulse-dot 2.2s ease-in-out infinite; }
  @keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,230,193,0.55); }
    50% { box-shadow: 0 0 0 6px rgba(34,230,193,0); }
  }

  /* Floating gradient orbs in hero */
  .hero::before { animation: orb-drift 14s ease-in-out infinite alternate; }
  @keyframes orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-18px, 22px) scale(1.06); }
    100% { transform: translate(16px, -14px) scale(1); }
  }

  /* Radar scan sweep across hero grid */
  .hero-grid { position: absolute; overflow: hidden; }
  .hero-grid::after {
    content: "";
    position: absolute;
    top: -20%; left: 50%;
    width: 2px; height: 140%;
    background: linear-gradient(180deg, transparent, rgba(34,230,193,0.9), transparent);
    transform-origin: top center;
    animation: radar-sweep 6s linear infinite;
    filter: drop-shadow(0 0 8px rgba(34,230,193,0.6));
  }
  @keyframes radar-sweep {
    0%   { transform: translateX(-46vw) rotate(0deg); opacity: 0; }
    8%   { opacity: 1; }
    45%  { opacity: 1; }
    50%  { transform: translateX(46vw) rotate(0deg); opacity: 0; }
    100% { transform: translateX(46vw) rotate(0deg); opacity: 0; }
  }

  /* Reading-progress bar (article pages) */
  .read-progress {
    position: fixed;
    top: 0; left: 0;
    z-index: 300;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(34, 230, 193, 0.5);
    will-change: transform;
    pointer-events: none;
  }

  /* Nav link for the section currently in view */
  .nav-links a.is-current {
    color: var(--text);
  }
  .nav-links a.is-current::after {
    transform: scaleX(1);
  }

  /* Pointer-tracked tilt + sheen */
  .tilt {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transform-style: preserve-3d;
    transition: transform .4s cubic-bezier(.2, .7, .3, 1), border-color .3s ease, box-shadow .4s ease;
  }
  .tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
                rgba(34, 230, 193, 0.10), transparent 62%);
  }
  .tilt:hover::after { opacity: 1; }
  .card, .project-card, .post-card { position: relative; }

  /* Article prose staggered reveal */
  .prose-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s ease, transform .55s cubic-bezier(.16, .8, .24, 1);
  }
  .prose-reveal.in-view { opacity: 1; transform: translateY(0); }

  /* Trust strip drifts only when the row actually overflows its container */
  .trust-items.marquee {
    overflow: hidden;
    flex: 1 1 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  .trust-items.marquee .trust-track {
    width: max-content;
    flex-wrap: nowrap;
    animation: drift 30s linear infinite;
  }
  .trust-items.marquee:hover .trust-track { animation-play-state: paused; }
  @keyframes drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }

  /* Parallax layers are moved from JS — hint the compositor */
  .hero-grid, .article-hero img { will-change: transform; }

  /* Controls lean toward the cursor */
  .magnetic {
    transform: translate(var(--pull-x, 0), var(--pull-y, 0));
    transition: transform .32s cubic-bezier(.2, .7, .3, 1), box-shadow .3s ease,
                border-color .3s ease, color .3s ease;
  }
  .btn.magnetic:hover { transform: translate(var(--pull-x, 0), calc(var(--pull-y, 0px) - 2px)); }

  /* Chips (tags, badges, trust logos) pop in on arrival */
  .chip {
    opacity: 0;
    transform: translateY(9px) scale(.96);
  }
  .chip-in {
    opacity: 1;
    transform: none;
    transition: opacity .45s ease, transform .45s cubic-bezier(.16, .8, .24, 1);
    transition-delay: var(--chip-delay, 0s);
  }

  /* Heading rule draws itself in */
  .has-rule { position: relative; }
  .has-rule::after {
    content: "";
    position: absolute;
    left: 0; bottom: -14px;
    width: 62px; height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .7s cubic-bezier(.16, .8, .24, 1) .12s;
  }
  .has-rule.rule-in::after { transform: scaleX(1); }
  .section-head h2.has-rule, .page-header h1.has-rule { margin-bottom: 26px; }

  /* About photo breathes */
  .about-photo img { animation: float-slow 9s ease-in-out infinite; }
  @keyframes float-slow {
    0%, 100% { transform: scale(1.02) translateY(0); }
    50%      { transform: scale(1.045) translateY(-8px); }
  }

  /* Mobile drawer links arrive in sequence */
  .nav.is-open .nav-links li {
    animation: drawer-in .38s cubic-bezier(.16, .8, .24, 1) backwards;
  }
  .nav.is-open .nav-links li:nth-child(1) { animation-delay: .04s; }
  .nav.is-open .nav-links li:nth-child(2) { animation-delay: .08s; }
  .nav.is-open .nav-links li:nth-child(3) { animation-delay: .12s; }
  .nav.is-open .nav-links li:nth-child(4) { animation-delay: .16s; }
  .nav.is-open .nav-links li:nth-child(5) { animation-delay: .20s; }
  .nav.is-open .nav-links li:nth-child(6) { animation-delay: .24s; }
  .nav.is-open .nav-links li:nth-child(7) { animation-delay: .28s; }
  @keyframes drawer-in {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
  }

  /* Cross-document view transitions where the browser supports them */
  @view-transition { navigation: auto; }

  /* Gradient text shimmer */
  .hero h1 .grad {
    background-size: 200% auto;
    animation: shimmer 5s linear infinite;
  }
  @keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
  }

  /* Terminal cursor blink */
  .type-cursor {
    display: inline-block;
    width: 8px; height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: -2px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 6px var(--accent);
  }
  @keyframes blink { 50% { opacity: 0; } }

  /* Hero visual entrance + idle float */
  .hero-visual {
    animation: float-y 6s ease-in-out infinite;
  }
  @keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  /* Card hover glow + lift (upgrades existing hover) */
  .card, .project-card, .post-card, .skill-group {
    transition: transform .35s cubic-bezier(.16,.8,.24,1), border-color .35s ease, box-shadow .35s ease, background .35s ease;
  }
  .card:hover, .project-card:hover {
    box-shadow: 0 16px 40px rgba(34,230,193,0.12);
  }
  .card:hover .card-icon {
    animation: icon-pop .4s cubic-bezier(.34,1.56,.64,1);
  }
  @keyframes icon-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(-6deg); }
    100% { transform: scale(1); }
  }

  /* Button shine sweep */
  .btn { position: relative; overflow: hidden; }
  .btn::after {
    content: "";
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
  }
  .btn:hover::after { left: 130%; }

  /* Nav link underline sweep */
  .nav-links a {
    position: relative;
  }
  .nav-links a::after {
    content: "";
    position: absolute;
    left: 0; bottom: -6px;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .3s cubic-bezier(.16,.8,.24,1);
  }
  .nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

  /* Cursor spotlight in hero */
  .hero { --spot-x: 50%; --spot-y: 30%; }
  .hero-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(320px 320px at var(--spot-x) var(--spot-y), rgba(34,230,193,0.08), transparent 70%);
    transition: background .1s ease;
  }

  /* Animated counters use JS to update textContent; add a subtle glow while counting */
  .stat strong.counting { color: var(--accent); text-shadow: 0 0 12px rgba(34,230,193,0.5); }

  /* Post thumb icon idle pulse */
  .post-card:hover .post-thumb svg { animation: icon-pop .4s cubic-bezier(.34,1.56,.64,1); }

  /* Logo dot spin on hover */
  .brand:hover .dot { animation: spin-dot .6s ease; }
  @keyframes spin-dot {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
  }

  /* Sticky nav shrink on scroll */
  .nav.scrolled .nav-inner { height: 64px; }
  .nav { transition: background .3s ease; }
  .nav-inner { transition: height .3s ease; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { flex-direction: column; }
}
@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .about-highlights { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero { padding: 90px 0 70px; }

  /* --- Mobile nav drawer --- */
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn { display: none; }

  .nav-links {
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 24px;
    /* Fully opaque — a translucent drawer let the hero text read through it. */
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    /* Collapsed by default; .nav-open on <body> reveals it. */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform .22s ease, opacity .22s ease, visibility .22s;
  }
  body.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 52px;
    font-size: 16px;
  }
  /* Contact CTA is dropped from the bar on mobile — re-add it in the drawer */
  .nav-links .nav-drawer-cta {
    display: block;
    margin-top: 18px;
    border-bottom: none;
  }
  .nav-links .nav-drawer-cta a.btn {
    display: flex;
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  /* `.nav-links a` would otherwise win over `.btn-primary` and grey out the label */
  .nav-links .nav-drawer-cta a.btn-primary { color: #04140f; }

  /* WCAG 2.2 target size — footer/breadcrumb links were ~17px tall */
  .footer-col a, .breadcrumb a, .post-link {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
  }
}
