/* ============================================================
   polish.css — Phase 5 visual elevation.
   Loaded site-wide on top of the existing stylesheets.
   ============================================================ */

/* ---------- ambient depth: a subtle glow behind the hero ---------- */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: min(900px, 90%); height: 360px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, var(--signal-glow), transparent 70%);
  opacity: 0.5; filter: blur(20px);
}
.hero .wrap { position: relative; z-index: 1; }

/* animated signal dot trail in the hero eyebrow */
.hero .eyebrow::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px;
  border-radius: 50%; background: var(--signal); vertical-align: middle;
  box-shadow: 0 0 8px var(--signal); animation: pulse 2s ease-in-out infinite;
}

/* ---------- gradient text accent for big headings ---------- */
.hero h1 {
  background: linear-gradient(120deg, var(--ink) 30%, var(--signal) 130%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- scroll-reveal (progressive entrance) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity:1 !important; transform:none !important; } }

/* ---------- domain cards: animated signal line + lift ---------- */
.domain-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--dh, var(--signal)) 10%, transparent), transparent 40%);
  opacity: 0; transition: opacity .3s;
}
.domain-card:hover::after { opacity: 1; }

/* ---------- header: search affordance ---------- */
.header-search {
  display: inline-flex; align-items: center; gap: 8px; margin-left: var(--sp-5);
  padding: 7px 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 99px; color: var(--ink-faint); font-size: var(--t-xs);
  font-family: var(--font-mono); cursor: pointer; transition: all .15s;
}
.header-search:hover { border-color: var(--signal); color: var(--ink); }
.header-search kbd { background: var(--bg); border: 1px solid var(--line-bright); border-radius: 4px; padding: 0 5px; font-size: 0.7rem; }
@media (max-width: 720px){ .header-search .hs-label, .header-search kbd { display: none; } }

/* ---------- search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(6,10,15,0.78);
  backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; animation: fadeIn .15s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.search-box {
  width: min(620px, 92%); background: var(--surface); border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from{transform:translateY(10px);opacity:0} to{transform:none;opacity:1} }
#search-input {
  width: 100%; box-sizing: border-box; padding: var(--sp-5); border: none; outline: none;
  background: transparent; color: var(--ink); font-family: var(--font-display);
  font-size: var(--t-lg); border-bottom: 1px solid var(--line);
}
#search-input::placeholder { color: var(--ink-faint); }
.search-results { max-height: 52vh; overflow-y: auto; }
.search-result {
  display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sp-3); align-items: baseline;
  padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background .12s;
}
.search-result:hover, .search-result.sel { background: var(--surface-2); text-decoration: none; }
.search-result.sel { box-shadow: inset 3px 0 0 var(--signal); }
.sr-type { grid-row: 1 / span 2; font-size: 0.65rem; color: var(--signal); align-self: center;
  background: var(--signal-glow); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.sr-title { color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
.sr-desc { color: var(--ink-faint); font-size: var(--t-xs); }
.search-empty { padding: var(--sp-5); color: var(--ink-faint); font-size: var(--t-sm); text-align: center; }
.search-hint { padding: var(--sp-3) var(--sp-5); color: var(--ink-faint); font-size: 0.65rem; border-top: 1px solid var(--line); background: var(--bg); }

/* ---------- smoother global interactions ---------- */
a, .btn, .action-card, .domain-card, .level-btn, .qs-opt { transition: all .18s cubic-bezier(.2,.7,.2,1); }
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* nicer scrollbars (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-bright); }

/* ---------- print styles (for the checklist) ---------- */
@media print {
  .site-header, .site-footer, .lesson-nav, .no-print { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .checklist-print * { color: #000 !important; }
}

/* ---------- WarGames footer wink ---------- */
.wargames-row { text-align: center; padding: var(--sp-4) 0 var(--sp-2); }
.wargames-link {
  display: inline-flex; align-items: center; gap: 1px;
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--ink-faint); text-decoration: none; letter-spacing: 0.02em;
  opacity: 0.55; transition: opacity .25s, color .25s, text-shadow .25s;
}
.wargames-link:hover {
  opacity: 1; color: var(--signal); text-decoration: none;
  text-shadow: 0 0 10px var(--signal-glow);
}
.wg-cursor { color: var(--signal); animation: wgBlink 1.1s step-end infinite; margin-left: 1px; }
@keyframes wgBlink { 0%,100%{ opacity: 1; } 50%{ opacity: 0; } }
@media (prefers-reduced-motion: reduce){ .wg-cursor { animation: none; } }
