/* Wulfinn landing page. Theme-independent: only --color-* theme variables are used.
 * The page has no dropdowns, so hero/cards may transform freely; the navbar (z-index 30) stays above. */

.wh {
  --wh-p: var(--color-primary);
  --wh-p-soft: color-mix(in srgb, var(--color-primary) 22%, transparent);
  --wh-p-faint: color-mix(in srgb, var(--color-primary) 8%, transparent);
  --wh-mono: var(--fonts-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);
  --wh-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: 0 0 64px !important;
  margin: 0 !important;
}
.wh code { font-family: var(--wh-mono); }

/* ---------- background: rune rain + scanlines ---------- */
.wh-rain {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  -webkit-mask: linear-gradient(#000 40%, transparent);
  mask: linear-gradient(#000 40%, transparent);
  transition: opacity 0.6s ease;
}
.wh.wh-matrix .wh-rain { opacity: 1; -webkit-mask: none; mask: none; position: fixed; height: 100%; }
.wh-scan {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--color-text) 5%, transparent) 0 1px, transparent 1px 3px);
  -webkit-mask: linear-gradient(#000 30%, transparent);
  mask: linear-gradient(#000 30%, transparent);
  opacity: 0.6;
}

/* ---------- hero ---------- */
.wh-hero {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 16px 80px;
  text-align: center;
  position: relative;
}
.wh-boot {
  position: absolute;
  top: 14px;
  left: 18px;
  font: 11px/1.55 var(--wh-mono);
  color: var(--color-text-light-3);
  text-align: left;
  white-space: pre;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 1.2s ease 2.5s;
}
.wh-boot.done { opacity: 0; }
.wh-boot .ok { color: var(--color-green-light, var(--color-green)); }

.wh-logo {
  position: relative;
  width: 176px;
  height: 176px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transform: perspective(700px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform 0.25s var(--wh-ease);
  animation: wh-drop 0.9s var(--wh-ease) both;
}
.wh-logo img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 40px var(--wh-p-soft)); position: relative; }
.wh-logo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 60%, var(--wh-p) 80%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: wh-spin 3.2s linear infinite;
}
.wh-logo.spin img { animation: wh-barrel 0.8s var(--wh-ease); }
.wh-logo:focus-visible { outline-offset: 12px; }

.wh-kicker {
  font: 12px var(--wh-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light-2);
  margin: 6px 0 0;
  animation: wh-fade 0.8s ease 0.3s both;
}
.wh-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green-light, var(--color-green));
  box-shadow: 0 0 0 0 var(--color-green);
  animation: wh-ping 1.8s ease-out infinite;
  vertical-align: 1px;
  margin-right: 4px;
}

/* title with split letters + glitch layers */
.wh-title {
  position: relative;
  margin: 0;
  font-family: var(--wn-display, serif) !important;
  font-size: clamp(64px, 15vw, 196px);
  line-height: 0.95;
  font-weight: 400 !important;
  letter-spacing: 0.05em;
  color: var(--color-text);
  user-select: none;
  cursor: crosshair;
}
.wh-title .wh-l {
  display: inline-block;
  background: linear-gradient(100deg, var(--color-text) 20%, var(--wh-p) 45%, var(--color-text) 70%) 0 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wh-letter 0.7s var(--wh-ease) backwards, wh-sheen 6s linear infinite;
  transition: transform 0.25s var(--wh-ease);
}
.wh-title .wh-l:hover, .wh-title .wh-l.hop { transform: translateY(-0.12em) rotate(-4deg) scale(1.06); }
.wh-title::before,
.wh-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.wh-title.glitch::before { opacity: 0.85; color: var(--color-red-light, var(--color-red)); animation: wh-glitch-a 0.32s steps(2) both; }
.wh-title.glitch::after { opacity: 0.85; color: var(--color-teal-light, var(--color-teal)); animation: wh-glitch-b 0.32s steps(2) both; }
.wh-title.glitch .wh-l { animation-play-state: paused; }

.wh-tag {
  margin: 4px 0 0;
  font: 600 clamp(18px, 2.6vw, 28px) var(--wh-mono);
  color: var(--color-text);
  animation: wh-fade 0.8s ease 0.5s both;
}
.wh-prompt { color: var(--wh-p); margin-right: 4px; }
.wh-rot { color: var(--wh-p); }
.wh-caret { color: var(--wh-p); animation: wh-blink 1s steps(1) infinite; }
.wh-sub {
  max-width: 560px;
  margin: 0;
  color: var(--color-text-light-2);
  font-size: 16px;
  animation: wh-fade 0.8s ease 0.65s both;
}

/* buttons */
.wh-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; animation: wh-fade 0.8s ease 0.8s both; }
.wh-btn {
  --tx: 0px; --ty: 0px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font: 600 14px var(--wh-mono);
  color: var(--color-text) !important;
  background: var(--color-box-body);
  border: 1px solid var(--color-secondary);
  text-decoration: none !important;
  transform: translate(var(--tx), var(--ty));
  transition: transform 0.2s var(--wh-ease), box-shadow 0.2s ease, border-color 0.2s ease, background-position 0.6s var(--wh-ease);
  background-image: linear-gradient(105deg, transparent 38%, color-mix(in srgb, var(--color-text) 14%, transparent) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
  background-repeat: no-repeat;
}
.wh-btn:hover { border-color: var(--wh-p); box-shadow: 0 0 0 3px var(--wh-p-faint), 0 10px 30px -12px var(--wh-p); background-position: -30% 0; }
.wh-btn:active { transform: translate(var(--tx), var(--ty)) scale(0.96); }
.wh-btn-primary { background-color: var(--wh-p); border-color: var(--wh-p); color: var(--color-primary-contrast) !important; }
.wh-btn-ghost { background-color: transparent; }

.wh-scroll {
  position: absolute;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: 10px var(--wh-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-light-3) !important;
  text-decoration: none !important;
}
.wh-scroll-line { width: 1px; height: 36px; background: linear-gradient(var(--wh-p), transparent); background-size: 100% 200%; animation: wh-drip 1.6s ease-in-out infinite; }

/* ---------- sections ---------- */
.wh-stats, .wh-term-section, .wh-feat-section, .wh-quote, .wh-final { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wh-h2 { font: clamp(28px, 3.6vw, 42px) var(--wn-display, serif); margin: 0 0 8px; color: var(--color-text); }
.wh-hash { color: var(--wh-p); }
.wh-lead { color: var(--color-text-light-2); margin: 0 0 18px; }
.wh-lead code { background: var(--wh-p-faint); color: var(--wh-p); padding: 1px 6px; border-radius: 5px; }

.wh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 96px;
}
.wh-stat {
  padding: 22px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-box-body) 70%, transparent);
  border: 1px solid var(--color-secondary);
  text-align: center;
  backdrop-filter: blur(6px);
}
.wh-stat b { display: block; font: 800 clamp(30px, 4vw, 44px) var(--wh-mono); color: var(--wh-p); font-variant-numeric: tabular-nums; }
.wh-stat span { font: 12px var(--wh-mono); color: var(--color-text-light-2); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- terminal ---------- */
.wh-term-section { margin-bottom: 110px; }
.wh-term {
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-console-bg);
  border: 1px solid var(--color-console-border);
  box-shadow: 0 30px 80px -30px #000c, 0 0 0 1px var(--wh-p-faint);
  font: 14px/1.6 var(--wh-mono);
  color: var(--color-console-fg);
  transition: transform 0.3s var(--wh-ease);
}
.wh-term.shake { animation: wh-shake 0.5s; }
.wh-term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: color-mix(in srgb, var(--color-console-fg) 6%, var(--color-console-bg)); border-bottom: 1px solid var(--color-console-border); }
.wh-tl { width: 12px; height: 12px; border-radius: 50%; }
.wh-tl.r { background: #ff5f57; } .wh-tl.y { background: #febc2e; } .wh-tl.g { background: #28c840; }
.wh-term-title { margin-left: 8px; font-size: 12px; color: var(--color-console-fg-subtle); }
.wh-term-body { height: 400px; overflow-y: auto; padding: 14px 16px; cursor: text; scrollbar-width: thin; }
.wh-term-out > div { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.wh-term-out .c-cmd { color: var(--color-console-fg); }
.wh-term-out .c-dim { color: var(--color-console-fg-subtle); }
.wh-term-out .c-p { color: var(--wh-p); }
.wh-term-out .c-ok { color: var(--color-ansi-green); }
.wh-term-out .c-err { color: var(--color-ansi-red); }
.wh-term-out .c-warn { color: var(--color-ansi-yellow); }
.wh-term-out .c-cy { color: var(--color-ansi-cyan); }
.wh-term-out .c-mag { color: var(--color-ansi-magenta); }
.wh-term-out a { color: var(--color-ansi-cyan); text-decoration: underline dotted; }
.wh-term-out .c-art { line-height: 1.2; color: var(--wh-p); }
.wh-term-line { display: flex; gap: 8px; align-items: baseline; }
.wh-ps1 { color: var(--color-ansi-green); white-space: nowrap; }
.wh-path { color: var(--color-ansi-blue); }
.wh-dim { color: var(--color-console-fg-subtle); }
#wh-term-in {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: var(--color-console-fg) !important;
  font: inherit;
  padding: 0 !important;
  caret-color: var(--wh-p);
}
.wh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wh-chips button {
  font: 12px var(--wh-mono);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--color-secondary-dark-2);
  background: transparent;
  color: var(--color-text-light-1);
  cursor: pointer;
  transition: all 0.18s var(--wh-ease);
}
.wh-chips button:hover { border-style: solid; border-color: var(--wh-p); color: var(--wh-p); transform: translateY(-2px); }

/* ---------- feature cards ---------- */
.wh-feat-section { margin-bottom: 110px; }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; perspective: 1200px; }
.wh-card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative;
  padding: 24px 22px 20px;
  border-radius: 16px;
  background:
    radial-gradient(400px circle at var(--mx) var(--my), var(--wh-p-faint), transparent 45%),
    color-mix(in srgb, var(--color-box-body) 80%, transparent);
  border: 1px solid var(--color-secondary);
  transform: rotateX(var(--ry)) rotateY(var(--rx));
  transform-style: preserve-3d;
  transition: transform 0.35s var(--wh-ease), border-color 0.25s ease, box-shadow 0.25s ease;
}
.wh-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--wh-p), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.wh-card:hover::before { opacity: 1; }
.wh-card:hover { box-shadow: 0 24px 60px -30px var(--wh-p); }
.wh-card-ico {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--wh-p-faint);
  color: var(--wh-p);
  margin-bottom: 14px;
  transform: translateZ(30px);
  transition: transform 0.3s var(--wh-ease);
}
.wh-card:hover .wh-card-ico { transform: translateZ(40px) rotate(-8deg) scale(1.08); }
.wh-card h3 { font: 23px var(--wn-display, serif); letter-spacing: 0.03em; margin: 0 0 6px; color: var(--color-text); transform: translateZ(20px); }
.wh-card p { margin: 0 0 14px; color: var(--color-text-light-2); line-height: 1.55; }
.wh-card-code { display: block; font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--color-console-bg); color: var(--color-console-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- quote + marquee ---------- */
.wh-quote { text-align: center; margin-bottom: 40px; }
.wh-quote blockquote { margin: 0; }
.wh-quote p { font: clamp(26px, 3.8vw, 44px)/1.2 var(--wn-display, serif); margin: 0 0 10px; color: var(--color-text); }
.wh-quote cite { font: 13px var(--wh-mono); color: var(--color-text-light-3); font-style: normal; }
.wh-marquee { overflow: hidden; padding: 18px 0; margin: 0 0 100px; border-block: 1px solid var(--color-secondary); font: 15px var(--wh-mono); color: var(--color-text-light-3); -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.wh-marquee-track { display: flex; width: max-content; animation: wh-marquee 40s linear infinite; }
.wh-marquee:hover .wh-marquee-track { animation-play-state: paused; }

/* ---------- final ---------- */
.wh-final { text-align: center; }
.wh-final-title { font: clamp(36px, 6vw, 68px) var(--wn-display, serif); margin: 0 0 10px; color: var(--color-text); }
.wh-glitch { position: relative; display: inline-block; color: var(--wh-p); }
.wh-glitch::before, .wh-glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0.8; }
.wh-glitch::before { color: var(--color-red-light, var(--color-red)); animation: wh-glitch-a 2.8s steps(2) infinite; }
.wh-glitch::after { color: var(--color-teal-light, var(--color-teal)); animation: wh-glitch-b 3.1s steps(2) infinite; }
.wh-hint { margin-top: 26px; font: 11px var(--wh-mono); color: var(--color-text-light-3); opacity: 0.6; letter-spacing: 0.2em; }

/* ---------- reveal ---------- */
.wh-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--wh-ease), transform 0.7s var(--wh-ease); }
.wh-reveal.in { opacity: 1; transform: none; }

/* ---------- toast + flying ship ---------- */
.wh-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--color-console-bg);
  color: var(--color-console-fg);
  border: 1px solid var(--wh-p);
  font: 13px var(--wh-mono);
  box-shadow: 0 10px 40px -10px var(--wh-p);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--wh-ease);
}
.wh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wh-flyship { position: fixed; z-index: 45; width: 140px; pointer-events: none; top: 30%; left: -160px; animation: wh-fly 3.2s cubic-bezier(0.45, 0, 0.55, 1) forwards; filter: drop-shadow(0 10px 30px var(--wh-p)); }
.wh-sparks { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 44; pointer-events: none; }

/* ---------- keyframes ---------- */
@keyframes wh-spin { to { transform: rotate(360deg); } }
@keyframes wh-drop { from { opacity: 0; transform: perspective(700px) translateY(-30px) scale(0.85) rotate(-12deg); } }
@keyframes wh-barrel { 50% { transform: rotate(180deg) scale(0.85); } to { transform: rotate(360deg); } }
@keyframes wh-fade { from { opacity: 0; transform: translateY(10px); } }
@keyframes wh-letter { from { opacity: 0; transform: translateY(0.4em) rotateX(80deg); filter: blur(8px); } }
@keyframes wh-sheen { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@keyframes wh-blink { 50% { opacity: 0; } }
@keyframes wh-ping { 70%, 100% { box-shadow: 0 0 0 8px transparent; } 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-green) 70%, transparent); } }
@keyframes wh-drip { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
@keyframes wh-marquee { to { transform: translateX(-50%); } }
@keyframes wh-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px) rotate(-0.5deg); } 40%, 60% { transform: translateX(8px) rotate(0.5deg); } }
@keyframes wh-fly { 0% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(60vw, -40px) rotate(6deg); } 100% { transform: translate(calc(100vw + 320px), 10px) rotate(-4deg); } }
@keyframes wh-glitch-a {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 1px); }
  20% { clip-path: inset(60% 0 10% 0); transform: translate(4px, -1px); }
  40% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, 0); }
  60% { clip-path: inset(80% 0 2% 0); transform: translate(3px, 1px); }
  80% { clip-path: inset(5% 0 85% 0); transform: translate(-2px, -1px); }
  100% { clip-path: inset(45% 0 40% 0); transform: translate(0); }
}
@keyframes wh-glitch-b {
  0% { clip-path: inset(70% 0 5% 0); transform: translate(4px, -1px); }
  20% { clip-path: inset(15% 0 65% 0); transform: translate(-4px, 1px); }
  40% { clip-path: inset(50% 0 30% 0); transform: translate(3px, 0); }
  60% { clip-path: inset(2% 0 80% 0); transform: translate(-3px, -1px); }
  80% { clip-path: inset(85% 0 5% 0); transform: translate(2px, 1px); }
  100% { clip-path: inset(40% 0 45% 0); transform: translate(0); }
}

@media (max-width: 768px) {
  .wh-stats { grid-template-columns: repeat(2, 1fr); }
  .wh-term-body { height: 340px; font-size: 13px; }
  .wh-boot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wh *, .wh *::before, .wh *::after { animation: none !important; transition: none !important; }
  .wh-reveal { opacity: 1; transform: none; }
  .wh-rain { display: none; }
}
