/* TrustLedger — Hero v3
 * Theme-able. `:root` = LIGHT, `:root.dark` = DARK.
 * The chrome shader inverts via its uInvert uniform, set from JS.
 */

:root {
  /* page-level (used by placeholders + statusbar base) */
  --bg: #FFFFFF;
  --fg: #0A0A0A;
  --fg-secondary: #52525B;
  --fg-muted: #71717A;
  --fg-faint: #D4D4D8;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --ph-tag-bg: #FAFAFA;

  /* hero ─ colors that swap when theme flips */
  --hero-fg: #0A0A0A;
  --hero-fg-muted: rgba(10, 10, 10, 0.62);
  --hero-fg-faint: rgba(10, 10, 10, 0.45);
  --hero-cta-primary-bg: #0A0A0A;
  --hero-cta-primary-fg: #FFFFFF;
  --hero-cta-primary-hover-bg: #1A1A1A;
  --hero-cta-ghost-bg: rgba(255, 255, 255, 0.40);
  --hero-cta-ghost-border: rgba(10, 10, 10, 0.32);
  --hero-cta-ghost-hover-bg: rgba(0, 0, 0, 0.06);
  --hero-cta-ghost-hover-border: rgba(10, 10, 10, 0.70);
  --hero-vignette: rgba(255, 255, 255, 0.35);
  --hero-fade-rgb: 255, 255, 255;
  --hero-statusbar-bg: rgba(255, 255, 255, 0.55);
  --hero-statusbar-border: rgba(10, 10, 10, 0.08);
  --hero-statusbar-fg: rgba(10, 10, 10, 0.55);
  --hero-statusbar-sep: rgba(10, 10, 10, 0.20);
  --hero-statusbar-pip: #0A0A0A;
  --hero-scroll-label: rgba(10, 10, 10, 0.55);
  --hero-scroll-label-hover: rgba(10, 10, 10, 0.92);
  --hero-scroll-arrow: rgba(10, 10, 10, 0.75);
  --hero-scroll-line: rgba(10, 10, 10, 0.85);
  --hero-text-shadow: 0 1px 24px rgba(255, 255, 255, 0.45);

  --sans: "Geist", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root.dark {
  --bg: #0A0A0A;
  --fg: #FFFFFF;
  --fg-secondary: rgba(255, 255, 255, 0.72);
  --fg-muted: rgba(255, 255, 255, 0.50);
  --fg-faint: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ph-tag-bg: rgba(255, 255, 255, 0.04);

  --hero-fg: #FFFFFF;
  --hero-fg-muted: rgba(255, 255, 255, 0.62);
  --hero-fg-faint: rgba(255, 255, 255, 0.40);
  --hero-cta-primary-bg: #FFFFFF;
  --hero-cta-primary-fg: #0A0A0A;
  --hero-cta-primary-hover-bg: #F4F4F5;
  --hero-cta-ghost-bg: rgba(0, 0, 0, 0.18);
  --hero-cta-ghost-border: rgba(255, 255, 255, 0.42);
  --hero-cta-ghost-hover-bg: rgba(255, 255, 255, 0.12);
  --hero-cta-ghost-hover-border: rgba(255, 255, 255, 0.70);
  --hero-vignette: rgba(0, 0, 0, 0.35);
  --hero-fade-rgb: 10, 10, 10;
  --hero-statusbar-bg: rgba(10, 10, 10, 0.55);
  --hero-statusbar-border: rgba(255, 255, 255, 0.08);
  --hero-statusbar-fg: rgba(255, 255, 255, 0.50);
  --hero-statusbar-sep: rgba(255, 255, 255, 0.22);
  --hero-statusbar-pip: #FFFFFF;
  --hero-scroll-label: rgba(255, 255, 255, 0.55);
  --hero-scroll-label-hover: rgba(255, 255, 255, 0.92);
  --hero-scroll-arrow: rgba(255, 255, 255, 0.75);
  --hero-scroll-line: rgba(255, 255, 255, 0.85);
  --hero-text-shadow: 0 1px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02", "cv01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Smooth the bg color change for sections that don't ride the
     startViewTransition group (Safari/Firefox fallback). */
  transition: background-color 320ms ease, color 320ms ease;
}

html { scroll-behavior: smooth; }

/* ────────────────────────────────────────────────────────
   View Transition — animated theme reveal.
   The clip-path on ::view-transition-new(root) is set by JS via
   document.documentElement.animate(...). The pinned --vt-clip-from
   below prevents Firefox from painting the new theme unclipped between
   snapshot and JS animation start.
─────────────────────────────────────────────────────────*/
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

html[data-vt="active"]::view-transition-new(root) {
  clip-path: var(--vt-clip-from, circle(0%));
}

/* ────────────────────────────────────────────────────────
   Hero frame
─────────────────────────────────────────────────────────*/
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 640px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--hero-fg);
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(0,0,0,0) 0%, var(--hero-vignette) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(var(--hero-fade-rgb), 0) 0%,
    rgba(var(--hero-fade-rgb), 0.85) 70%,
    rgba(var(--hero-fade-rgb), 1) 100%
  );
}

.hero > *:not(.hero-bg) { position: relative; z-index: 2; }

/* ── Top bar: wordmark + theme toggle ── */
.topbar {
  padding: 28px 40px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.018em;
  color: var(--hero-fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.wordmark-mark {
  width: 13px;
  height: 13px;
  border: 1.25px solid var(--hero-fg);
  display: inline-block;
  position: relative;
}
.wordmark-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--hero-fg);
}

/* Theme toggle button — fixed so it stays visible while scrolling. */
.theme-toggle {
  position: fixed;
  top: 28px;
  right: 40px;
  z-index: 100;
  appearance: none;
  border: 1px solid var(--hero-cta-ghost-border);
  background: var(--hero-cta-ghost-bg);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: var(--hero-fg);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
  padding: 0;
}
.theme-toggle:hover {
  background: var(--hero-cta-ghost-hover-bg);
  border-color: var(--hero-cta-ghost-hover-border);
}
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ── Center column ── */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 40px;
  position: relative;
}

.headline {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(72px, 10.4vw, 168px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: var(--hero-fg);
  margin: 0;
  white-space: nowrap;
  text-shadow: var(--hero-text-shadow);
}

/* Triplet stack: two small muted lines + one large dominant line, all
   left-edge aligned with each other and centered as a block. */
.headline-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin: 0;
}

.headline-small {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--hero-fg-muted);
  margin: 0;
  white-space: nowrap;
}

.headline-big {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(56px, 7.6vw, 138px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--hero-fg);
  margin-top: 0.22em;
  white-space: nowrap;
  text-shadow: var(--hero-text-shadow);
}

.subline {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 19px);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--hero-fg);
  margin: 20px 0 0 0;
  max-width: 52ch;
  /* Subtle halo so the line stays legible over the moving ripple
     shader without looking like a hard drop-shadow. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(0, 0, 0, 0.25);
}
:root:not(.dark) .subline {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.55),
    0 0 12px rgba(255, 255, 255, 0.4);
}

.ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.join-link {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  color: var(--hero-fg-muted);
  text-decoration: none;
  text-transform: lowercase;
  padding: 4px 2px;
  transition: color 140ms ease;
}
.join-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--hero-fg);
}

.btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  padding: 0 18px;
  height: 42px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--hero-cta-primary-bg);
  color: var(--hero-cta-primary-fg);
  border-color: var(--hero-cta-primary-bg);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.30);
}
.btn-primary:hover { background: var(--hero-cta-primary-hover-bg); }

.btn-ghost {
  background: var(--hero-cta-ghost-bg);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: var(--hero-fg);
  border-color: var(--hero-cta-ghost-border);
}
.btn-ghost:hover {
  background: var(--hero-cta-ghost-hover-bg);
  border-color: var(--hero-cta-ghost-hover-border);
}

.btn-arrow {
  width: 14px;
  height: 14px;
  display: inline-block;
  transition: transform 180ms ease;
}
.btn:hover .btn-arrow { transform: translateX(2px); }

/* Larger CTA — dominant single action (slightly smaller now per spec). */
.btn-large {
  font-size: 15.5px;
  font-weight: 500;
  padding: 0 22px;
  height: 50px;
  border-radius: 9px;
  gap: 12px;
  letter-spacing: -0.005em;
}
.btn-large .btn-arrow {
  width: 16px;
  height: 16px;
}

/* ────────────────────────────────────────────────────────
   Scroll indicator
─────────────────────────────────────────────────────────*/
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 2;
  text-decoration: none;
  cursor: pointer;
}

.scroll-cue-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--hero-scroll-label);
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition: color 160ms ease;
}
.scroll-cue:hover .scroll-cue-label { color: var(--hero-scroll-label-hover); }

.scroll-cue-arrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hero-scroll-arrow);
  display: inline-block;
  animation: cueBob 2400ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes cueBob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(2px); opacity: 1; }
}

.scroll-cue-line {
  width: 1px;
  height: 88px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--hero-scroll-line) 35%,
    var(--hero-scroll-line) 80%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 88%, transparent 100%);
  opacity: 0.85;
}

.scroll-cue-halo {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 320px;
  height: 56px;
  pointer-events: none;
  z-index: 1;
}

/* ────────────────────────────────────────────────────────
   Status strip
─────────────────────────────────────────────────────────*/
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 36px;
  border-top: 1px solid var(--hero-statusbar-border);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--hero-statusbar-fg);
  background: var(--hero-statusbar-bg);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  z-index: 3;
  white-space: nowrap;
}
.status-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.status-group > span { white-space: nowrap; }
.status-sep {
  color: var(--hero-statusbar-sep);
  user-select: none;
}
.status-pip {
  width: 5px;
  height: 5px;
  background: var(--hero-statusbar-pip);
  display: inline-block;
  border-radius: 50%;
  margin-right: 2px;
}

/* ────────────────────────────────────────────────────────
   Placeholder bands for Sections 2–7
─────────────────────────────────────────────────────────*/
.placeholders {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
}

.ph-section {
  position: relative;
  min-height: 72vh;
  border-top: 1px solid var(--border);
  padding: 56px 40px;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 32px;
  align-items: start;
}

.ph-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ph-meta strong {
  color: var(--fg);
  font-weight: 500;
}

.ph-title {
  font-family: var(--sans);
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

.ph-tag {
  justify-self: end;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 3px;
  background: var(--ph-tag-bg);
}

.ph-note {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-secondary);
  max-width: 56ch;
}

.end-marker {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ────────────────────────────────────────────────────────
   Preloader — full-viewport black overlay that cycles
   "trust" through translations, then fades out to reveal
   the hero. Apple-"hello"-style hard cuts between words.
─────────────────────────────────────────────────────────*/
.preloader {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 600ms ease;
  /* Keep above any view-transition pseudo overlays */
  contain: layout style paint;
}
.preloader--exiting { opacity: 0; }

.preloader-word {
  color: #FFFFFF;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(56px, 6vw, 120px);
  letter-spacing: -0.025em;
  line-height: 1;
  user-select: none;
}

/* Wrap holds the localized word + a Geist-rendered period so the
   trailing "." stays consistent across scripts (no CJK fullwidth dot, etc). */
.preloader-word-wrap {
  display: inline-flex;
  align-items: baseline;
  /* For RTL words (Arabic) the wrap stays LTR so the period sits to the right. */
  direction: ltr;
}
.preloader-period {
  color: #FFFFFF;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(56px, 6vw, 120px);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-left: 0.02em;
  user-select: none;
}

/* Per-script font fallback chains for glyphs Geist lacks. The class
   names are applied per-word in JSX. */
.preloader-word--cjk-sc {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
               "Microsoft YaHei", var(--sans);
}
.preloader-word--cjk-jp {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
               "Noto Sans JP", var(--sans);
}
.preloader-word--arabic {
  font-family: "SF Arabic", "Geeza Pro", "Tahoma", "Noto Sans Arabic",
               var(--sans);
}
.preloader-word--devanagari {
  font-family: "Kohinoor Devanagari", "Devanagari MT", "Noto Sans Devanagari",
               var(--sans);
}
