/* ============================================
   ericsizemore.tech — ES Design System
   Palette "Sooners alt": crimson / anthracite / cream.
   Console wordmark in JetBrains Mono; Space Grotesk UI.
   Dark (anthracite) is default; light (cream) flips.
   Source of truth: the ES Design System handoff
   (tokens/, components/core/, ui_kits/site/).
   ============================================ */

:root {
  /* base palette — constants, never theme-swap */
  --crimson: #A3151C;
  --crimson-deep: #841617;
  --anthracite: #1C1E21;
  --anthracite-2: #25282C;
  --anthracite-3: #31353A;
  --cream: #F3ECD6;
  --cream-2: #EAE1C6;
  --cream-3: #DED3B2;
  --gray-mid: #8B8F96;
  --gray-warm: #6A6660;
  --accent: var(--crimson);
  --accent-badge: var(--anthracite);   /* fixed badge ground (favicon/avatar/toast) */
  --on-accent: var(--cream);           /* text/icon sitting ON the accent */
  --danger: #D8483A;
  --success: #7FA36B;

  /* type */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --text-eyebrow: 10.5px;
  --text-caption: 12.5px;
  --text-small: 13.5px;
  --text-body: 16px;
  --text-lead: 19px;
  --text-h3: 24px;
  --text-h2: 32px;
  --text-h1: 46px;
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-body: 1.55;
  --tracking-eyebrow: .22em;
  --tracking-label: .12em;
  --tracking-wordmark: -.01em;
  --tracking-display: -.02em;

  /* spacing · radii · motion */
  --radius-xs: 5px;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-knob: 0 1px 4px rgba(0, 0, 0, .3);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: .2s;
  --dur-base: .3s;
  --dur-theme: .45s;
  --measure: 680px;
  --page-max: 1120px;
  --page-pad: 40px;

  /* legacy aliases (pre-ES class vocabulary maps here) */
  --max-width: var(--page-max);
  --radius: var(--radius-sm);
  --transition: var(--dur-fast) var(--ease);
  --accent-ink: var(--on-accent);
}

/* DARK (anthracite) — default */
[data-theme="dark"] {
  --surface: var(--anthracite);
  --surface-2: var(--anthracite-2);
  --surface-3: var(--anthracite-3);
  --ink: var(--cream);
  --muted: var(--gray-mid);
  --hair: rgba(243, 236, 214, .12);
  --hair-strong: rgba(243, 236, 214, .24);
  --logo-mark: var(--accent);
  --link-hover: var(--accent);
  --focus: var(--accent);
  --overlay: rgba(28, 30, 33, .72);

  --bg-primary: var(--surface);
  --bg-card: var(--surface-2);
  --border: var(--hair);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: var(--muted);
}

/* LIGHT (cream) */
[data-theme="light"] {
  --surface: var(--cream);
  --surface-2: var(--cream-2);
  --surface-3: var(--cream-3);
  --ink: var(--anthracite);
  --muted: var(--gray-warm);
  --hair: rgba(28, 30, 33, .16);
  --hair-strong: rgba(28, 30, 33, .32);
  --logo-mark: var(--crimson-deep);   /* crimson drops deeper on cream for contrast */
  --link-hover: var(--crimson-deep);
  --focus: var(--crimson-deep);
  --overlay: rgba(28, 30, 33, .55);

  --bg-primary: var(--surface);
  --bg-card: var(--surface-2);
  --border: var(--hair);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: var(--muted);
}

/* ============ base ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { font-family: var(--font-sans); background: var(--surface); color: var(--ink); font-size: var(--text-body); line-height: var(--leading-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transition: background var(--dur-theme) var(--ease), color var(--dur-theme) var(--ease); }
a { color: var(--ink); text-decoration: none; text-underline-offset: 3px; transition: color var(--dur-fast); }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-pad); }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--hair); }
.section-title { font-family: var(--font-mono); font-size: var(--text-eyebrow); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.section-subtitle { color: var(--muted); margin-bottom: 32px; font-size: 15px; max-width: var(--measure); }

/* ============ header — contained card, flat, no blur ============ */
.header { position: sticky; top: 12px; z-index: 100; max-width: var(--page-max); margin: 12px auto 0; padding: 0 var(--page-pad); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 22px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius-md); transition: background var(--dur-theme) var(--ease), border-color var(--dur-theme) var(--ease); }
.nav-right { display: flex; align-items: center; gap: 22px; }

/* console wordmark — compact lockup */
.logo { font-family: var(--font-mono); display: inline-flex; align-items: center; white-space: nowrap; font-weight: 500; font-size: 18px; letter-spacing: var(--tracking-wordmark); }
.logo:hover { text-decoration: none; }
.logo .chev { color: var(--logo-mark); font-weight: 700; margin-right: .42em; transition: color var(--dur-fast); }
.logo .word { color: var(--ink); transition: color var(--dur-fast); }
.logo:hover .word { color: var(--link-hover); }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.nav-links { display: flex; list-style: none; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 14px; letter-spacing: .01em; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); text-decoration: none; }

/* theme switch — muted knob in light, accent knob in dark */
.theme-tog { width: 56px; height: 30px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--hair); position: relative; cursor: pointer; flex: 0 0 auto; padding: 0; transition: background var(--dur-base); }
.theme-tog .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); box-shadow: var(--shadow-knob); transition: left var(--dur-base) var(--ease), background var(--dur-base); }
.theme-tog[aria-checked="true"] .knob { left: 31px; background: var(--accent); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger, .hamburger::before, .hamburger::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: all var(--dur-base) var(--ease); }
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ============ hero — dashed stage with portrait ============ */
.hero { padding: 60px 0 0; }
.hero-stage { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding: 64px 56px; border: 1px dashed var(--hair); border-radius: var(--radius-lg); }
.hero-lockup { font-family: var(--font-mono); }
.hero-l1 { margin: 0; display: flex; align-items: center; font-size: clamp(32px, 5vw, var(--text-h1)); font-weight: 500; letter-spacing: var(--tracking-wordmark); line-height: var(--leading-tight); white-space: nowrap; }
.hero-l1 .chev { color: var(--logo-mark); font-weight: 700; margin-right: .4em; transition: color var(--dur-fast); }
.hero-l1 .word { color: var(--ink); transition: color var(--dur-fast); }
.hero-l1 .caret { display: inline-block; width: .56em; height: .95em; background: var(--accent); margin-left: .16em; align-self: center; animation: blink 1.1s steps(1) infinite; }
.hero-tag { margin-top: 16px; padding-left: 1.55em; font-family: var(--font-mono); font-size: 17px; font-weight: 400; color: var(--muted); }
.hero-tag .k { color: var(--logo-mark); transition: color var(--dur-fast); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.portrait { width: 240px; height: 240px; border-radius: var(--radius-md); border: 1px solid var(--hair); object-fit: cover; }
[data-theme="dark"] .portrait-light { display: none; }
[data-theme="light"] .portrait-dark { display: none; }

/* ============ buttons (es-btn) ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; font-family: var(--font-sans); font-weight: 500; font-size: 14px; line-height: 1; letter-spacing: .01em; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.btn:active { transform: scale(.98); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--crimson-deep); color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--hair-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
.btn-console { font-family: var(--font-mono); font-weight: 500; background: var(--surface-2); color: var(--ink); border-color: var(--hair); }
.btn-console::before { content: "\276F"; color: var(--logo-mark); font-weight: 700; }
.btn-console:hover { border-color: var(--hair-strong); color: var(--ink); }

/* ============ about ============ */
.about-content { max-width: var(--measure); }
.about-content p { color: var(--ink); margin-bottom: 18px; font-size: 17px; line-height: 1.6; }
.about-content a { color: var(--ink); }
.about-content a:hover { color: var(--link-hover); }

/* ============ work — console tabs + session rows ============ */
.year-filter { display: flex; flex-wrap: wrap; gap: 28px; border-bottom: 1px solid var(--hair); margin-bottom: 26px; }
.year-pill { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0 0 12px; color: var(--muted); font-family: var(--font-mono); font-size: 13px; font-weight: 500; cursor: pointer; transition: color var(--dur-fast); }
.year-pill:hover { color: var(--ink); }
.year-pill[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.year-pill[aria-pressed="true"]::before { content: "\276F "; color: var(--logo-mark); font-weight: 700; }

.session-list, .interest-list { list-style: none; }
.session-list, .interest-list { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 48px; border-top: 1px solid var(--hair); }
.interest { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.session { padding: 14px 0; border-bottom: 1px solid var(--hair); }
.session-meta { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--muted); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.session-title { font-size: 15.5px; font-weight: 500; margin-bottom: 0; color: var(--ink); line-height: var(--leading-snug); }
.interest-name { font-size: var(--text-lead); font-weight: 500; margin-bottom: 6px; color: var(--ink); line-height: 1.25; }
.session-title a { color: var(--ink); }
.session-title a:hover { color: var(--link-hover); text-decoration: none; }
.interest-by { font-weight: 400; color: var(--muted); font-size: 14px; }
.session-desc, .interest-desc { color: var(--muted); font-size: var(--text-small); line-height: 1.55; margin-bottom: 10px; }
.interest-link { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.interest-link:hover { color: var(--link-hover); text-decoration: none; }

/* ============ writing — post rows ============ */
.post-list { list-style: none; border-top: 1px solid var(--hair); }
.post { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.post .session-meta { margin-bottom: 6px; }
.post-title { font-size: var(--text-lead); font-weight: 500; line-height: var(--leading-snug); margin-bottom: 6px; }
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--link-hover); text-decoration: none; }
.post .session-desc { margin-bottom: 0; }
.writing-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }

/* ============ resources — card grid (es-card) ============ */
.lab-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lab-item { background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius-md); padding: 20px 24px; transition: border-color var(--dur-fast), background var(--dur-theme) var(--ease); }
.lab-item:hover { border-color: var(--hair-strong); }
.lab-status { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--radius-xs); border: 1px solid var(--hair-strong); font-family: var(--font-mono); font-size: var(--text-eyebrow); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; white-space: nowrap; }
.lab-status-shipped { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.stack-tools { font-size: 17px; color: var(--ink); line-height: 1.7; max-width: var(--measure); }

/* ============ connect — social cards ============ */
.social-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 16px; }
.social-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius-md); text-align: center; transition: border-color var(--dur-fast), background var(--dur-theme) var(--ease); }
.social-card:hover { border-color: var(--hair-strong); text-decoration: none; }
.social-icon { width: 26px; height: 26px; color: var(--muted); transition: color var(--dur-fast); }
.social-card:hover .social-icon { color: var(--ink); }
.social-name { font-weight: 500; font-size: 14.5px; color: var(--ink); }
.social-handle { font-size: var(--text-caption); color: var(--muted); font-family: var(--font-mono); }

/* ============ footer ============ */
.footer { border-top: 1px solid var(--hair); padding: 48px 0 40px; text-align: center; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 28px; margin-bottom: 20px; }
.footer-nav a { color: var(--muted); font-size: 13px; letter-spacing: .01em; }
.footer-nav a:hover { color: var(--ink); text-decoration: none; }
.footer-copy { color: var(--muted); font-size: var(--text-caption); font-family: var(--font-mono); }
.footer-sig { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--hair); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; text-transform: uppercase; }
.footer-sig .accent { color: var(--logo-mark); }

/* ============ motion ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-l1 .caret, .logo .caret { animation: none; }
}

/* ============ responsive ============ */
@media (max-width: 820px) {
  .container, .header { padding-left: 20px; padding-right: 20px; }
  .nav-right { gap: 14px; }
  .nav-toggle { display: block; }
  .nav-links { position: fixed; top: 84px; left: 16px; right: 16px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); flex-direction: column; padding: 20px; gap: 14px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease); z-index: 99; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .hero-stage { grid-template-columns: 1fr; padding: 36px 20px; }
  .hero-stage > div { min-width: 0; }
  .portrait { display: none; }
  .section { padding: 40px 0; }
  .session-list, .interest-list { grid-template-columns: 1fr; column-gap: 0; }
  .lab-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-cta, .writing-cta { flex-direction: column; align-items: stretch; }
  .hero-l1 { font-size: clamp(22px, 7.4vw, 30px); }
  .hero-tag { font-size: 14px; }
}
