/* ===========================================================
   Tokens
   =========================================================== */
:root {
  --ink: #12161d;         /* background */
  --ink-raised: #1a2029;  /* card/panel background */
  --paper: #ede9e1;       /* primary text */
  --muted: #8b93a1;       /* secondary text */
  --line: #2a313d;        /* borders / dividers */
  --signal: #6fbf9a;      /* accent — metrics, links, "system ok" */
  --flag: #d9724a;        /* accent — CTAs, tags, emphasis */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --max-width: 1080px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
}

/* ===========================================================
   Reset & base
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; color: var(--paper); }
p { margin: 0; color: var(--muted); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.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;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--signal); color: var(--ink); padding: 0.75rem 1.25rem;
  font-family: var(--font-mono); font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* ===========================================================
   Layout helpers
   =========================================================== */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--signal);
  margin: 0 0 0.9rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  max-width: 30ch;
}

.section-sub {
  margin-top: 0.85rem;
  max-width: 56ch;
  font-size: 0.98rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===========================================================
   Header / nav
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 22, 29, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.95rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.nav-list a { color: var(--muted); transition: color 0.2s ease; }
.nav-list a:hover { color: var(--paper); }

.nav-cta {
  border: 1px solid var(--signal);
  color: var(--signal) !important;
  padding: 0.4rem 0.75rem;
  border-radius: 3px;
}
.nav-cta:hover { background: var(--signal); color: var(--ink) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 20px; height: 2px; background: var(--paper); display: block;
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--ink-raised);
    border-bottom: 1px solid var(--line);
    padding: 1.25rem var(--gutter);
    gap: 1rem;
    display: none;
  }
  .nav-list.is-open { display: flex; }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  padding-top: clamp(4.5rem, 12vw, 8rem);
  padding-bottom: 2rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--flag);
  margin: 0 0 1.25rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  max-width: 18ch;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin-top: 1.5rem;
  max-width: 54ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.75rem 1.4rem;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-block;
}
.btn-primary { background: var(--signal); color: var(--ink); }
.btn-primary:hover { background: #85cdac; }
.btn-ghost { border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); }

.status-line {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(111, 191, 154, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 191, 154, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(111, 191, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 154, 0); }
}

/* ===========================================================
   Impact strip
   =========================================================== */
.impact { border-top: 1px solid var(--line); }

.impact-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.impact-item {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.impact-num {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--signal);
}

.impact-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

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

/* ===========================================================
   Case studies
   =========================================================== */
.work { border-top: 1px solid var(--line); }

.case-study {
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ink-raised);
  overflow: hidden;
}

.case-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--line);
}

.case-head h3 {
  font-size: 1.15rem;
  max-width: 46ch;
}

.case-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--flag);
  border: 1px solid var(--flag);
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
a.case-tag:hover {
  background: var(--flag);
  color: var(--ink);
}

.case-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.case-field {
  padding: 1.4rem 1.6rem;
  border-top: 1px solid var(--line);
}
.case-field:nth-child(-n+2) { border-top: none; }
.case-field:nth-child(odd) { border-right: 1px solid var(--line); }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.case-field p { color: var(--paper); font-size: 0.95rem; }
.case-field strong { color: var(--signal); }

.case-source {
  padding: 1.1rem 1.6rem;
  border-top: 1px solid var(--line);
}
.case-source-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
}
.case-source-link:hover { color: var(--paper); }

@media (max-width: 640px) {
  .case-fields { grid-template-columns: 1fr; }
  .case-field:nth-child(odd) { border-right: none; }
  .case-field:nth-child(-n+2) { border-top: 1px solid var(--line); }
  .case-field:first-child { border-top: none; }
}

/* ===========================================================
   Built by me
   =========================================================== */
.built { border-top: 1px solid var(--line); }

.project-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--flag); transform: translateY(-2px); }

.project-card h3 { font-size: 1.15rem; }
.project-card p { font-size: 0.92rem; }

.stack-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.stack-chips span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
}

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

/* ===========================================================
   Beyond the day job
   =========================================================== */
.beyond { border-top: 1px solid var(--line); }

.beyond-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.beyond-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem;
  display: block;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.beyond-card:hover { border-color: var(--flag); transform: translateY(-2px); }

.beyond-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--flag);
  letter-spacing: 0.05em;
}

.beyond-card h3 { margin-top: 0.6rem; font-size: 1.15rem; }
.beyond-card p { margin-top: 0.5rem; font-size: 0.92rem; }

.beyond-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
}

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

/* ===========================================================
   Contact
   =========================================================== */
.contact { border-top: 1px solid var(--line); text-align: left; }
.contact h2 { margin-top: 0.75rem; font-size: clamp(1.6rem, 3.5vw, 2.4rem); max-width: 24ch; }

.contact-links {
  margin-top: 1.75rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.contact-links a { color: var(--signal); border-bottom: 1px solid transparent; }
.contact-links a:hover { color: var(--paper); border-color: var(--paper); }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter);
  text-align: center;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
