/* ==========================================================================
   CertusQuartz - dark-first, flat, blocky. Palette pulled from the AE2
   calculation processor logo: diamond cyan, processor red, deep slate.
   ========================================================================== */

@font-face {
  /* Press Start 2P ships a single weight; the range keeps the 700 usages from
     triggering faux-bold synthesis. */
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-2: #0e141b;
  --surface: #141c26;
  --line: #2b3a49;
  --line-strong: #45596b;
  --ink: #e7edf3;
  --ink-dim: #9fb0c0;
  --footer-ink: #9fb0c0;
  --accent: #54cbe6;
  --accent-ink: #06222b;
  --accent-deep: #1f7f96;
  --red: #e0695a;
  --shadow: #04070a;
  --wordmark-shadow: var(--shadow);
  --grid: rgba(120, 160, 190, 0.05);
  --glow: rgba(84, 203, 230, 0.35);
}

[data-theme="light"] {
  --bg: #f1ede3;
  --bg-2: #e8e1d1;
  --surface: #fbf8f0;
  --line: #1a232c;
  --line-strong: #1a232c;
  --ink: #16202a;
  --ink-dim: #505c67;
  --footer-ink: #1c252e;
  --accent: #2bb4d4;
  --accent-ink: #06222b;
  --accent-deep: #14788f;
  --red: #bf4330;
  --shadow: #1a232c;
  --wordmark-shadow: var(--red);
  --grid: rgba(26, 35, 44, 0.06);
  --glow: rgba(43, 180, 212, 0.28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 50% -10%, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* ---- Header ------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 5vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  border: 2px solid var(--line);
}

.brand-name {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(0.8rem, 2.6vw, 1.05rem);
  letter-spacing: 0;
}

/* Red offset shadow only in light mode; dark mode keeps the clean original look. */
[data-theme="light"] .brand-name { text-shadow: 1px 1px 0 var(--red); }

.accent { color: var(--accent); }

/* ---- Theme toggle ------------------------------------------------------- */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  box-shadow: 3px 3px 0 0 var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.theme-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--shadow); }
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--shadow); }
.theme-toggle .icon { fill: currentColor; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---- Hero --------------------------------------------------------------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 4rem);
  padding: clamp(2rem, 6vw, 4rem) 1.25rem;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 40rem;
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}

.logo {
  position: relative;
  width: clamp(112px, 28vw, 168px);
  height: auto;
  image-rendering: pixelated;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 0 var(--shadow);
}

.logo-glow {
  position: absolute;
  inset: -28%;
  background: radial-gradient(closest-side, var(--glow), transparent 75%);
  filter: blur(6px);
  z-index: 0;
}

.wordmark {
  margin: 0;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(1.4rem, 7vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 var(--wordmark-shadow);
}

.tagline {
  margin: clamp(0.9rem, 2.5vw, 1.4rem) 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 2.6vw, 1.3rem);
}
.tagline .sep {
  color: var(--accent);
  padding: 0 0.2em;
}

/* ---- Buttons ------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--line-strong);
  box-shadow: 5px 5px 0 0 var(--shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent-deep);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 0 var(--shadow); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--shadow); }

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
}

.is-soon {
  cursor: not-allowed;
  color: var(--ink-dim);
  border-style: dashed;
  box-shadow: 5px 5px 0 0 var(--shadow);
}

.tag {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid currentColor;
  padding: 0.1rem 0.4rem;
}

/* ---- Block strip divider ------------------------------------------------ */

.block-strip {
  display: flex;
  gap: 6px;
}
.block-strip span {
  width: clamp(14px, 4vw, 22px);
  height: clamp(14px, 4vw, 22px);
}
.block-strip span:nth-child(5n + 1) { background: var(--accent); }
.block-strip span:nth-child(5n + 2) { background: var(--red); }
.block-strip span:nth-child(5n + 3) { background: var(--line-strong); }
.block-strip span:nth-child(5n + 4) { background: var(--accent-deep); }
.block-strip span:nth-child(5n + 5) { background: var(--ink-dim); }

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 5vw, 2.5rem);
  border-top: 2px solid var(--line);
  color: var(--footer-ink);
  font-size: 0.9rem;
}
.copyright { margin: 0; }
.footer-links a {
  color: var(--footer-ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.footer-links a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- Focus + motion ----------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .site-footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
