/* ==========================================================================
   Andrew Hess — personal site
   Plain CSS. No build step. Dark-first with a light theme via [data-theme].
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  --bg: #0c0913;
  --bg-tint-a: rgba(139, 92, 246, 0.10);
  --bg-tint-b: rgba(192, 132, 252, 0.06);
  --surface: #16111f;
  --surface-2: #1d1729;
  --border: #2a2238;
  --border-strong: #3a2f4d;
  --text: #ece9f2;
  --text-muted: #a49cb4;
  --text-dim: #776e86;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-2: #d8b4fe;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Orbitron", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --max-w: 1080px;
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg: #eeebf2;
  --bg-tint-a: rgba(124, 58, 237, 0.07);
  --bg-tint-b: rgba(168, 85, 247, 0.05);
  --surface: #f7f5fa;
  --surface-2: #e8e4ee;
  --border: #d9d3e2;
  --border-strong: #c2b9ce;
  --text: #1e1a26;
  --text-muted: #5b5369;
  --text-dim: #837a92;
  --accent: #6d28d9;
  --accent-soft: rgba(109, 40, 217, 0.10);
  --accent-2: #9333ea;
}

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, var(--bg-tint-a), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, var(--bg-tint-b), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 650;
}

/* Orbitron is a display face — used for section headings and short labels only,
   never for body copy or the name, where its width hurts readability. */
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.28;
}

p {
  margin: 0;
}

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

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

/* ---- Eyebrow / small caps label ---- */
.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand .brand-mark {
  font-family: var(--font-display);
  color: var(--accent);
  margin-right: 8px;
}

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

.nav a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

.theme-toggle {
  margin-left: 6px;
  width: 34px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ---- Hero ---- */
.hero {
  padding: 84px 0 20px;
}

/* The first section after the hero sits tight against it — no divider,
   minimal gap, so the featured content pulls up into view. */
.hero + .section {
  padding-top: 12px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  margin-bottom: 18px;
}

/* Two-column hero: circular portrait on the left, copy to its right. */
.hero-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.hero-copy {
  min-width: 0;
}

.hero-portrait {
  justify-self: start;
}

.hero-portrait img {
  display: block;
  width: clamp(160px, 20vw, 232px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 6px var(--surface), 0 18px 40px rgba(0, 0, 0, 0.28);
}

.hero .org {
  font-family: var(--font-display);
  font-size: clamp(12.5px, 1.8vw, 15px);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 26px;
}

.hero .lede {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 16px;
}

.hero .lede strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Buttons ---- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 550;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #150e21;
}

.btn-primary:hover {
  color: #150e21;
  filter: brightness(1.08);
}

[data-theme="light"] .btn-primary {
  color: #faf8fc;
}

[data-theme="light"] .btn-primary:hover {
  color: #faf8fc;
}

/* ---- Sections ---- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  margin-bottom: 32px;
  max-width: 68ch;
}

.section-head h2 {
  font-size: clamp(23px, 3.4vw, 30px);
  margin-bottom: 10px;
}

.section-head p {
  color: var(--text-muted);
}

/* ---- Capability grid ---- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.cap h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.cap ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cap li {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}

/* ---- Proof points ---- */
.proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.proof-item {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
}

.proof-item h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.proof-item p {
  font-size: 14.5px;
  color: var(--text-muted);
}

/* ---- Video library ---- */
.video-cat {
  margin-bottom: 56px;
}

.video-cat:last-child {
  margin-bottom: 0;
}

.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.cat-head h2 {
  font-size: 21px;
}

.cat-head .count {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-dim);
}

.cat-head p {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 14.5px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

a.video-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-3px);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* placeholder shown when a video has no URL yet */
.video-thumb.is-empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
}

.video-thumb.is-empty span {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 10, 28, 0.34);
  opacity: 0;
  transition: opacity 0.18s ease;
}

a.video-card:hover .play-badge {
  opacity: 1;
}

.play-badge span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #150e21;
  font-size: 15px;
  padding-left: 3px;
}

.video-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.video-body h3 {
  font-size: 16px;
}

.video-body p {
  font-size: 14px;
  color: var(--text-muted);
}

.video-meta {
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.featured-flag {
  color: var(--accent-2);
}

/* ---- Work / projects ---- */
.project-list {
  display: grid;
  gap: 18px;
}

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.project h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.project p {
  color: var(--text-muted);
  max-width: 78ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tags span {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.contact-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

a.contact-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-3px);
}

.contact-card .label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.contact-card .value {
  font-size: 16px;
  font-weight: 550;
  word-break: break-word;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 24px;
}

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

.site-footer p,
.site-footer a {
  font-size: 13.5px;
  color: var(--text-dim);
}

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

/* ---- Loading / empty states ---- */
.state {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  padding: 20px 0;
}

/* ---- Motion / responsive ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 24px;
  }

  .hero-portrait {
    justify-self: center;
  }

  .hero-copy .actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 56px 0 16px;
  }

  .hero + .section {
    padding-top: 8px;
  }

  .section {
    padding: 48px 0;
  }

  .nav a {
    padding: 7px 9px;
    font-size: 13.5px;
  }

  .brand span.brand-full {
    display: none;
  }
}
