/* Primwright premium design system — ported from the Oct 2, 2026 premium
 * production deploy (6ac053c08f35b18534992f77). Design tokens below are
 * taken from that deploy's stylesheets; class hooks match the reconstruction
 * template system. Content is unchanged — this file is visual only.
 *
 * Tokens (source: old deploy CSS variables):
 *   --ev-ivory:      #FAF7F0  (page background)
 *   --ev-paper:      #FFFFFF  (cards / surfaces)
 *   --ev-ink:        #1E1C18  (body text)
 *   --ev-teal:       #175C5A  (Heritage Teal — primary)
 *   --ev-teal-deep:  #0F4442  (deep teal — hover, emphasis)
 *   --ev-teal-tint:  #E8F0EE  (pale teal tint)
 *   --ev-line:       #E4DCCB  (hairlines)
 *   --ev-line-strong:#CFC5AE  (card borders)
 *   --ev-muted:      #6E675C  (secondary text)
 * Type: Sora (display), Inter (body), "Fraunces",Georgia,serif (editorial
 * serif — renders as Georgia, as in the source deploy which never loaded
 * Fraunces), IBM Plex Mono (kickers / labels).
 */

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

:root {
  --ev-ivory: #FAF7F0;
  --ev-paper: #FFFFFF;
  --ev-ink: #1E1C18;
  --ev-teal: #175C5A;
  --ev-teal-deep: #0F4442;
  --ev-teal-tint: #E8F0EE;
  --ev-line: #E4DCCB;
  --ev-line-strong: #CFC5AE;
  --ev-muted: #6E675C;
  --ev-blue: #175C5A;
  --ev-ink-mute: #6B6459;
  --ev-ivory-deep: #F3EEE3;
  --ev-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ev-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
  --ev-max: 1200px;
  --ev-space-sm: 16px;
  --ev-space-md: 24px;
  --ev-space-lg: 48px;
  --ev-ink-soft: #4A463D;
  --ev-fast: 180ms;
  --ev-med: 320ms;
  --ev-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: 20px;
  --content-max: 76rem;
}

@media (min-width: 640px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 48px; } }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ev-ivory);
  color: var(--ev-ink);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typography ---------- */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ev-ink);
  text-wrap: balance;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 0.5em;
}
h1 em, h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--ev-teal-deep);
}
p { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--ev-teal); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ev-teal-deep); }

img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

ul, ol { padding-left: 1.4em; margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }
li::marker { color: var(--ev-teal); }

blockquote {
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 1.25em;
  border-left: 2px solid var(--ev-teal);
  color: var(--ev-ink);
  font-family: var(--font-serif);
  font-size: 1.15em;
}

hr { border: 0; border-top: 1px solid var(--ev-line); margin: 2.5em 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 1.25em; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.95em; }
th, td { text-align: left; padding: 0.65em 0.9em; border-bottom: 1px solid var(--ev-line); }
th {
  font-family: var(--font-mono);
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ev-muted);
  border-bottom: 1px solid var(--ev-line-strong);
}

/* ---------- Skip link & focus ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ev-teal-deep); color: #fff;
  padding: 0.6em 1em; z-index: 100; border-radius: 0 0 8px 0;
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--ev-teal); outline-offset: 2px; border-radius: 2px; }

/* ---------- Header / nav ----------
 * Ported from the Oct 2, 2026 premium reference deploy (6ac053c08f35b18534992f77).
 * Reference selectors were scoped as `.ev <rule>` under a wrapper div; the scope
 * is dropped here (unique class names, no conflicts). Breakpoint 769px and all
 * values are byte-faithful to the reference. The burger toggle behavior is
 * re-implemented in src/static/js/menu.js (reference JS was Next.js client
 * chunks; observable behavior — aria-expanded + .open — is replicated).
 */
.ev-header {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 240, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ev-line);
}
.ev-header-in {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: var(--ev-space-sm);
  max-width: var(--ev-max); margin: 0 auto; padding: 0 var(--gutter);
}
.ev-brand, .ev-brand-chip { display: inline-flex; align-items: center; }
.ev-brand { text-decoration: none; flex-shrink: 0; }
.ev-brand-chip {
  background: var(--ev-ink); border-radius: 10px; padding: 8px 14px;
  transition: background var(--ev-fast) var(--ev-ease);
}
.ev-brand:hover .ev-brand-chip { background: var(--ev-teal-deep); }
.ev-brand-chip img { height: 20px; width: auto; display: block; }
.ev-nav-desktop { display: none; align-items: center; gap: 32px; }
.ev-nav-desktop a {
  font-size: 16px; font-weight: 500; color: var(--ev-ink); text-decoration: none;
  padding: 12px 4px; position: relative; min-height: 44px;
  display: inline-flex; align-items: center;
}
.ev-nav-desktop a::after {
  content: ""; position: absolute; bottom: 8px; left: 4px; right: 4px; height: 2px;
  background: var(--ev-blue); transform: scaleX(0); transform-origin: left;
  transition: transform var(--ev-fast) var(--ev-ease);
}
.ev-nav-desktop a:hover::after { transform: scaleX(1); }
@media (min-width: 769px) { .ev-nav-desktop { display: flex; } }
.ev-burger {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  width: 48px; height: 48px; background: none;
  border: 1px solid var(--ev-line-strong); border-radius: 10px;
  cursor: pointer; padding: 12px;
}
.ev-burger span {
  display: block; height: 2px; background: var(--ev-ink); border-radius: 1px;
  transition: transform var(--ev-fast) var(--ev-ease), opacity var(--ev-fast) var(--ev-ease);
}
.ev-burger[aria-expanded="true"] span:first-child { transform: translateY(8px) rotate(45deg); }
.ev-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ev-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
@media (min-width: 769px) { .ev-burger { display: none; } }
.ev-menu {
  display: none; position: fixed; top: 72px; left: 0; right: 0;
  height: calc(100dvh - 72px); border-top: 1px solid var(--ev-line);
  background: var(--ev-ivory); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 20px: the reference's --ev-gutter value throughout the menu's visible
   * range (<769px); the local --gutter grows at 640px, which would diverge. */
  padding: 4px calc(20px + env(safe-area-inset-right)) calc(var(--ev-space-sm) + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
}
.ev-menu.open { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .ev-menu.open { animation: ev-menu-drop .26s cubic-bezier(.22, 1, .36, 1); }
}
@keyframes ev-menu-drop { 0% { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ev-menu ul { list-style: none; margin: 0; padding: 0; }
.ev-menu li { border-bottom: none; }
.ev-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 10px 4px; border-radius: 8px;
  font-family: var(--ev-sans); font-size: 15.5px; font-weight: 550;
  color: var(--ev-ink); text-decoration: none;
  transition: background var(--ev-fast) var(--ev-ease), color var(--ev-fast) var(--ev-ease);
}
.ev-menu a:hover { background: var(--ev-ivory-deep); color: var(--ev-blue); }
.ev-menu a:active { background: var(--ev-line); }
.ev-menu a:focus-visible { outline: 2px solid var(--ev-blue); outline-offset: 2px; }
.ev-mgroup { padding: 12px 0 14px; }
.ev-mgroup + .ev-mgroup { border-top: 1px solid var(--ev-line); }
.ev-mlabel {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ev-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ev-ink-mute);
  margin: 0 0 4px; padding: 0 4px;
}
.ev-mlabel::before {
  content: ""; width: 14px; height: 2px; border-radius: 1px;
  background: var(--ev-teal); flex: none;
}
.ev-mpilot a {
  margin-top: 6px; padding-left: 12px; padding-right: 12px;
  background: var(--ev-teal-tint); color: var(--ev-teal-deep); font-weight: 650;
}
.ev-mpilot a:hover { background: #dce9e6; color: var(--ev-teal-deep); }
.ev-marrow { color: var(--ev-teal); font-weight: 700; }
/* Account entry: visually distinct account action, same highlighted-row
 * language as the pilot CTA (existing tokens only). */
.ev-maccount a {
  margin-top: 6px; padding-left: 12px; padding-right: 12px;
  background: var(--ev-teal-tint); color: var(--ev-teal-deep); font-weight: 650;
}
.ev-maccount a:hover { background: #dce9e6; color: var(--ev-teal-deep); }
.ev-mfoot {
  border-top: 1px solid var(--ev-line); margin: 2px 0 0; padding: 14px 4px 4px;
  font-family: var(--ev-sans); font-size: 12.5px; color: var(--ev-ink-mute);
}
/* Preview-variant disabled checkout CTA (verified commerce posture: no real
 * money). Kept from the prior nav; styled to sit in the new desktop row. */
.nav-cta {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  color: var(--ev-ink-mute); background: var(--ev-ivory-deep);
  border: 1px solid var(--ev-line-strong); border-radius: 999px;
  padding: 0.6em 1.1em; cursor: not-allowed; white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  max-width: 60rem;
}
.hero-kicker {
  display: flex; align-items: center; gap: 0.75em;
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ev-teal);
  margin: 0 0 1.5rem;
}
.hero-kicker::before {
  content: ""; width: 2rem; height: 2px; background: var(--ev-teal);
}
.hero h1 {
  font-size: clamp(2.75rem, 11vw, 5.5rem);
  line-height: 1.04;
  margin: 0 0 1.5rem;
  max-width: 14em;
}
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--ev-ink);
  max-width: 44em;
}
.hero-sub strong { font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* ---------- Discipline doors (homepage) ----------
 * Ported from the Sep 29, 2026 "approved premium refinement" deploy
 * (6abc86f83b91e32fd3acd7e7) — the exact code behind the founder's mobile
 * acceptance screenshot. Reference selectors were `.ev <rule>`; scope dropped
 * (unique names). Breakpoint 769px and values byte-faithful. The card h2 has
 * no rule in the reference, so it renders as browser-default bold sans; that
 * rendering is pinned explicitly here because this port's global h2 is serif.
 */
.ev-disciplines {
  display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--ev-line-strong); border-radius: 4px; overflow: hidden;
  margin-top: var(--ev-space-lg); background: var(--ev-paper);
}
@media (min-width: 769px) { .ev-disciplines { grid-template-columns: 1fr 1fr; } }
.ev-discipline {
  display: block; padding: var(--ev-space-lg) var(--ev-space-md);
  text-decoration: none; color: inherit; position: relative;
  transition: background var(--ev-fast);
}
.ev-discipline:first-child { border-bottom: 1px solid var(--ev-line); }
@media (min-width: 769px) {
  .ev-discipline:first-child { border-bottom: none; border-right: 1px solid var(--ev-line); }
}
.ev-discipline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px;
  background: var(--ev-blue); transform: scaleY(0); transform-origin: top;
  transition: transform var(--ev-med) var(--ev-ease);
}
.ev-discipline.enterprise::before { background: var(--ev-teal); }
.ev-discipline:hover::before, .ev-discipline:focus-visible::before { transform: scaleY(1); }
.ev-discipline:hover { background: var(--ev-ivory); }
.ev-discipline-num {
  font-family: var(--ev-mono); font-size: 13px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ev-teal);
  display: block; margin-bottom: var(--ev-space-sm);
}
/* Pinned to the reference's observed rendering: the reference markup uses h2,
 * and its only card-heading rule targets h3 (dead for this markup), so the h2
 * renders via the reference's global h1,h2,h3 rule (Sora/display, bold). */
.ev-discipline h2 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  line-height: 1.1; letter-spacing: -.015em; color: var(--ev-ink);
  margin: 0 0 .5em;
}
.ev-discipline p {
  font-size: 16.5px; line-height: 1.65; color: var(--ev-ink-soft);
  margin: 0 0 var(--ev-space-md); max-width: 30em;
}
.ev-discipline-link {
  font-weight: 600; font-size: 17px; color: var(--ev-blue);
  display: inline-flex; align-items: center; gap: 8px;
}
.ev-discipline-link .arrow { transition: transform var(--ev-fast) var(--ev-ease); }
.ev-discipline:hover .ev-discipline-link .arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .ev-discipline, .ev-discipline::before, .ev-discipline-link .arrow { transition: none !important; }
}
@media (max-width: 420px) {
  .ev-discipline { padding: 24px 20px; }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  background: var(--ev-teal); color: #fff;
  padding: 0.85em 1.75em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--ev-teal);
  transition: background 0.15s ease;
}
.button:hover { background: var(--ev-teal-deep); border-color: var(--ev-teal-deep); color: #fff; }
.button-ghost {
  background: transparent; color: var(--ev-teal-deep);
  border: 1px solid var(--ev-line-strong);
}
.button-ghost:hover { background: var(--ev-teal-tint); border-color: var(--ev-teal); color: var(--ev-teal-deep); }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
  padding: 1rem 0 3rem;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
.card-grid-label {
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ev-teal);
  margin: 2.5rem 0 1.25rem;
}
.card {
  background: var(--ev-paper);
  border: 1px solid var(--ev-line-strong);
  border-radius: 10px;
  padding: clamp(1.75rem, 4vw, 2.75rem);
}
.card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.6em;
}
.card p { color: var(--ev-ink); }
.card a { font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.card a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; max-width: 56rem; }
.breadcrumbs, .page-hero nav {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ev-muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a, .page-hero nav a { color: var(--ev-teal); text-decoration: none; }
.breadcrumbs a:hover, .page-hero nav a:hover { text-decoration: underline; }
.page-hero h1 { font-size: clamp(2.25rem, 7vw, 4rem); margin-bottom: 1rem; }
.page-hero > p { font-size: 1.15rem; max-width: 42em; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ev-teal-deep);
  color: var(--ev-ivory);
  border-radius: 12px;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.75rem, 5vw, 3.5rem);
  margin: 3rem 0;
  text-align: left;
}
.cta-band h2 { color: #fff; margin-bottom: 0.5em; }
.cta-band p { color: var(--ev-teal-tint); max-width: 40em; }
.cta-band .button { background: #fff; border-color: #fff; color: var(--ev-teal-deep); }
.cta-band .button:hover { background: var(--ev-teal-tint); border-color: var(--ev-teal-tint); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--ev-line-strong);
  margin-top: 4rem;
  background: var(--ev-ivory);
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ev-teal) 22%, var(--ev-teal) 78%, transparent);
}
.site-footer > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.footer-brand { padding-top: 2.5rem; margin-bottom: 2rem; }
.footer-cols {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(2, 1fr);
  padding-bottom: 2.5rem;
}
@media (min-width: 1024px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ev-muted);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.6em;
}
.footer-col h2::before { content: ""; width: 1rem; height: 2px; background: var(--ev-teal); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.55em; }
.footer-col a { color: var(--ev-ink); text-decoration: none; font-size: 0.95rem; }
.footer-col a:hover { color: var(--ev-teal-deep); text-decoration: underline; text-underline-offset: 3px; }
.footer-note {
  border-top: 1px solid var(--ev-line);
  padding-top: 1.5rem; padding-bottom: 2rem;
  font-size: 0.85rem; color: var(--ev-muted);
  margin-bottom: 0;
}
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0 0 2rem; }

/* ---------- Legal / misc ---------- */
.legal-notice {
  background: var(--ev-teal-tint);
  border: 1px solid var(--ev-line);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
}
.pending {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ev-teal-deep); background: var(--ev-teal-tint);
  padding: 0.3em 0.8em; border-radius: 999px;
}

/* ---------- Reader (protected) ---------- */
.reader { background: var(--ev-paper); border: 1px solid var(--ev-line-strong); border-radius: 10px; }
.reader-kicker {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ev-teal);
}
.reader-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.reader-page { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.75; }
.reader-watermark { color: var(--ev-line-strong); }
.reader-indicator, .reader-mapping, .reader-strip { font-size: 0.9rem; color: var(--ev-muted); }
.reader-pagewrap { padding: clamp(1.5rem, 4vw, 3rem); }
.reader-pending { color: var(--ev-muted); font-style: italic; }

/* ---------- Content sections rhythm ---------- */
main h2 { margin-top: 2.75rem; }
main h2:first-child { margin-top: 0; }
main section { margin-bottom: 1rem; }
main img { margin: 1.75rem 0; border: 1px solid var(--ev-line); }
