/* ============================================================
   brenttyson.com — design tokens adapted from the "Steep" system
   Display: Source Serif 4 (free stand-in for Signifier)
   Body:    Inter (Steep's own listed fallback for Söhne)
   Mono:    IBM Plex Mono (labels, tags, eyebrow text)
   ============================================================ */

:root {
  /* color */
  --ink: #17191c;
  --paper: #ffffff;
  --mist: #f2f2f3;
  --fog: #fafafb;
  --slate: #777b86;
  --ash: #979799;
  --smoke: #a3a6af;
  --peach: #fbe1d1;
  --sienna: #5d2a1a;
  --hairline: #e7e7e9;

  /* type */
  --font-display: "Source Serif 4", "GT Sectra", "Tiempos Headline", ui-serif, Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* spacing (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-9: 40px; --sp-10: 64px;
  --sp-11: 80px; --sp-12: 96px; --sp-13: 124px; --sp-14: 128px; --sp-15: 160px;
  --page-max: 1200px;

  /* radius */
  --r-card: 24px;
  --r-card-sm: 16px;
  --r-card-elevated: 20px;
  --r-image: 12px;
  --r-input: 16px;
  --r-pill: 9999px;

  /* shadow */
  --shadow-subtle: 0 0 0 1px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.08);
  --shadow-artifact: 0 0 0 1px rgba(4,23,43,.05), 0 20px 25px -5px rgba(0,0,0,.1);

  --ease: cubic-bezier(.16,.8,.24,1);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { overflow-x: hidden; }
[hidden] { display: none !important; }

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

a { color: inherit; text-decoration: none; }
a.inline-link { color: var(--slate); text-underline-offset: 3px; }
a.inline-link:hover { text-decoration: underline; }

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ---------- eyebrow / mono labels ---------- */
.eyebrow, .tag {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ash);
}

/* ---------- nav ---------- */
header.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
}
.site-nav nav { display: flex; gap: var(--sp-7); align-items: center; }
.site-nav nav a { font-size: 15px; color: var(--slate); white-space: nowrap; }
.site-nav nav a:hover { color: var(--ink); }
.site-nav nav a.resume-link { color: var(--ink); font-weight: 500; }
.wordmark { white-space: nowrap; }

@media (max-width: 480px) {
  .site-nav .wrap {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding-top: var(--sp-3);
    padding-bottom: var(--sp-3);
    gap: var(--sp-2);
  }
  .wordmark { font-size: 18px; }
  .site-nav nav { width: 100%; justify-content: space-between; gap: var(--sp-2); }
  .site-nav nav a { font-size: 12.5px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px;
  border-radius: var(--r-pill);
  font-family: var(--font-body); font-size: 16px; font-weight: 500;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-filled { background: var(--ink); color: var(--paper); }
.btn-filled:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--mist); }
.btn-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero {
  padding: var(--sp-14) 0 var(--sp-11);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6.5vw, 90px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: var(--sp-5) 0 var(--sp-6);
  max-width: 15ch;
}
.hero .lede {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--slate);
  max-width: 56ch;
  margin: 0 0 var(--sp-8);
}

/* ---------- section rhythm ---------- */
section { padding: var(--sp-11) 0; }
section.alt { background: var(--fog); }
.section-head { margin-bottom: var(--sp-9); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.015em;
  margin: var(--sp-3) 0 0;
}

/* ---------- who I am ---------- */
.who-row { display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-8); align-items: flex-start; }
@media (max-width: 640px) { .who-row { grid-template-columns: 1fr; } }
.who-photo {
  width: 96px; height: 96px; border-radius: var(--r-pill);
  object-fit: cover; box-shadow: var(--shadow-artifact);
}
.prose { max-width: 68ch; }
.prose p { font-size: 18px; line-height: 1.6; color: var(--ink); margin: 0 0 var(--sp-5); }
.prose p strong { font-weight: 600; }

/* ---------- floating artifact cards ---------- */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
@media (max-width: 900px) { .artifact-grid { grid-template-columns: 1fr; } }

.artifact-card {
  background: var(--paper);
  border-radius: var(--r-card-elevated);
  box-shadow: var(--shadow-artifact);
  padding: 16px 20px 20px 16px;
  display: flex; flex-direction: column; gap: var(--sp-4);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.artifact-card:hover { transform: translateY(-4px); }
.artifact-card .art-thumb {
  height: 140px;
  border-radius: var(--r-image);
  background: linear-gradient(155deg, var(--mist), var(--fog));
  display: flex; align-items: center; justify-content: center;
  color: var(--smoke);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
}
.artifact-card h3 {
  font-family: var(--font-body); font-weight: 600; font-size: 20px; margin: 0;
}
.artifact-card p { color: var(--slate); font-size: 15px; line-height: 1.5; margin: 0; }
.artifact-card .cta { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: auto; }
.artifact-card .cta:after { content: " \2192"; }

/* ---------- peach stat card (accent, used once) ---------- */
.stat-card {
  background: var(--peach);
  color: var(--sienna);
  border-radius: var(--r-card);
  padding: var(--sp-9) var(--sp-9);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
  text-align: center;
}
@media (max-width: 760px) { .stat-card { grid-template-columns: 1fr; } }
.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
}
.stat-card .stat-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-top: var(--sp-2);
  opacity: .8;
}

/* ---------- testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
@media (max-width: 900px) { .testi-grid { grid-template-columns: 1fr; } }
.testi-card {
  background: var(--mist);
  border-radius: var(--r-card);
  padding: var(--sp-6);
}
.testi-card p.quote { font-size: 15px; line-height: 1.55; color: var(--ink); margin: 0 0 var(--sp-4); }
.testi-card .who { display: flex; align-items: center; gap: var(--sp-3); font-size: 13px; color: var(--slate); }
.testi-card .who strong { color: var(--ink); font-weight: 600; }
.testi-card .who img {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  object-fit: cover; flex: none;
}
.testi-card .who .who-text { display: flex; flex-direction: column; }

/* ---------- worked-with logo strip ---------- */
.logo-strip {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--sp-10);
  padding: var(--sp-8) 0;
}
.logo-strip img {
  height: 28px; width: auto;
  filter: grayscale(1) opacity(0.55);
  transition: filter .2s var(--ease);
}
.logo-strip img:hover { filter: grayscale(0) opacity(1); }
.logo-strip .eyebrow { width: 100%; text-align: center; margin-bottom: var(--sp-2); }

/* ---------- contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-12); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: var(--sp-9); } }
.contact-direct p { font-size: 17px; line-height: 1.6; color: var(--slate); margin: 0 0 var(--sp-6); }
.contact-direct .btn-row { margin-bottom: var(--sp-8); }
.contact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.contact-links li { font-size: 15px; }
.contact-links a { color: var(--ink); font-weight: 500; }
.contact-links .label { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ash); margin-bottom: 2px; }

.contact-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.contact-form .field { display: flex; flex-direction: column; gap: var(--sp-2); }
.contact-form label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); }
.contact-form input, .contact-form textarea {
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--fog); border: 1px solid var(--hairline);
  border-radius: var(--r-input); padding: 14px 16px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--ink); background: var(--paper);
}
.contact-form textarea { resize: vertical; min-height: 140px; font-family: var(--font-body); }
.contact-form button.btn { border: none; cursor: pointer; align-self: flex-start; }
.contact-form .form-note { font-size: 13px; color: var(--ash); margin: 0; }
.form-status { font-size: 14px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-card-sm); margin: 0 0 var(--sp-5); }
.form-status.success { background: var(--peach); color: var(--sienna); }
.form-status.error { background: #fdecec; color: #9c2626; }

/* ---------- credentials teaser ---------- */
.cred-teaser {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-6);
  padding: var(--sp-8);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}
.cred-teaser .big { font-family: var(--font-display); font-size: clamp(28px,3vw,40px); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: var(--sp-8) 0;
}
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-4); }
footer nav { display: flex; gap: var(--sp-6); }
footer, footer a { color: var(--slate); font-size: 14px; }
footer a:hover { color: var(--ink); }

/* ---------- entrances ----------
   Visible by default (progressive enhancement): JS adds .pre-in
   synchronously on load, THEN elements animate up to .in on scroll.
   If JS never runs, content simply stays fully visible. */
.in-view.pre-in { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.in-view.pre-in.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .in-view { opacity: 1 !important; transform: none !important; transition: none !important; }
  .artifact-card:hover, .btn:hover { transform: none; }
}

/* ============================================================
   Sub-page header (Work, Credentials, Contact)
   ============================================================ */
.page-header { padding: var(--sp-12) 0 var(--sp-9); }
.page-header h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.015em;
  margin: var(--sp-3) 0 var(--sp-5);
  max-width: 18ch;
}
.page-header .lede { font-size: 18px; color: var(--slate); max-width: 60ch; margin: 0; }

/* ============================================================
   Work page — case studies
   ============================================================ */
.case-study { padding: var(--sp-11) 0; border-top: 1px solid var(--hairline); }
.case-study .wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--sp-10); align-items: start; }
@media (max-width: 900px) { .case-study .wrap { grid-template-columns: 1fr; gap: var(--sp-6); } }

.case-media {
  border-radius: var(--r-card-elevated);
  box-shadow: var(--shadow-artifact);
  overflow: hidden;
  background: linear-gradient(155deg, var(--mist), var(--fog));
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  color: var(--smoke);
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  text-align: center; padding: var(--sp-6);
}

.case-body h2 { font-family: var(--font-body); font-weight: 600; font-size: 28px; margin: var(--sp-2) 0 var(--sp-5); }
.case-body h3 {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ash); margin: var(--sp-6) 0 var(--sp-2);
}
.case-body h3:first-of-type { margin-top: 0; }
.case-body p { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0 0 var(--sp-2); }
.case-body .stack-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.case-body .stack-tags span {
  font-family: var(--font-mono); font-size: 12px; color: var(--slate);
  background: var(--mist); border-radius: var(--r-pill); padding: 4px 12px;
}
.case-body .note {
  font-size: 14px; color: var(--slate); font-style: italic; margin-top: var(--sp-4);
  border-left: 2px solid var(--hairline); padding-left: var(--sp-4);
}

/* ============================================================
   Credentials page
   ============================================================ */
.issuer-group { padding: var(--sp-9) 0; border-top: 1px solid var(--hairline); }
.issuer-group .issuer-name {
  font-family: var(--font-display); font-size: 26px; margin: 0 0 var(--sp-6);
}
.cred-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
@media (max-width: 700px) { .cred-grid { grid-template-columns: 1fr; } }

.cred-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: var(--mist); border-radius: var(--r-card-sm);
  padding: var(--sp-4) var(--sp-5);
}
.cred-row.placeholder { background: var(--fog); border: 1px dashed var(--hairline); }
.cred-row .cred-title-btn {
  background: none; border: none; padding: 0; margin: 0;
  font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--ink);
  text-align: left; cursor: pointer;
}
.cred-row .cred-title-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.cred-row .placeholder-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--ash); text-transform: uppercase;
  display: block; margin-top: 2px;
}
.cred-row .verify-link {
  font-family: var(--font-mono); font-size: 12px; color: var(--slate);
  white-space: nowrap; flex-shrink: 0;
}
.cred-row .verify-link:hover { color: var(--ink); text-decoration: underline; }
.cred-row .verify-link.needs-link { color: var(--smoke); cursor: default; }
.cred-row .verify-link.needs-link:hover { text-decoration: none; color: var(--smoke); }

/* ============================================================
   Certificate modal
   ============================================================ */
.cert-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6);
}
.cert-modal[hidden] { display: none; }
.cert-modal .backdrop {
  position: absolute; inset: 0; background: rgba(23,25,28,.6); backdrop-filter: blur(3px);
}
.cert-modal .modal-panel {
  position: relative; background: var(--paper); border-radius: var(--r-card);
  max-width: 640px; width: 100%; max-height: 86vh; overflow: auto;
  padding: var(--sp-6); box-shadow: var(--shadow-artifact);
}
.cert-modal .modal-close {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--mist); border: none; font-size: 18px; line-height: 1; cursor: pointer;
}
.cert-modal .modal-close:hover { background: var(--hairline); }
.cert-modal img { width: 100%; border-radius: var(--r-image); display: block; margin-bottom: var(--sp-4); background: var(--fog); }
.cert-modal h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 var(--sp-2); }
.cert-modal .modal-issuer { color: var(--slate); font-size: 14px; margin: 0 0 var(--sp-5); }
.cert-img-placeholder {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--r-image); margin-bottom: var(--sp-4);
  background: var(--fog); border: 1px dashed var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--smoke);
}
