/*
Theme Name:        Wraithbit
Theme URI:         https://wraithbit.com
Author:            Wraithbit
Author URI:        https://wraithbit.com
Description:       A minimal, futuristic single-page WordPress theme for Wraithbit — a Web3 parent company. Features an interactive WebGL shader, cursor-reactive spotlight, film grain, and editorial typography pairing Instrument Serif with JetBrains Mono.
Version:           1.0.0
Requires at least: 5.8
Tested up to:      6.5
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       wraithbit
Tags:              one-page, landing-page, dark, minimal, web3, custom-colors
*/

:root {
  --bg: #07080b;
  --bg-soft: #0c0e13;
  --fg: #e9e8e3;
  --fg-dim: #8c8b85;
  --fg-faint: #46464a;
  --accent: #b8b4d6;
  --rule: rgba(233, 232, 227, 0.10);
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  cursor: default;
}

/* Cursor-following spotlight */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(184, 180, 214, 0.08),
    rgba(184, 180, 214, 0.03) 25%,
    transparent 55%
  );
  transition: background 0.2s ease-out;
  mix-blend-mode: screen;
}

/* Film grain overlay */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: wb-grain 8s steps(8) infinite;
}

@keyframes wb-grain {
  0%,100%   { transform: translate(0,0); }
  12.5%     { transform: translate(-3%, 2%); }
  25%       { transform: translate(2%, -4%); }
  37.5%     { transform: translate(-4%, -2%); }
  50%       { transform: translate(3%, 3%); }
  62.5%     { transform: translate(-2%, 4%); }
  75%       { transform: translate(4%, -3%); }
  87.5%     { transform: translate(-3%, 3%); }
}

/* Scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0,0,0,0.12) 3px,
    transparent 4px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* App shell */
.shell {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 40px;
}

/* ───────── NAV ───────── */
.wb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 500;
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9be3a5;
  box-shadow: 0 0 10px #9be3a5, 0 0 20px rgba(155, 227, 165, 0.4);
  animation: wb-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes wb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

.wb-nav .right { display: flex; gap: 32px; }
.wb-nav .right span { color: var(--fg-dim); }
.wb-nav .right span:last-child { color: var(--fg); }

/* ───────── MAIN ───────── */
.wb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 60px;
  align-items: center;
  min-height: 0;
  padding: 40px 0;
}

/* Left column */
.content {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-left: 12px;
}

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: wb-rise 1.2s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.label::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--fg-faint);
}

h1.wraithbit {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(72px, 10vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--fg);
  opacity: 0;
  animation: wb-rise 1.4s 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

h1.wraithbit .italic {
  font-style: italic;
  color: var(--accent);
}

.tagline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35;
  color: var(--fg);
  max-width: 480px;
  margin-top: 4px;
  opacity: 0;
  animation: wb-rise 1.4s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.description {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg-dim);
  max-width: 440px;
  opacity: 0;
  animation: wb-rise 1.4s 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.portfolio {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  animation: wb-rise 1.4s 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.portfolio-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
}

.portfolio a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  gap: 0;
  transition: color 0.25s ease, padding-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.portfolio a:first-of-type { border-top: 1px solid var(--rule); }

.portfolio a .idx { color: var(--fg-faint); font-size: 10px; letter-spacing: 0.1em; }
.portfolio a .name { font-size: 13px; }
.portfolio a .name em {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--fg);
  letter-spacing: 0;
  margin-right: 14px;
}
.portfolio a .meta { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.05em; }
.portfolio a .arrow {
  color: var(--fg-faint);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.25s ease;
  margin-left: 12px;
}
.portfolio a:hover { padding-left: 8px; color: var(--fg); }
.portfolio a:hover .arrow { color: var(--accent); transform: translateX(6px); }
.portfolio a:hover .idx { color: var(--accent); }

/* Right column: shader canvas */
.shader-frame {
  position: relative;
  height: 100%;
  min-height: 420px;
  border: 1px solid var(--rule);
  overflow: hidden;
  opacity: 0;
  animation: wb-fade 2s 0.3s ease-out forwards;
}

.shader-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Corner ticks */
.shader-frame .tick-tl,
.shader-frame .tick-tr,
.shader-frame .tick-bl,
.shader-frame .tick-br {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 3;
  pointer-events: none;
}
.shader-frame .tick-tl { top: -1px; left: -1px;
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.shader-frame .tick-tr { top: -1px; right: -1px;
  border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.shader-frame .tick-bl { bottom: -1px; left: -1px;
  border-bottom: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.shader-frame .tick-br { bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent); }

/* HUD overlay */
.hud {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud-tl { top: 18px; left: 20px; }
.hud-br { bottom: 18px; right: 20px; }
.hud .marker {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

/* ───────── FOOTER ───────── */
.wb-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.wb-footer a { color: var(--fg); text-decoration: none; transition: color 0.2s ease; }
.wb-footer a:hover { color: var(--accent); }

.wb-footer .center { text-align: center; }
.wb-footer .right  { text-align: right;  }

.wb-footer .label-sm { color: var(--fg-faint); font-size: 9px; display: block; margin-bottom: 6px; }

/* Entry animations */
@keyframes wb-rise {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes wb-fade {
  0% { opacity: 0; } 100% { opacity: 1; }
}

/* Responsive */
@media (max-width: 960px) {
  html, body { overflow-y: auto; overflow-x: hidden; }
  .shell { height: auto; min-height: 100vh; padding: 20px; }
  .wb-main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 30px 0;
  }
  .content { padding-left: 0; max-width: none; }
  h1.wraithbit { font-size: clamp(56px, 14vw, 96px); }
  .shader-frame { min-height: 320px; height: 50vh; }
  .wb-footer { grid-template-columns: 1fr; gap: 16px; text-align: left; }
  .wb-footer .center, .wb-footer .right { text-align: left; }
  .wb-nav { font-size: 10px; }
  .wb-nav .right { gap: 18px; }
}
