/* =============================================================
   THE EPSILON MAN — Design System
   "Calm strength without performance."
   Fluid-dynamics as restraint: slow gold flow over deep navy.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600;700&display=swap');

/* ---- TOKENS ------------------------------------------------ */
:root {
  /* Core brand */
  --black:      #121618;
  --navy:       #1B2533;
  --graphite:   #303941;
  --slate:      #434C53;
  --brass:      #947D54;
  --brass-lt:   #b09562;
  --burnished:  #887A56;
  --rust:       #7D6161;
  --driftwood:  #D0C3B9;
  --ash:        #ECE8E4;
  --neutral:    #EEE7E2;
  --darkslate:  #202428;
  --contemp:    #39475C;
  --contemp-lt: #7B9AC5;

  /* Surfaces */
  --surface-0: #0d1113;   /* deepest */
  --surface-1: #14191c;
  --surface-2: #1B2533;
  --surface-3: #222c38;
  --line:      rgba(148,125,84,.18);
  --line-soft: rgba(208,195,185,.08);

  /* Typography */
  --f-display: 'Cinzel', serif;
  --f-serif:   'EB Garamond', serif;
  --f-sans:    'Inter', sans-serif;

  /* Scale (fluid) */
  --step--1: clamp(.82rem, .78rem + .2vw, .9rem);
  --step-0:  clamp(1rem, .95rem + .25vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + .5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(1.9rem, 1.5rem + 2vw, 2.9rem);
  --step-4:  clamp(2.4rem, 1.8rem + 3.5vw, 4.6rem);

  /* Spacing / rhythm */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --radius: 10px;
  --radius-lg: 16px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .6s;

  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--black);
  color: var(--ash);
  font-family: var(--f-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--brass); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brass-lt); }
img { max-width: 100%; display: block; }
::selection { background: var(--brass); color: var(--black); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- GLOBAL FLOW-FIELD CANVAS ----------------------------- */
#flow-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}
body > *:not(#flow-field) { position: relative; z-index: 1; }

/* ---- NAV --------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding-inline: var(--gutter);
  background: rgba(19,25,34,.72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 600;
  letter-spacing: .18em; color: var(--brass); text-transform: uppercase;
  display: flex; align-items: center; gap: .5rem;
}
.nav-brand .eps { font-size: 1.3rem; line-height: 1; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--ash); font-size: var(--step--1); letter-spacing: .08em;
  position: relative; padding: .25rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--brass); transition: width .3s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brass); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 8px; color: var(--ash);
}
.nav-toggle span { display: block; height: 2px; background: currentColor; margin: 5px 0; transition: .3s var(--ease); }

/* ---- BUTTONS ----------------------------------------------- */
.btn {
  --bg: var(--brass);
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--bg); color: var(--black);
  font-family: var(--f-sans); font-weight: 600; font-size: var(--step--1);
  letter-spacing: .06em; text-transform: uppercase;
  padding: .9rem 2rem; border-radius: 6px; border: 2px solid var(--bg);
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  will-change: transform;
}
.btn:hover { background: var(--brass-lt); border-color: var(--brass-lt); color: var(--black); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(148,125,84,.6); }
.btn-outline { background: transparent; color: var(--brass); }
.btn-outline:hover { background: var(--brass); color: var(--black); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---- HERO -------------------------------------------------- */
.hero {
  min-height: 92vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6rem var(--gutter) 4rem; position: relative; overflow: hidden;
}
.hero::before {
  content: "\395"; position: absolute; inset: 0; margin: auto;
  font-family: var(--f-display); font-size: clamp(220px, 44vw, 560px);
  color: var(--graphite); opacity: .1; user-select: none;
  display: flex; align-items: center; justify-content: center; z-index: -1;
}
.hero-inner { max-width: 780px; }
.eyebrow {
  font-size: var(--step--1); letter-spacing: .28em; color: var(--brass);
  text-transform: uppercase; margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: var(--step-4); letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.08; color: var(--ash); margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--brass); }
.hero .lede {
  font-family: var(--f-serif); font-size: var(--step-1); color: var(--driftwood);
  max-width: 560px; margin: 0 auto 2.75rem;
}

/* ---- SECTIONS ---------------------------------------------- */
section { padding-block: var(--section-y); position: relative; }
.section-dark  { background: var(--black); }
.section-navy  { background: linear-gradient(180deg, var(--navy), var(--surface-1)); }
.section-mid   { background: var(--darkslate); }
.section-grad  { background: linear-gradient(160deg, var(--navy) 0%, var(--black) 75%); }

.section-label {
  font-size: var(--step--1); letter-spacing: .25em; text-transform: uppercase;
  color: var(--brass); margin-bottom: .9rem; display: block;
}
.section-title {
  font-family: var(--f-display); font-weight: 600;
  font-size: var(--step-3); color: var(--ash); letter-spacing: .05em; line-height: 1.15;
  margin-bottom: 1.25rem; max-width: 20ch;
}
.section-sub {
  font-family: var(--f-serif); font-size: var(--step-1); color: var(--driftwood);
  max-width: 60ch; margin-bottom: 3rem;
}
.center { text-align: center; }
.center .section-title, .center .section-sub { margin-inline: auto; }
.divider { width: 52px; height: 2px; background: var(--brass); margin: 1.25rem 0; }
.center .divider { margin-inline: auto; }

/* ---- CARDS / GRIDS ---------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 2rem; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brass); opacity: .9; transition: width .3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: 0 24px 50px -30px rgba(0,0,0,.8); }
.card:hover::before { width: 5px; }
.card.rust::before { background: var(--rust); }
.card.contemp::before { background: var(--contemp-lt); }
.card h3 {
  font-family: var(--f-display); font-size: 1.02rem; font-weight: 600;
  letter-spacing: .1em; color: var(--brass); text-transform: uppercase; margin-bottom: .85rem;
}
.card.rust h3 { color: var(--rust); }
.card.contemp h3 { color: var(--contemp-lt); }
.card p { color: var(--driftwood); font-size: var(--step-0); line-height: 1.7; }

/* ---- FEATURE / BLACKJACK BLOCK ---------------------------- */
.feature {
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.75rem); display: flex; gap: 2rem; align-items: flex-start;
}
.feature .icon { font-size: 2.75rem; line-height: 1; flex-shrink: 0; color: var(--brass); opacity: .8; }
.feature h3 { font-family: var(--f-display); font-size: 1.15rem; letter-spacing: .06em; color: var(--brass); margin-bottom: .75rem; }
.feature p { color: var(--driftwood); line-height: 1.8; }

/* ---- BOOK CARDS ------------------------------------------- */
.book-card { padding: 1.75rem 1.5rem; }
.book-num {
  font-family: var(--f-display); font-size: .72rem; letter-spacing: .22em;
  color: var(--brass); text-transform: uppercase; margin-bottom: .5rem;
}
.book-card h3 { font-family: var(--f-serif); font-weight: 600; font-size: 1.3rem; color: var(--ash); text-transform: none; letter-spacing: 0; margin-bottom: .5rem; }
.book-card .tagline { font-size: var(--step--1); color: var(--driftwood); font-style: italic; }

.book-full { margin-bottom: 1.5rem; }
.book-full h3 { font-family: var(--f-serif); font-weight: 600; font-size: 1.55rem; color: var(--ash); text-transform: none; letter-spacing: 0; margin-bottom: .4rem; }
.book-full .sub { font-style: italic; margin-bottom: .85rem; color: var(--brass); }
.book-full p.body { color: var(--driftwood); line-height: 1.8; }
.book-full p.body em { color: var(--ash); }

/* ---- COMMITMENTS ------------------------------------------ */
.commit-list { list-style: none; display: grid; gap: .7rem; }
.commit-list li {
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2));
  border-left: 3px solid var(--brass); padding: 1rem 1.35rem; border-radius: 0 6px 6px 0;
  font-family: var(--f-serif); font-size: 1.12rem; color: var(--ash);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.commit-list li:hover { transform: translateX(6px); }
.commit-list li .num { font-family: var(--f-display); font-size: .7rem; color: var(--brass); letter-spacing: .15em; display: block; margin-bottom: .25rem; text-transform: uppercase; }

/* ---- CREED ------------------------------------------------- */
.creed {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-0));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 3.5rem); max-width: 720px; margin: 0 auto; text-align: center;
  position: relative; overflow: hidden;
}
.creed::after {
  content: "\395"; position: absolute; right: -2rem; bottom: -4rem;
  font-family: var(--f-display); font-size: 16rem; color: var(--brass); opacity: .04;
}
.creed .creed-title { font-family: var(--f-display); font-size: .85rem; letter-spacing: .25em; color: var(--brass); text-transform: uppercase; margin-bottom: 1.5rem; }
.creed p { font-family: var(--f-serif); font-size: 1.3rem; font-style: italic; color: var(--driftwood); line-height: 2; }
.creed p strong { color: var(--ash); }

/* ---- STAT BARS -------------------------------------------- */
.stat-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.stat-label { width: 220px; font-size: var(--step--1); color: var(--driftwood); flex-shrink: 0; }
.stat-track { flex: 1; height: 6px; background: var(--graphite); border-radius: 3px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brass), var(--brass-lt)); width: 0; transition: width 1.4s var(--ease-out); }

/* ---- TABLE ------------------------------------------------- */
.eco-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.eco-table th {
  font-family: var(--f-display); font-size: .78rem; letter-spacing: .12em; color: var(--brass);
  text-transform: uppercase; text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line);
}
.eco-table td { padding: .9rem 1rem; font-size: var(--step-0); color: var(--driftwood); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.eco-table tr:last-child td { border-bottom: 0; }
.eco-table td strong { color: var(--ash); }
.table-scroll { overflow-x: auto; }

/* ---- PROSE ------------------------------------------------- */
.prose p { font-family: var(--f-serif); font-size: 1.15rem; color: var(--driftwood); line-height: 1.9; margin-bottom: 1.3rem; }
.prose p strong { color: var(--ash); font-style: normal; }
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: start; }

/* ---- PAGE HERO (inner) ------------------------------------ */
.page-hero { padding: clamp(5rem, 12vw, 8rem) var(--gutter) clamp(3rem, 7vw, 5rem); text-align: center; position: relative; overflow: hidden; }
.page-hero h1 { font-family: var(--f-display); font-weight: 700; font-size: var(--step-3); letter-spacing: .08em; color: var(--ash); text-transform: uppercase; margin-bottom: 1rem; }
.page-hero p { font-family: var(--f-serif); font-size: var(--step-1); color: var(--driftwood); max-width: 60ch; margin: 0 auto; }

/* ---- FORM -------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.form { max-width: 560px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin-bottom: .5rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--graphite); border-radius: 6px;
  color: var(--ash); font-family: var(--f-sans); font-size: var(--step-0); padding: .8rem 1rem; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(148,125,84,.15); }
.form-group textarea { resize: vertical; min-height: 130px; }

/* ---- FOOTER ------------------------------------------------ */
footer { background: linear-gradient(180deg, var(--surface-1), var(--surface-0)); border-top: 1px solid var(--line); padding: 3.5rem var(--gutter) 2.5rem; text-align: center; }
footer .footer-brand { font-family: var(--f-display); font-size: 1.2rem; letter-spacing: .2em; color: var(--brass); text-transform: uppercase; margin-bottom: .5rem; }
footer .tagline-sm { font-size: var(--step--1); color: var(--driftwood); margin-bottom: 1.75rem; }
footer .footer-links { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
footer .footer-links a { font-size: var(--step--1); color: var(--driftwood); }
footer .footer-links a:hover { color: var(--brass); }
footer .copy { font-size: .75rem; color: var(--slate); }

/* ---- SCROLL REVEAL ---------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

/* ---- RESPONSIVE ------------------------------------------- */
@media (max-width: 860px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(19,25,34,.97); backdrop-filter: blur(14px);
    padding: 1rem var(--gutter); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform .35s var(--ease); z-index: 99;
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: .9rem 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
  .feature { flex-direction: column; }
  .stat-label { width: 130px; }
}
