/* ═══════════════════════════════════════════════════════════
   Psienced — brand stylesheet
   Palette and type inherited from the Psienced prototype:
   gold on maroon, near-black ground, IBM Plex.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --maroon:        #7B1045;
  --maroon-light:  #A3225F;
  --maroon-deep:   #4A0A29;
  --gold:          #F5C207;
  --gold-soft:     #FFD43B;

  /* Ground */
  --bg:            #0C0B0B;
  --surface:       #111010;
  --surface-2:     #171515;
  --divider:       #232020;
  --border:        #302C2C;

  /* Ink */
  --text:          #E8E4E0;
  --text-muted:    #9A938F;
  --text-faint:    #5E5856;
  --text-inverse:  #0C0B0B;

  /* Type */
  --font-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Metrics */
  --wrap:          1140px;
  --gutter:        clamp(20px, 5vw, 48px);
  --radius:        4px;
  --ease:          cubic-bezier(.22, .61, .36, 1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }

/* Even out ragged last lines on the headings that wrap freely. The home
   hero is excluded — it sets its own line breaks. */
.page-hero h1,
.section-head h2,
.contact-inner h2,
.holding h2,
.product-name { text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--gold); color: var(--text-inverse); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--text-inverse);
  padding: 10px 18px; font-family: var(--font-mono); font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ── Logos ──────────────────────────────────────────────────
   The supplied artwork is used as-is and never redrawn. The
   files in assets/ are trimmed and unmatted by build-assets.py,
   so they only ever need a height here.
   ────────────────────────────────────────────────────────── */
.logo { width: auto; }
.logo--header  { height: 30px; }
.logo--hero    { height: clamp(60px, 9vw, 108px); margin-bottom: clamp(26px, 4vw, 40px); }
.logo--contact { height: 50px; margin-inline: auto; margin-bottom: 28px; }
.logo--footer  { height: 26px; }
/* .card is a flex column, so the lockup needs to opt out of cross-axis
   stretch or it renders full-width and distorted. */
.logo--card    { height: 40px; margin-bottom: 24px; align-self: flex-start; }
.logo--page    { height: clamp(52px, 7.5vw, 86px); margin-bottom: 28px; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 11, 11, .72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--divider);
  background: rgba(12, 11, 11, .93);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 74px;
}
.brand { display: flex; align-items: center; flex: none; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav a {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em;
  color: var(--text-muted); padding: 6px 0; position: relative;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--gold); transition: right .3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { right: 0; background: var(--maroon-light); }

.nav a.nav-cta {
  color: var(--gold);
  border: 1px solid rgba(245, 194, 7, .35);
  border-radius: var(--radius); padding: 7px 16px;
}
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { background: rgba(245, 194, 7, .08); border-color: var(--gold); }

.nav-toggle {
  display: none; width: 40px; height: 40px; padding: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 17px; height: 1.5px; background: var(--text);
  transition: transform .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

/* ── Shared decoration ──────────────────────────────────── */
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 15%, transparent 78%);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 24px;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .03em;
  padding: 13px 26px; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--text-inverse); font-weight: 500; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--maroon-light); background: rgba(163, 34, 95, .12); }

/* ── Home hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(64px, 11vw, 128px) 0 clamp(76px, 13vw, 150px);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: -30% 30% 40% -25%;
  background: radial-gradient(closest-side, rgba(123, 16, 69, .38), transparent 72%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; right: -20%; top: 18%; width: 60%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(245, 194, 7, .07), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero h1 {
  font-size: clamp(2.3rem, 5.8vw, 4.1rem);
  line-height: 1.08; max-width: 24ch; margin-bottom: 28px;
}
.hero h1 em { font-style: normal; color: var(--gold); }

.lede {
  font-size: clamp(1.02rem, 1.55vw, 1.18rem);
  color: var(--text-muted); max-width: 58ch; margin-bottom: 42px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── Subpage hero ───────────────────────────────────────── */
.page-hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 8vw, 92px) 0 clamp(48px, 7vw, 76px);
  border-bottom: 1px solid var(--divider);
}
.page-hero::before {
  content: ''; position: absolute; inset: -40% 45% 30% -20%;
  background: radial-gradient(closest-side, rgba(123, 16, 69, .34), transparent 72%);
  pointer-events: none;
}
.page-hero-inner { position: relative; }
.page-hero h1 {
  font-size: clamp(1.95rem, 4.2vw, 3rem);
  margin-bottom: 22px; max-width: 20ch;
}
.page-hero p:not(.crumb) {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  max-width: 62ch;
}

.crumb {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 26px;
}
.crumb a { color: var(--text-muted); transition: color .2s var(--ease); }
.crumb a:hover { color: var(--gold); }
.crumb span { color: var(--maroon-light); }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: clamp(66px, 10vw, 118px) 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--divider); }

.section-head { max-width: 62ch; margin-bottom: clamp(40px, 5.5vw, 68px); }
.section-index {
  display: block; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .2em;
  color: var(--maroon-light); margin-bottom: 16px;
}
.section-head h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); margin-bottom: 18px; }
.section-sub { color: var(--text-muted); font-size: 1.02rem; }

/* ── Division cards ─────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 2.4vw, 30px);
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 6px; padding: clamp(28px, 3.4vw, 42px); overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease),
              background .3s var(--ease);
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--maroon), var(--gold));
  opacity: 0; transition: opacity .35s var(--ease);
}
.card:hover { border-color: var(--border); background: var(--surface-2); transform: translateY(-3px); }
.card:hover::before { opacity: 1; }

.card h3 { font-size: 1.36rem; margin-bottom: 14px; }
.card > p { color: var(--text-muted); margin-bottom: 24px; max-width: 46ch; }

.card-list { display: grid; gap: 10px; margin-bottom: 28px; }
.card-list li {
  font-family: var(--font-mono); font-size: 13px;
  padding-left: 20px; position: relative;
}
.card-list li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 7px; height: 1px; background: var(--gold);
}

.card-link {
  margin-top: auto; align-self: flex-start;
  font-family: var(--font-mono); font-size: 13px; color: var(--gold);
  display: inline-flex; align-items: center; gap: 8px;
}
.card-link .arrow { transition: transform .25s var(--ease); }
.card:hover .card-link .arrow, .card-link:hover .arrow { transform: translateX(4px); }

/* ── Featured product ───────────────────────────────────── */
.product {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.product-name {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  margin-bottom: 22px;
}
.product-kicker {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}
.product-body p { color: var(--text-muted); }
.product-body p + p { margin-top: 18px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px; margin-top: 26px;
}
.status-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex: none;
}

.product-cta { margin-top: 26px; }

.panel {
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 6px; padding: clamp(24px, 3vw, 34px);
}
.panel h3 {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--divider);
}
.panel-list { display: grid; gap: 18px; }
.panel-list li { display: grid; gap: 4px; }
.panel-list b {
  font-weight: 500; font-size: 15px;
  display: flex; align-items: baseline; gap: 10px;
}
.panel-list b::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--maroon-light); letter-spacing: .1em;
}
.panel-list { counter-reset: step; }
.panel-list li { counter-increment: step; }
.panel-list span { color: var(--text-muted); font-size: 14.5px; padding-left: 30px; }

/* ── Domains ────────────────────────────────────────────── */
.domains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(32px, 5vw, 72px);
}
.domain { border-top: 1px solid var(--border); padding-top: 26px; }
.domain h3 { margin-bottom: 16px; }
.domain-tag {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-inverse); background: var(--gold);
  padding: 5px 11px; border-radius: 2px; display: inline-block;
}
.domain > p { color: var(--text-muted); margin-bottom: 26px; max-width: 44ch; }

.spec { display: grid; gap: 12px; margin: 0; }
.spec > div {
  display: grid; grid-template-columns: 80px 1fr; gap: 16px;
  padding-top: 12px; border-top: 1px solid var(--divider);
}
.spec dt {
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint);
}
.spec dd { margin: 0; font-size: 14.5px; }

/* ── Principles ─────────────────────────────────────────── */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: clamp(26px, 3vw, 40px);
  counter-reset: p;
}
.principles li { counter-increment: p; }
.principles li::before {
  content: '0' counter(p); display: block;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  color: var(--maroon-light);
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.principles h3 { font-size: 1.12rem; margin-bottom: 10px; }
.principles p { color: var(--text-muted); font-size: 15.5px; }

/* ── Video embed ────────────────────────────────────────── */
.video {
  position: relative; aspect-ratio: 16 / 9;
  border: 1px solid var(--divider); border-radius: 6px;
  overflow: hidden; background: var(--surface);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption {
  margin-top: 16px; font-family: var(--font-mono);
  font-size: 12.5px; color: var(--text-faint);
}
.video-caption a { color: var(--text-muted); transition: color .2s var(--ease); }
.video-caption a:hover { color: var(--gold); }

/* ── People ─────────────────────────────────────────────── */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: clamp(20px, 2.4vw, 28px);
  margin-bottom: clamp(36px, 5vw, 56px);
}
.person {
  display: flex; gap: 22px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 6px; padding: clamp(24px, 3vw, 32px);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.person:hover { border-color: var(--border); background: var(--surface-2); }
.person-mark { height: 46px; width: auto; flex: none; margin-top: 3px; }
.person-name { font-size: 1.18rem; margin-bottom: 4px; }
.person-role {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.person-bio { color: var(--text-muted); font-size: 15px; margin-bottom: 16px; }
.person-links { display: flex; flex-wrap: wrap; gap: 16px; }
.person-links a {
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 7px;
  transition: color .2s var(--ease);
}
.person-links a:hover { color: var(--gold); }
.person-links a::after { content: '↗'; font-size: 11px; }

/* ── People placeholder ─────────────────────────────────── */
.holding {
  border: 1px dashed var(--border); border-radius: 6px;
  padding: clamp(40px, 7vw, 76px) clamp(24px, 5vw, 56px);
  text-align: center; background: var(--surface);
}
.holding .status-badge { margin: 0 0 24px; }
.holding h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 16px; }
.holding p { color: var(--text-muted); max-width: 46ch; margin-inline: auto; }
.holding p + p { margin-top: 20px; }

/* ── Contact ────────────────────────────────────────────── */
.section--contact {
  position: relative; text-align: center;
  background:
    radial-gradient(90% 130% at 50% 0%, rgba(123, 16, 69, .3), transparent 68%),
    var(--bg);
  border-top: 1px solid var(--divider);
}
.contact-inner { max-width: 660px; }
.contact-inner h2 { font-size: clamp(1.55rem, 3.2vw, 2.2rem); margin-bottom: 20px; }
.contact-inner > p { color: var(--text-muted); }
.contact-inner > p + p { margin-top: 32px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 52px 0 42px; background: var(--surface);
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center;
}
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; }
.footer-nav a {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  transition: color .2s var(--ease);
}
.footer-nav a:hover { color: var(--gold); }
.copyright { font-size: 12.5px; color: var(--text-faint); }

/* ── Reveal on scroll ───────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 74px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--divider);
    padding: 8px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 15px 0; border-bottom: 1px solid var(--divider); font-size: 15px; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { color: var(--gold); }
  .nav a.nav-cta {
    border: 0; border-bottom: 1px solid var(--divider);
    padding: 15px 0; border-radius: 0;
  }
  .nav a.nav-cta:hover { background: none; }
  .spec > div { grid-template-columns: 1fr; gap: 4px; }
}

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