@font-face {
  font-family: "Plex Mono";
  src: local("IBM Plex Mono");
}

:root {
  --bg: #0b0d0a;
  --panel: #131610;
  --panel-line: #232a1e;
  --phosphor: #7fe98a;
  --green-deep: #1e8a3c;
  --ink: #ede6d4;
  --dim: #8a9184;
  --frame-border: #ede6d4;
  --btn-ink: #06210f;
  --radius: 16px;
  --font-mono:
    "IBM Plex Mono", "Plex Mono", ui-monospace, "SFMono-Regular", Menlo,
    Consolas, monospace;
  --font-serif:
    ui-serif, Charter, Georgia, Cambria, "Times New Roman", Times, serif;
  color-scheme: dark;
  font-size: 18px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2ede0;
    --panel: #ffffff;
    --panel-line: #ddd4bd;
    --phosphor: #1e8a3c;
    --green-deep: #17702f;
    --ink: #181a12;
    --dim: #6c7361;
    --frame-border: #181a12;
    --btn-ink: #f2ede0;
    color-scheme: light;
  }
}

/* manual toggle wins over system preference in both directions */
:root[data-theme="dark"] {
  --bg: #0b0d0a;
  --panel: #131610;
  --panel-line: #232a1e;
  --phosphor: #7fe98a;
  --green-deep: #1e8a3c;
  --ink: #ede6d4;
  --dim: #8a9184;
  --frame-border: #ede6d4;
  --btn-ink: #06210f;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f2ede0;
  --panel: #ffffff;
  --panel-line: #ddd4bd;
  --phosphor: #1e8a3c;
  --green-deep: #17702f;
  --ink: #181a12;
  --dim: #6c7361;
  --frame-border: #181a12;
  --btn-ink: #f2ede0;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

a {
  color: var(--phosphor);
}

::selection {
  background: var(--green-deep);
  color: #fff;
}

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

img {
  max-width: 100%;
  display: block;
}

.wrap {
  min-height: 100dvh;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 6px 1px var(--phosphor);
  flex-shrink: 0;
}

.topnav {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--dim);
}

.topnav a {
  text-decoration: none;
  color: var(--dim);
  transition: color 0.15s ease;
}

.topnav a:hover {
  color: var(--phosphor);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-top: -5px;
  border: none;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.15s ease;
}

.icon-btn:hover {
  color: var(--phosphor);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn .icon-moon {
  display: none;
}

.icon-btn[data-icon="light"] .icon-sun {
  display: none;
}

.icon-btn[data-icon="light"] .icon-moon {
  display: block;
}

/* ---------- main (centers between header & footer) ---------- */

main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 56px;
  align-items: center;
  padding: 40px 0 56px;
}

/* device frame / shuffle */

.deck {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 400px;
}

.deck-shadow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
  background: var(--panel);
}

.deck-shadow.s1 {
  transform: translate(10px, 14px) rotate(3deg);
  opacity: 0.55;
}

.deck-shadow.s2 {
  transform: translate(-8px, 20px) rotate(-2.5deg);
  opacity: 0.35;
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 16px 0 40px;
    text-align: center;
  }

  .hero .deck {
    max-width: 240px;
  }

  .hero .deck-hint {
    font-size: 0.5rem;
  }
}

.frame {
  display: block;
  width: 100%;
  position: relative;
  border: 2px solid var(--frame-border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.7);
}

.frame:focus-visible {
  outline-offset: 4px;
}

.frame-shot-wrap {
  position: relative;
  aspect-ratio: 1170 / 2366;
  background: var(--panel);
}

.frame-shot-wrap img {
  position: absolute;
  inset: 0;
  top: 4px;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.deck-hint {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
}

/* hero copy */

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--phosphor);
  margin: 0 0 18px;
}

@media (max-width: 800px) {
  .hero-copy .eyebrow {
    justify-content: center;
    width: 100%;
    letter-spacing: 0;
    margin-top: 3rem;
  }
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 20px;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-copy p {
  color: var(--dim);
  font-size: 1.15rem;
  max-width: 56ch;
  margin: 0 0 30px;
}

@media (max-width: 800px) {
  .hero-copy p {
    margin-inline: auto;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.08s ease,
    background 0.15s ease;
}

.btn:hover {
  border-color: var(--green-deep);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border: 2px solid var(--phosphor);
  background: var(--phosphor);
  color: var(--btn-ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 4px 4px 0 var(--panel-line);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 5px 5px 0 var(--phosphor);
  transform: translate(-1px, -1px);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--phosphor);
}

.cta-prefix {
  font-weight: 900;
}

.cta-blink {
  display: inline-block;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- features ---------- */

.features {
  padding: 8px 0 40px;
  border-top: 1px solid var(--panel-line);
}

.features h2 {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
  margin: 40px 0 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--panel-line);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature {
  background: var(--panel);
  padding: 22px;
}

.feature .tag {
  color: var(--phosphor);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.feature p {
  margin: 0;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- footer ---------- */

footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--panel-line);
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--dim);
}

footer a {
  color: var(--dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--phosphor);
}

@media (max-width: 560px) {
  footer {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- privacy page ---------- */

.doc {
  padding: 40px 0;
  max-width: 720px;
}

.doc h1 {
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.doc .updated {
  color: var(--dim);
  font-size: 0.8rem;
  margin-bottom: 40px;
}

.doc h2 {
  font-size: 0.95rem;
  color: var(--phosphor);
  letter-spacing: 0.04em;
  margin: 36px 0 10px;
}

.doc p,
.doc li {
  color: var(--dim);
  font-size: 0.92rem;
}

.doc a {
  color: var(--phosphor);
}

/* VHS Effect WebGL Canvas
   position:fixed + inset:0 (no explicit width/height attribute) stretches
   the canvas to the full physical viewport — including iOS status-bar and
   bottom home-indicator area — when viewport-fit=cover is set. */
#vhsOutput {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

#vhsSource {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
}
