/* ============================================================
   Erasmus Labs — design tokens + marketing styles
   Single-typeface system (Geist). Glass + brushed-metal texture.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Type families — single typeface system. Geist for everything; mono for fine print. */
  --font-display: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale */
  --fs-display-xl: 88px;
  --fs-display-l:  64px;
  --fs-display-m:  48px;
  --fs-h1:         36px;
  --fs-h2:         28px;
  --fs-h3:         22px;
  --fs-h4:         18px;
  --fs-body-l:     17px;
  --fs-body:       15px;
  --fs-body-s:     13px;
  --fs-caption:    12px;
  --fs-mono:       13px;

  --lh-display: 1.04;
  --lh-heading: 1.18;
  --lh-body:    1.55;
  --lh-tight:   1.3;

  --tracking-display: -0.005em;
  --tracking-heading: -0.005em;
  --tracking-body:    -0.003em;
  --tracking-mono:    0.02em;
  --tracking-eyebrow: 0.22em;

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;

  /* Ink scale */
  --ink-0:  #FFFFFF;
  --ink-50: #F4F5F7;
  --ink-100: #E8EAEF;
  --ink-200: #D1D5DD;
  --ink-300: #A8AEBC;
  --ink-400: #7B8294;
  --ink-500: #5A6274;
  --ink-600: #3F4757;
  --ink-700: #232938;
  --ink-800: #141826;
  --ink-900: #0A0E1A;
  --ink-950: #05070F;

  /* Semantic — light mode */
  --bg:           var(--ink-0);
  --bg-elevated:  var(--ink-0);
  --bg-subtle:    var(--ink-50);
  --bg-muted:     var(--ink-100);
  --bg-inverse:   var(--ink-900);

  --fg:           var(--ink-900);
  --fg-strong:    var(--ink-950);
  --fg-muted:     var(--ink-500);
  --fg-subtle:    var(--ink-400);
  --fg-disabled:  var(--ink-300);
  --fg-inverse:   var(--ink-50);

  --border:        var(--ink-100);
  --border-strong: var(--ink-200);
  --border-focus:  #C15B32;

  --accent:        #C15B32;
  --accent-hover:  #A94F2C;
  --accent-press:  #8E4228;
  --accent-fg:     #FFFFFF;
  --accent-soft:   #F7E5D8;

  /* Radii */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-2xl: 28px; --r-full: 9999px;

  /* Spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Shadows */
  --shadow-xs: 0 1px 0 rgba(10, 14, 26, 0.04), 0 1px 2px rgba(10, 14, 26, 0.04);
  --shadow-sm: 0 1px 2px rgba(10, 14, 26, 0.05), 0 2px 6px rgba(10, 14, 26, 0.05);
  --shadow-md: 0 1px 3px rgba(10, 14, 26, 0.06), 0 8px 20px -8px rgba(10, 14, 26, 0.12);
  --shadow-lg: 0 1px 3px rgba(10, 14, 26, 0.06), 0 24px 48px -16px rgba(10, 14, 26, 0.18);
  --shadow-xl: 0 2px 4px rgba(10, 14, 26, 0.06), 0 40px 80px -24px rgba(10, 14, 26, 0.24);

  --inset-hi:      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --inset-hi-dark: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --inset-lo-dark: inset 0 -1px 0 rgba(0, 0, 0, 0.4);

  --focus-ring: 0 0 0 3px rgba(193, 91, 50, 0.24);

  --ease-standard:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:        cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 320ms;
}

[data-theme="dark"] {
  --bg:           var(--ink-900);
  --bg-elevated:  var(--ink-800);
  --bg-subtle:    #11151F;
  --bg-muted:     #1B2030;
  --bg-inverse:   var(--ink-50);

  --fg:           var(--ink-50);
  --fg-strong:    #FFFFFF;
  --fg-muted:     #8B92A5;
  --fg-subtle:    #6B7285;
  --fg-disabled:  #4A5161;
  --fg-inverse:   var(--ink-900);

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus:  #E08B66;

  --accent:        #E08B66;
  --accent-hover:  #F0A27E;
  --accent-press:  #C15B32;
  --accent-fg:     var(--ink-900);
  --accent-soft:   rgba(224, 139, 102, 0.16);

  --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 40px 80px -24px rgba(0, 0, 0, 0.7);
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "cv02";
}
body {
  min-height: 100vh;
  /* Subtle ambient warmth keeps the company site aligned with Era's storybook palette. */
  background-image:
    radial-gradient(1200px 600px at 78% -10%, rgba(205,122,74,0.07), transparent 60%),
    radial-gradient(900px 500px at 12% 110%, rgba(196,154,87,0.08), transparent 60%);
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(1200px 600px at 78% -10%, rgba(205,122,74,0.10), transparent 60%),
    radial-gradient(900px 500px at 12% 110%, rgba(230,209,160,0.05), transparent 60%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--fg-strong);
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-heading);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-display); line-height: var(--lh-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p  { color: var(--fg); margin: 0 0 var(--s-4); text-wrap: pretty; }
small, .text-caption { font-size: var(--fs-caption); color: var(--fg-muted); }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-standard);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

::selection { background: rgba(193, 91, 50, 0.24); color: var(--ink-900); }
[data-theme="dark"] ::selection { background: rgba(224, 139, 102, 0.35); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============ container ============ */
.container { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 720px) { .container, .container-wide { padding: 0 20px; } }

/* ============ HEADER — sticky, glass blur ============ */
.eh {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
}
.eh-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.eh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.eh-brand img { width: 18px; height: 18px; }
.eh-brand-name {
  font-weight: 500; font-size: 14px;
  color: var(--fg-strong);
  letter-spacing: -0.005em;
}
.eh-actions { display: flex; align-items: center; gap: 16px; }
.eh-coord { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--fg-subtle); }
@media (max-width: 720px) { .eh-coord { display: none; } }

/* Theme-aware mark swap */
.eh-brand .mark-light, .foot-brand .mark-light { display: none; }
[data-theme="dark"] .eh-brand .mark-dark,
[data-theme="dark"] .foot-brand .mark-dark { display: none; }
[data-theme="dark"] .eh-brand .mark-light,
[data-theme="dark"] .foot-brand .mark-light { display: inline-block; }

/* ============ buttons — brushed metal ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 500; font-size: 14px;
  height: 38px; padding: 0 18px; border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: all 180ms var(--ease-standard);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, #2a3046 0%, #0f1322 100%);
  color: #fff;
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(0,0,0,0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 6px 16px -6px rgba(0,0,0,0.35); }
[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #fff6e8 0%, #e6d1a0 100%);
  color: var(--ink-900);
  border-color: rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.4);
}
.btn-secondary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #fff 6%) 0%, var(--bg) 100%);
  color: var(--fg-strong);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
[data-theme="dark"] .btn-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 8px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg-strong); font-size: 15px; font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--fg-strong);
  padding-bottom: 2px;
  transition: gap 180ms var(--ease-standard), opacity 180ms var(--ease-standard);
}
.link-arrow:hover { gap: 10px; opacity: 0.7; text-decoration: none; }
.link-arrow svg { width: 12px; height: 12px; }

/* ============ entry-head — section mark ============ */
.entry-head {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-subtle);
  padding: 80px 0 36px;
}
.entry-num { color: var(--fg-strong); }
.entry-tag { color: var(--fg-subtle); }
.entry-rule { flex: 1; height: 1px; background: var(--border); }

/* ============ HERO — single column, stacked ============ */
.hero { padding: 96px 0 140px; }
.hero-stack {
  display: flex; flex-direction: column;
  align-items: flex-start;
  max-width: 920px;
}
.hero-wordmark {
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 40px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 2px rgba(10,14,26,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .hero-wordmark {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(0,0,0,0.3);
}
.hero-mark { width: 22px; height: 22px; display: block; }
.hero-wordmark-name {
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg-strong);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 500;
  letter-spacing: -0.028em;
  line-height: 1.0;
  margin: 0 0 32px;
  color: var(--fg-strong);
  text-wrap: balance;
}

.hero p.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 48ch;
  margin: 0;
  text-wrap: pretty;
  letter-spacing: -0.005em;
}

/* ============ sections ============ */
.section { padding: 16px 0 40px; }

/* ============ WORK — Era entry ============ */
.work-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; gap: 48px; } }

.work-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 72px);
  font-weight: 500;
  letter-spacing: -0.028em;
  line-height: 1;
  margin: 0 0 18px;
  color: var(--fg-strong);
}

.work-copy .dek {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--fg);
  margin: 0 0 24px;
  max-width: 24ch;
  letter-spacing: -0.012em;
}
.work-copy .prose {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 50ch;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.work-art { display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.era-card {
  width: 200px; height: 200px;
  padding: 10px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.96) 0%, rgba(230, 209, 160, 0.74) 100%);
  position: relative;
  box-shadow:
    0 30px 60px -20px rgba(76, 48, 20, 0.34),
    0 6px 14px -4px rgba(76, 48, 20, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.72);
  border: 1px solid rgba(130, 94, 44, 0.18);
}
.era-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 20px;
  box-shadow: 0 12px 22px -16px rgba(76, 48, 20, 0.42);
}
/* Glass shine across the card */
.era-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 35%, rgba(0,0,0,0.10) 100%);
}

.era-meta {
  width: 100%; max-width: 360px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 0;
  margin: 0;
}
.era-meta .meta-row {
  display: grid; grid-template-columns: 80px 1fr;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px;
}
.era-meta .meta-row:last-child { border-bottom: none; }
.era-meta dt { color: var(--fg-subtle); letter-spacing: 0.16em; text-transform: uppercase; margin: 0; }
.era-meta dd { color: var(--fg-strong); margin: 0; display: inline-flex; align-items: center; gap: 8px; }

/* ============ footer ============ */
.foot { padding: 64px 0 32px; }
.foot-rule { height: 1px; background: var(--border); margin-bottom: 40px; }
.foot-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
@media (max-width: 720px) { .foot-inner { grid-template-columns: 1fr; gap: 32px; } }
.foot-brand { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.foot-brand img { width: 20px; height: 20px; }
.foot-brand p {
  font-size: 13px;
  color: var(--fg-muted); margin: 0; line-height: 1.5;
}
.foot-col h5 {
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-subtle); margin: 0 0 14px;
}
.foot-col a {
  display: block; color: var(--fg); font-size: 13px;
  padding: 4px 0; text-decoration: none;
  font-family: var(--font-mono);
}
.foot-col a:hover { color: var(--fg-strong); text-decoration: underline; text-underline-offset: 3px; }

.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 48px; padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
}
@media (max-width: 720px) { .foot-bottom { flex-direction: column; gap: 8px; align-items: flex-start; } }

/* ============ theme toggle — brushed-metal pill ============ */
.toggle {
  height: 32px; width: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #fff 6%) 0%, var(--bg) 100%);
  border: 1px solid var(--border-strong); color: var(--fg);
  cursor: pointer; padding: 0;
  transition: all 180ms var(--ease-standard);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
[data-theme="dark"] .toggle { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.toggle:hover { background: var(--bg-subtle); }
.toggle svg { width: 14px; height: 14px; }
.toggle .icon-sun { display: none; }
[data-theme="dark"] .toggle .icon-sun { display: inline; }
[data-theme="dark"] .toggle .icon-moon { display: none; }
