/* ==========================================================================
   Enso Crux — Homepage hi-fi styles
   Dark/light alternating sections, atmospheric effects, card grid,
   methodology radial, reveal animation. Supplements base style.css.
   ========================================================================== */

/* Smooth scroll & anchor offset */
html { scroll-behavior: smooth; }
section { scroll-margin-top: 80px; }

/* ---------- Dark theme tokens ---------- */
[data-theme="dark"] {
  --bg: var(--ink);
  --bg-elevated: #221F1A;
  --bg-recessed: #100E0C;
  --fg-1: var(--washi);
  --fg-2: rgba(242, 235, 220, 0.72);
  --fg-3: rgba(242, 235, 220, 0.55);
  --fg-4: rgba(242, 235, 220, 0.40);
  --rule: rgba(242, 235, 220, 0.10);
  --rule-strong: rgba(242, 235, 220, 0.22);
  --accent: var(--oxblood-soft);
  --accent-deep: var(--oxblood);
  color: var(--fg-1);
  background: var(--bg);
}
[data-theme="dark"] ::selection { background: var(--washi); color: var(--ink); }
[data-theme="dark"] a { text-decoration-color: rgba(242, 235, 220, 0.25); }
[data-theme="dark"] a:hover { text-decoration-color: var(--fg-1); }

/* Light section (explicit for alternating context) */
.section-light {
  --bg: var(--washi);
  --bg-elevated: #EAE1CB;
  --bg-recessed: var(--washi-deep);
  --fg-1: var(--ink);
  --fg-2: rgba(26, 23, 20, 0.72);
  --fg-3: rgba(26, 23, 20, 0.55);
  --fg-4: rgba(26, 23, 20, 0.40);
  --rule: rgba(26, 23, 20, 0.12);
  --rule-strong: rgba(26, 23, 20, 0.28);
  --accent: var(--oxblood);
  --accent-deep: var(--oxblood-deep);
  color: var(--fg-1);
  background: var(--bg);
}

/* ---------- Container ---------- */
.hp-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Section padding */
.hp-sectionpad { padding: 144px 0; }

/* ---------- Display typography ---------- */
.h-hero {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-wrap: balance;
  color: var(--fg-1);
}
.h-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 5.6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.014em;
  text-wrap: balance;
  color: var(--fg-1);
}
.h-section {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(36px, 4.2vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.008em;
  text-wrap: balance;
  color: var(--fg-1);
}
.h-card {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.22;
  color: var(--fg-1);
}
.caps {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fg-2);
}

/* Eyebrow with leading rule */
.eyebrow-line {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.eyebrow-line::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--fg-3);
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  background: var(--accent-deep);
  color: var(--washi);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background var(--dur-3) var(--ease);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--washi);
  text-decoration: none;
}
.btn-primary .arr { transition: transform var(--dur-3) var(--ease); }
.btn-primary:hover .arr { transform: translateX(3px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: border-color var(--dur-3) var(--ease);
}
.btn-outline:hover {
  border-color: var(--fg-1);
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-1);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 4px;
  transition: border-color var(--dur-3) var(--ease);
}
.btn-ghost:hover {
  border-color: var(--fg-1);
  text-decoration: none;
}
.btn-ghost .arr { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal {
  transform: translateY(12px);
  transition: transform 700ms cubic-bezier(0.32, 0.08, 0.24, 1);
}
.reveal.in { transform: translateY(0); }

/* ---------- Ink backdrop ---------- */
.ink-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--washi);
}
.ink-field svg {
  width: 100%;
  height: 100%;
}

/* ---------- Hero ---------- */
.hp-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
  padding-bottom: 96px;
  overflow: hidden;
}
.corner-labels {
  position: absolute;
  bottom: 48px;
  left: 48px;
  right: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--rule-strong);
}
.card .media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.card .card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card .card-body .caps { margin-bottom: 12px; }
.card .card-body .h-card { margin-bottom: 12px; }
.card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 24px;
}

/* Image placeholder */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-recessed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  font-size: 13px;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  font-style: italic;
}

/* ---------- Methodology radial ---------- */
.radial { color: var(--fg-1); }
.radial svg { width: 100%; height: auto; overflow: visible; }

/* ---------- Feature sections ---------- */
.hp-feature-grid {
  display: grid;
  gap: 96px;
  align-items: center;
  padding: 144px 0;
}
.hp-feature-grid.img-left { grid-template-columns: 1.1fr 1fr; }
.hp-feature-grid.img-right { grid-template-columns: 1fr 1.1fr; }

.feature-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 88px;
  line-height: 1;
  color: var(--fg-4);
  margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.hp-footer {
  border-top: 1px solid var(--rule);
  padding: 96px 0 48px;
}
.hp-footer a {
  color: var(--fg-2);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  font-size: 14px;
  transition: color var(--dur-2) var(--ease);
}
.hp-footer a:hover { color: var(--fg-1); text-decoration: none; }
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 64px;
}
.foot-grid .col-head {
  margin-bottom: 20px;
  color: var(--fg-3);
}
.foot-legal {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--fg-3);
}
.foot-legal a {
  display: inline;
  color: var(--fg-3);
  font-size: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hp-wrap { padding: 0 24px; }
  .hp-hero { min-height: auto; padding: 64px 0; }
  .hp-sectionpad { padding: 96px 0; }
  .h-hero { font-size: clamp(40px, 8vw, 72px); }
  .h-display { font-size: clamp(32px, 5.6vw, 56px); }
  .card-grid { grid-template-columns: 1fr; }
  .hp-feature-grid,
  .hp-feature-grid.img-left,
  .hp-feature-grid.img-right { grid-template-columns: 1fr; gap: 48px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .corner-labels { display: none; }
  .feature-num { font-size: 56px; }
}

@media (max-width: 600px) {
  .foot-grid { grid-template-columns: 1fr; }
  .foot-legal { flex-direction: column; gap: 16px; align-items: flex-start; }
}
