:root {
  --bg: #f6f4ef;
  --ink: #1f1f1f;
  --muted: #5f5f5f;
  --accent: #ff7a1a;
  --accent-dark: #e55e00;
  --accent-soft: #ffe9d4;
  --green: #0f6b57;
  --card: #ffffff;
  --line: #e5e0d9;
  --bg-grad-1: #fff1d8;
  --bg-grad-2: #e4f4ef;
  --bg-grad-3: #ffffff;
  --shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 520px at 10% -10%, var(--bg-grad-1), transparent),
    radial-gradient(1000px 600px at 90% 0%, var(--bg-grad-2), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-grad-3) 60%);
  min-height: 100vh;
}

body.theme-dark {
  --bg: #0f1319;
  --ink: #f4f6f8;
  --muted: #b9c0c8;
  --accent-soft: #2f1b0f;
  --green: #50c7a3;
  --card: #151c26;
  --line: #2b3440;
  --bg-grad-1: #1b232e;
  --bg-grad-2: #142620;
  --bg-grad-3: #0f1319;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
}

body.theme-dark::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 0);
  opacity: 0.28;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.45;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
  backdrop-filter: blur(10px);
  background: rgba(246, 244, 239, 0.92);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-tag {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-weight: 500;
}

.nav a {
  color: var(--muted);
}

.nav a:hover {
  color: var(--ink);
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 18px rgba(255, 122, 26, 0.3);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: none;
}

body.theme-light .theme-icon-light {
  display: block;
}

body:not(.theme-light) .theme-icon-dark {
  display: block;
}

body.theme-dark .site-header {
  background: rgba(15, 19, 25, 0.92);
}

body.theme-dark .nav a {
  color: var(--muted);
}

body.theme-dark .nav a:hover {
  color: var(--ink);
}

body.theme-dark .lang-toggle,
body.theme-dark .theme-toggle,
body.theme-dark .btn.ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

.lang-toggle {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.lang-toggle:hover {
  border-color: var(--accent);
}

main {
  padding: 36px 6vw 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: center;
  position: relative;
  padding: 40px 0 20px;
}

.hero-content h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.3rem, 3.6vw, 3.7rem);
  line-height: 1.05;
  margin: 0 0 16px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 22px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 122, 26, 0.25);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(255, 122, 26, 0.35);
}

.btn.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: var(--card);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.hero-meta div {
  background: var(--card);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.meta-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  font-weight: 600;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.hero-card-body {
  padding: 16px;
}

.hero-card-body img {
  border-radius: 14px;
  border: 1px solid var(--line);
}

.hero-card-bottom {
  padding: 12px 20px 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 999px;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  opacity: 0.2;
  filter: blur(0);
  animation: float 8s ease-in-out infinite;
  z-index: -1;
}

.orb-1 {
  width: 180px;
  height: 180px;
  background: var(--accent-soft);
  top: -40px;
  right: 25%;
}

.orb-2 {
  width: 120px;
  height: 120px;
  background: #d2f0e5;
  bottom: 10px;
  left: 5%;
  animation-delay: 1.4s;
}

.section {
  margin-top: 80px;
}

.video-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}

.video-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1f1f1f;
  cursor: pointer;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-meta h3 {
  margin-top: 0;
}

.section-header {
  max-width: 720px;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  margin-bottom: 8px;
}

.section-header p {
  color: var(--muted);
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card h3 {
  margin-top: 0;
}

.feature-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.timeline {
  display: grid;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}

.timeline-item {
  border-left: 2px solid rgba(255, 122, 26, 0.5);
  padding-left: 12px;
}

.timeline-date {
  font-weight: 700;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 4px;
}

.faq-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}

.faq-card details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.faq-card details:last-of-type {
  border-bottom: none;
}

.faq-card summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.split-media img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  padding-left: 28px;
  margin: 10px 0;
  position: relative;
}

.checklist li::before {\r\n  content: "->";\r\n  position: absolute;\r\n  left: 0;\r\n  color: var(--green);\r\n  font-weight: 700;\r\n}

.printers .printer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.printers .printer-list div {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--line);
}

.screens .screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.screens figure {
  margin: 0;
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.06);
}

.screens figcaption {
  padding: 10px 14px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.cta {
  background: var(--ink);
  color: #fff;
  padding: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cta h2 {
  margin: 0 0 6px;
}

.cta p {
  margin: 0;
  color: #d3d3d3;
}

body.theme-dark .cta {
  background: #111821;
  color: var(--ink);
  border: 1px solid var(--line);
}

body.theme-dark .cta p {
  color: var(--muted);
}

.site-footer {
  padding: 30px 6vw 40px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: center;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.footer-contact a {
  color: var(--accent-dark);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.footer-sep {
  color: var(--line);
}

.footer-copy {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
}

.newsletter-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.newsletter-form input {
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.newsletter-note {
  color: var(--muted);
  font-size: 0.9rem;
}

body.theme-dark .site-footer {
  background: #0f1319;
}

body.theme-dark .footer-contact a {
  color: var(--accent);
}

body.theme-dark .footer-links {
  color: var(--muted);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 50px 0 20px;
}

.page-hero {
  margin-bottom: 24px;
}

.page-hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 0 0 10px;
}

.page-hero p {
  color: var(--muted);
  margin: 0;
}

.page-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.06);
  margin-bottom: 20px;
}

.page-content h2 {
  margin-top: 0;
}

.page-content p {
  color: var(--muted);
}

.page-content ul {
  margin: 10px 0 0 18px;
  color: var(--muted);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .video-card {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 4vw;
    height: 60px;
    position: relative;
  }

  .nav-hamburger { display: flex; }

  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 2px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(16,24,40,0.12);
  }

  .nav.open { display: flex; }

  .nav a {
    padding: 14px 24px;
    width: 100%;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--line);
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav a.nav-cta {
    margin: 8px 24px;
    width: auto;
    border-bottom: none;
    border-radius: 0;
    min-height: 48px;
  }

  .nav .theme-toggle,
  .nav .lang-toggle {
    margin: 8px 24px;
    align-self: flex-start;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .faq-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 4vw 24px;
  }

  .hero-content h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  /* Pixel font legibility */
  .eyebrow {
    font-size: 0.58rem !important;
    letter-spacing: 0.1em;
  }

  .btn {
    min-height: 48px;
    padding: 12px 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .screen-grid {
    grid-template-columns: 1fr;
  }

  .changelog .timeline {
    padding-left: 16px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 24px 4vw;
  }
}

@media (max-width: 360px) {
  .hero-content h1 { font-size: 1.5rem; }
  .btn { padding: 10px 14px; font-size: 0.85rem; }
}

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

/* ── Accessibility: focus-visible ── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Back-to-top button ── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(255, 122, 26, 0.35);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  transform: translateY(-3px);
}

/* ── Active nav link ── */
.nav a.nav-active {
  color: var(--accent);
  font-weight: 600;
}

/* ════════════════════════════════════════
   PIXEL ENHANCEMENTS — SCode Studio
   ════════════════════════════════════════ */

@keyframes sc-glitch {
  0%, 88%, 100% { transform: none; text-shadow: none; }
  89% { transform: translate(-3px, 0); text-shadow: 3px 0 rgba(59,210,162,0.8); }
  90% { transform: translate(3px, 1px); text-shadow: -3px 0 rgba(255,122,26,0.8); }
  91% { transform: translate(-1px,-1px); text-shadow: 2px 0 rgba(59,210,162,0.6); }
  92% { transform: none; text-shadow: none; }
}

@keyframes sc-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes sc-glow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 12px var(--accent), 0 0 24px rgba(255,122,26,0.35); }
}

@keyframes sc-float {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.6; }
  92%  { opacity: 0.35; }
  100% { transform: translateY(-110vh) rotate(200deg); opacity: 0; }
}

@keyframes sc-spark {
  0%   { transform: translate(-50%,-50%) translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-50%) translate(var(--dx),var(--dy)) scale(0); opacity: 0; }
}

/* Scanline CRT */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.03) 3px, rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 9990;
}

/* Floating pixels */
.px-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.px-dot { position: absolute; bottom: -8px; animation: sc-float linear infinite; }

/* Click sparks */
.px-spark { position: fixed; pointer-events: none; z-index: 9999; animation: sc-spark 0.55s steps(8) forwards; }

/* Hero h1 glitch */
.hero-content h1 { animation: sc-glitch 10s steps(1) infinite; }

/* Gradient on hero h1 */
.hero-content h1 {
  background: linear-gradient(120deg, var(--ink) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Eyebrow — pixel font + blink */
.eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  letter-spacing: 0.14em;
}
.eyebrow::after { content: "_"; animation: sc-blink 1s step-end infinite; }

/* Feature cards — pixel hover */
.feature-card {
  border-radius: 0;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
}
.feature-card:hover {
  transform: translate(-3px,-3px);
  box-shadow: 6px 6px 0 rgba(255,122,26,0.28);
  border-color: var(--accent);
}

/* Buttons — square + pixel shadow */
.btn { border-radius: 0; }
.btn.primary:hover {
  transform: translate(-2px,-2px);
  box-shadow: 4px 4px 0 #7a3000 !important;
}
.btn.ghost:hover {
  transform: translate(-2px,-2px);
  box-shadow: 4px 4px 0 rgba(16,24,40,0.18) !important;
}

/* Download CTA — pixel border */
.section.cta {
  border-radius: 0;
  border-left: 3px solid var(--accent);
}

/* Timeline items — sharp */
.timeline-item { border-radius: 0; }

/* FAQ cards */
.faq-card { border-radius: 0; }

/* Back-to-top — pixel */
.back-to-top {
  border-radius: 0;
  border: 2px solid #7a3000;
  box-shadow: 3px 3px 0 #7a3000;
}
.back-to-top:hover {
  transform: translate(-2px,-2px);
  box-shadow: 5px 5px 0 #7a3000;
}

