/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #0E141C;
  --bg-raised: #141B25;
  --surface: #1A2230;
  --surface-border: #2A3444;
  --text: #E9ECF1;
  --text-dim: #909BAD;
  --text-faint: #5C6779;
  --accent: #35D399;       /* signal green - status / reliability */
  --accent-dim: #1F6E52;
  --accent-warm: #FF9452;  /* sparing use: CTAs, one highlight per view */
  --rail: #2A3444;

  --font-display: "Space Grotesk", "General Sans", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(53, 211, 153, 0.06), transparent 420px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

section { padding: 108px 0; }

@media (max-width: 720px) {
  section { padding: 72px 0; }
  .wrap { padding: 0 20px; }
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

.section-head h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  margin-bottom: 14px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 60ch;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 20, 28, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-nav .brand {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

.site-nav .brand span { color: var(--accent); }

.site-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
}

.site-nav a.nav-link:hover { color: var(--text); }

.site-nav .nav-cta {
  border: 1px solid var(--surface-border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.site-nav .nav-cta:hover { border-color: var(--accent); color: var(--accent); }

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

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-links ul {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--surface-border);
    padding: 8px 20px 16px;
  }
  .nav-links ul.is-open { display: flex; }
  .nav-links ul li { padding: 12px 0; border-bottom: 1px solid var(--surface-border); }
  .nav-links ul li:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
}

/* ==========================================================================
   Hero entrance - the single orchestrated motion moment on the page
   ========================================================================== */
.hero-fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: hero-in 0.7s ease-out 0.05s forwards;
}

@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 96px 0 100px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: rgba(53, 211, 153, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 211, 153, 0.18);
}

.hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 22px;
}

.hero h1 .role {
  display: block;
  color: var(--text-dim);
  font-size: 0.46em;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 14px;
}

.hero .tagline {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-primary { background: var(--accent); color: #071711; }
.btn-primary:hover { background: #4fe3ac; }

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

.hero-meta {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 26px;
}

.hero-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  font-size: 14.5px;
}

.hero-meta dt {
  font-family: var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
}

.hero-meta dd { margin: 0; color: var(--text); }

.hero-meta hr {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--surface-border);
  margin: 4px 0;
}

/* ==========================================================================
   Timeline - the one bold element on the page
   ========================================================================== */
.timeline { position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 132px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--rail);
}

@media (max-width: 720px) {
  .timeline::before { left: 20px; }
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 32px;
  padding-bottom: 52px;
}

.timeline-entry:last-child { padding-bottom: 0; }

@media (max-width: 720px) {
  .timeline-entry { grid-template-columns: 1fr; padding-left: 44px; gap: 8px; }
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  padding-top: 3px;
  text-align: right;
}

@media (max-width: 720px) {
  .timeline-year { text-align: left; margin-bottom: 6px; }
}

.timeline-entry::after {
  content: "";
  position: absolute;
  left: 128px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
}

.timeline-entry.is-featured::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(53, 211, 153, 0.16);
}

@media (max-width: 720px) {
  .timeline-entry::after { left: 16px; }
}

.timeline-card {
  border: 1px solid var(--surface-border);
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 22px 26px;
}

.timeline-entry.is-featured .timeline-card {
  border-color: var(--accent-dim);
}

.timeline-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.timeline-org {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.timeline-card p.summary {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 14px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--surface-border);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ==========================================================================
   Skills - subtle "explore full stack" ticker + reveal
   ========================================================================== */
@keyframes stack-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.stack-reveal {
  position: relative;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-raised);
  margin-bottom: 40px;
}

.stack-ticker-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  opacity: 0.14;
  pointer-events: none;
}

.stack-ticker {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  animation: stack-ticker-scroll 60s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stack-ticker { animation: none; }
}

.stack-reveal-front {
  position: relative;
  padding: 26px 28px;
}

.stack-toggle {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}

.stack-toggle .chev {
  font-size: 11px;
  transition: transform 0.2s ease;
  color: var(--text-faint);
}

.stack-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.stack-stat {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 10px 0 0;
}

.stack-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.stack-panel .skills-grid { padding-top: 24px; }

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-group {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  background: var(--bg-raised);
}

.skill-group h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
}

/* Recency tiers: styling is derived from start/end years set in the admin -
   nothing here is hardcoded per skill. */
.skill-tag.tier-current {
  color: var(--text);
  border-color: var(--accent-dim);
  font-weight: 500;
}

.skill-tag.tier-established {
  color: var(--text-dim);
  opacity: 0.8;
}

.skill-tag.tier-foundational {
  color: var(--text-faint);
  opacity: 0.55;
  border-style: dashed;
}

.skill-tag.tier-unknown {
  color: var(--text-dim);
  opacity: 0.75;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

@media (max-width: 780px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  border: 1px solid var(--surface-border);
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card .subtitle {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.project-card h3 { font-size: 19px; }

.project-card p.desc { color: var(--text-dim); font-size: 15px; }

.project-card p.stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-top: -6px;
}

.project-card .link {
  margin-top: auto;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  width: fit-content;
}

.project-card .link:hover { text-decoration: underline; }

/* ==========================================================================
   Testimonials - auto-scrolling marquee wall
   ========================================================================== */
@keyframes testimonial-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.testimonial-marquee {
  width: 100%;
  overflow: hidden;
  padding: 4px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.testimonial-track {
  display: flex;
  gap: 18px;
  width: max-content;
  animation: testimonial-scroll 55s linear infinite;
}

.testimonial-track:hover { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .testimonial-track { animation: none; }
}

/* Dual row - two independent strips, second one runs the same keyframes
   in reverse so it visually drifts the opposite way. */
.testimonial-dual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.testimonial-track.row-a { animation-duration: 50s; }
.testimonial-track.row-b { animation-duration: 60s; animation-direction: reverse; }

/* Hover spotlight - card scales up and its border lights up on hover;
   the row pauses via the shared .testimonial-track:hover rule above. */
.spotlight-card {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.spotlight-card:hover {
  transform: scale(1.045);
  border-left-color: var(--accent);
}

/* Featured card - one testimonial at a time, JS-driven (main.js), fixed
   min-height so short/medium quotes don't shift the layout; only the
   expand-for-long-quotes interaction changes height. */
.featured-wrap {
  display: flex;
  justify-content: center;
}

.featured-card {
  border: 1px solid var(--surface-border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 26px 28px;
  background: var(--bg-raised);
  width: 100%;
  max-width: 520px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.featured-card .stars {
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.featured-card .star-filled { color: var(--accent); }
.featured-card .star-empty { color: var(--surface-border); }

.featured-quote-wrap {
  overflow: hidden;
  max-height: 128px;
  transition: max-height 0.3s ease;
}

.featured-card p.quote {
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

.featured-expand {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  display: none;
}

.featured-expand:hover { color: var(--text); }

.featured-card .attribution {
  font-size: 13px;
  color: var(--text-faint);
  margin: 16px 0 0;
}

.featured-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--surface-border);
}

.featured-nav-btn {
  all: unset;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}

.featured-nav-btn:hover { color: var(--accent); }

.featured-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

@media (prefers-reduced-motion: reduce) {
  .featured-quote-wrap { transition: none; }
}

.testimonial-card {
  border: 1px solid var(--surface-border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 22px 24px;
  background: var(--bg-raised);
  width: 320px;
  flex-shrink: 0;
}

.testimonial-card .stars {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 1px;
}

.testimonial-card .star-filled { color: var(--accent); }
.testimonial-card .star-empty { color: var(--surface-border); }

.testimonial-card p.quote {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.55;
}

.testimonial-card .attribution {
  font-size: 13px;
  color: var(--text-faint);
}

.testimonial-card .attribution strong { color: var(--text-dim); }

.empty-note {
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 28px;
  color: var(--text-faint);
  font-size: 14.5px;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
}

@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info dl {
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-info dt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.contact-info dd { margin: 2px 0 0; font-size: 15px; }
.contact-info dd a { text-decoration: none; color: var(--text); }
.contact-info dd a:hover { color: var(--accent); }

form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.hp-field { position: absolute; left: -9999px; }

.form-errors {
  font-size: 13.5px;
  color: var(--accent-warm);
}

.alert {
  border: 1px solid var(--accent-dim);
  background: rgba(53, 211, 153, 0.08);
  color: var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--surface-border);
  padding: 40px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

footer p { font-size: 13.5px; color: var(--text-faint); }

footer .foot-links { display: flex; gap: 20px; }

footer .foot-links a {
  font-size: 13.5px;
  color: var(--text-faint);
  text-decoration: none;
}

footer .foot-links a:hover { color: var(--accent); }
