:root {
  --bg: #0b0f17;
  --surface: rgba(255, 255, 255, 0.05);
  --surface2: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.10);
  --rule: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.55);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --max: 980px;
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --accent: #8fa3bf;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: rgba(0, 0, 0, 0.04);
  --surface2: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.10);
  --rule: rgba(0, 0, 0, 0.12);
  --text: rgba(0, 0, 0, 0.90);
  --muted: rgba(0, 0, 0, 0.64);
  --faint: rgba(0, 0, 0, 0.52);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  --accent: #5b6f8a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
}

.container {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  position: relative;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative; /* <-- this anchors the popover */
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Toggles */
.toggle {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
}

.toggle--icon {
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted);
}

.toggle--icon:hover {
  color: var(--text);
  border-color: var(--accent);
}

.toggle--menu {
  padding: 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.toggle--menu:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Popover (anchored to .header__actions) */
.menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  pointer-events: none;
  z-index: 20;
}

.menu-popover__panel {
  pointer-events: auto;
  position: relative;
  width: 100px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--border) 75%, transparent);

  /* opaque + theme-aware */
  background: var(--bg);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28); /* lighter/tighter than var(--shadow) */

  text-align: right;

  /* panel animation */
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  transition:
    opacity 120ms ease,
    transform 170ms cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.menu-popover[data-open="true"] .menu-popover__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Menu items: right-aligned + theme-aware + stagger */
.menu-item {
  display: block;
  position: relative;
  padding: 7px 9px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;

  color: var(--text);   /* <-- fixes light mode */
  text-align: right;

  border: 1px solid transparent;

  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 160ms ease,
    transform 220ms cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.menu-item::before {
  content: ">";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
  pointer-events: none;

  opacity: 0; /* hidden by default */
}

/* Only hovered item can show it... */
.menu-item:hover::before {
  opacity: 1;
}

/* ...but global blink phase can force it OFF (synced to hero) */
html.blink-off .menu-item:hover::before {
  opacity: 0;
}



@media (prefers-reduced-motion: reduce) {
  html.blink-off .title::before { opacity: 1; }
  html.blink-off .menu-item:hover::before { opacity: 1; }
}


.menu-popover[data-open="true"] .menu-item {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger timing */
.menu-popover[data-open="true"] .menu-item:nth-child(1) { transition-delay: 35ms; }
.menu-popover[data-open="true"] .menu-item:nth-child(2) { transition-delay: 80ms; }
.menu-popover[data-open="true"] .menu-item:nth-child(3) { transition-delay: 125ms; }
.menu-popover[data-open="true"] .menu-item:nth-child(4) { transition-delay: 170ms; }

.menu-item:hover {
  background: var(--surface2);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .menu-popover__panel,
  .menu-item {
    transition: none;
    transform: none;
  }

}

/* Hero */
.hero {
  padding: 48px 0 12px;
}



.eyebrow {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title {
  position: relative;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* Hanging prompt (lives in the gutter) */
.title::before {
  content: ">";
  position: absolute;
  left: -1.2ch;
  top: 0.02em;
  font: inherit;
  color: inherit;
  user-select: none;
  pointer-events: none;

  opacity: 1; /* default ON */
}

/* Global blink phase OFF */
html.blink-off .title::before {
  opacity: 0;
}






.lead {
  color: var(--muted);
  max-width: 72ch;
  margin-top: 14px;

}

/* Sections, cards, footer (unchanged core styles) */
.section { padding: 18px 0; }

.grid {
  display: grid;
  gap: 14px;
}
@media (min-width: 820px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card__links {
  margin-top: 14px;
  display: flex;
  gap: 14px;
}

.link {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.link:hover {
  border-bottom-color: var(--accent);
}

.link.disabled {
  color: var(--faint);
  pointer-events: none;
  border-bottom-color: transparent;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.footer {
  padding: 22px 0 46px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 13px;
}

.actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--border);
}

.btn:hover {
  transform: translateY(-1px);
}


.btn--primary {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.btn--primary:hover { filter: brightness(0.96); }

.btn--ghost {
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}