/* ----------------------------------------
   Custom properties
---------------------------------------- */
:root {
  --color-bg: #f8f7f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-border: #e0ddd8;
  --color-accent: #3a7bd5;
  --color-accent-hover: #2f65b8;

  --color-hero-bg: #0c0e14;
  --color-hero-text: #f0f0f0;
  --color-hero-muted: #a0a8b8;
  --color-hero-accent: #5b8dee;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --max-width: 1100px;
  --radius: 12px;
}

/* ----------------------------------------
   Reset & base
---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ----------------------------------------
   Header
---------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 7px;
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.header-tagline {
  font-size: 0.72rem;
  color: var(--color-hero-muted);
}

.header-nav {
  display: flex;
  gap: var(--space-md);
}

.header-nav a {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  transition: color 0.15s;
}

.header-nav a:hover { color: #ffffff; }

/* ----------------------------------------
   Buttons
---------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: none;
  text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-hero-accent);
  color: #ffffff;
}

.btn-primary:hover { background: #4a7de0; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-hero-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }

/* ----------------------------------------
   Section shell
---------------------------------------- */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* ----------------------------------------
   Hero
---------------------------------------- */
.hero {
  background: var(--color-hero-bg);
  color: var(--color-hero-text);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-content { max-width: 520px; }

.hero-app-name {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-xs);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-hero-muted);
  margin-bottom: var(--space-md);
}

.hero-pitch {
  font-size: 1.05rem;
  color: var(--color-hero-muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.hero-ctas {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  border-radius: 54px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------
   Features
---------------------------------------- */
.features { background: var(--color-surface); }

.features h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.features-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 680px;
  margin-bottom: var(--space-lg);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: var(--space-lg);
}

.feature-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.features-screenshot img {
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------
   About
---------------------------------------- */
.about { background: var(--color-bg); }

.about-inner { max-width: 640px; }

.about h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.about p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

/* ----------------------------------------
   Support / Contact
---------------------------------------- */
.support { background: var(--color-surface); }

.support h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.support-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.support-links {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.support-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.support-links a:hover { color: var(--color-accent-hover); }

/* ----------------------------------------
   Contact form
---------------------------------------- */
.contact-form { max-width: 560px; }

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.15);
}

.form-group textarea { resize: vertical; }

.contact-form .btn { margin-top: 0.5rem; }

.form-status {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-status.success { color: #2a7a4b; }
.form-status.error { color: #c0392b; }

/* ----------------------------------------
   Footer
---------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover { color: var(--color-text); }

/* ----------------------------------------
   Letternaut — hero starfield
---------------------------------------- */
.ln-hero { position: relative; }

.ln-hero .hero-inner { position: relative; z-index: 2; }

.ln-starfield {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ln-star-dot {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  animation: ln-twinkle 3s ease-in-out infinite;
}

@keyframes ln-twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

.ln-hero .hero-visual {
  flex-direction: column;
  gap: var(--space-md);
}
.ln-try-cue {
  font-size: 0.9rem;
  color: var(--color-hero-muted);
  text-align: center;
}
.ln-try-cue strong { color: var(--color-hero-accent); font-weight: 600; }

/* ----------------------------------------
   Letternaut — interactive watch demo
---------------------------------------- */
.ln-watch {
  position: relative;
  width: 236px;
  height: 286px;
  padding: 18px 16px;
  border-radius: 60px;
  background: linear-gradient(150deg, #3a3d44 0%, #1c1e23 55%, #2b2d33 100%);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    inset 0 -2px 4px rgba(0, 0, 0, 0.5);
}

.ln-crown {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 46px;
  border-radius: 4px;
  background: linear-gradient(90deg, #4a4d55, #23252b);
}

.ln-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  background: #080b13;
  overflow: hidden;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: #e7eaf4;
}

.ln-stage {
  position: absolute;
  inset: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
}
.ln-stage[hidden] { display: none; }

/* --- Playing state --- */
.ln-topbar {
  position: relative;
  height: 16px;
  margin-bottom: 8px;
}
.ln-cat {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: #aeb6cf;
  letter-spacing: 0.02em;
}
.ln-time {
  position: absolute;
  top: -1px;
  right: 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: #ffffff;
}

.ln-word {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 26px;
  margin-bottom: 9px;
}
.ln-tile {
  width: 15px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-hero-accent);
  border-bottom: 2px solid rgba(91, 141, 238, 0.7);
  line-height: 1.3;
}
.ln-tile-blank {
  border-bottom: none;
  height: 22px;
  border-radius: 4px;
  background: #222a40;
}
.ln-tile-blank.is-filled {
  background: transparent;
  border-bottom: 2px solid rgba(91, 141, 238, 0.7);
  animation: ln-pop-tile 0.4s ease;
}
@keyframes ln-pop-tile {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); opacity: 1; }
}

.ln-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.ln-playarea {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}
.ln-astro {
  width: 46%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ln-astro svg { max-height: 92px; width: auto; }

/* Right column: the carousel is the only tap target. */
.ln-pickwrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.ln-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  padding: 3px 5px;
  transition: background 0.15s, box-shadow 0.15s;
}
.ln-picker:hover { background: rgba(91, 141, 238, 0.1); }
.ln-picker:focus-visible {
  outline: 2px solid var(--color-hero-accent);
  outline-offset: 2px;
}
.ln-watch.is-solving .ln-picker,
.ln-watch.is-solved .ln-picker { cursor: default; }

.ln-pk {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.ln-pk-1 { color: rgba(174, 182, 207, 0.55); }
.ln-pk-2 { color: rgba(174, 182, 207, 0.28); }
.ln-pk-sel {
  color: #ffffff;
  background: rgba(91, 141, 238, 0.22);
  border: 1px solid rgba(91, 141, 238, 0.5);
  border-radius: 6px;
  padding: 1px 0;
  animation: ln-sel-glow 1.6s ease-in-out infinite;
}
@keyframes ln-sel-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(91, 141, 238, 0); }
  50% { box-shadow: 0 0 9px rgba(91, 141, 238, 0.6); }
}

.ln-tap-cue {
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-hero-accent);
  animation: ln-cue-pulse 1.6s ease-in-out infinite;
}
@keyframes ln-cue-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.ln-watch.is-solving .ln-tap-cue,
.ln-watch.is-solved .ln-tap-cue { display: none; }

/* --- Win state --- */
.ln-stage-win {
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.ln-stars-row { display: flex; gap: 8px; }
.ln-star {
  font-size: 1.5rem;
  color: #f5c542;
  transform: scale(0);
}
.ln-stage-win.is-on .ln-star { animation: ln-star-pop 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }
.ln-stage-win.is-on .ln-star:nth-child(1) { animation-delay: 0.05s; }
.ln-stage-win.is-on .ln-star:nth-child(2) { animation-delay: 0.2s; }
.ln-stage-win.is-on .ln-star:nth-child(3) { animation-delay: 0.35s; }
@keyframes ln-star-pop {
  0% { transform: scale(0) rotate(-30deg); }
  70% { transform: scale(1.3) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.ln-win-word {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffffff;
}
.ln-streak { font-size: 0.85rem; color: var(--color-hero-accent); font-weight: 600; }
.ln-replay {
  margin-top: 4px;
  font-family: inherit;
  font-size: 0.72rem;
  color: #aeb6cf;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ln-replay:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ----------------------------------------
   Letternaut — how to play
---------------------------------------- */
.ln-how { background: var(--color-bg); }
.ln-how h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}
.ln-how-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: var(--space-lg);
}
.ln-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  max-width: 680px;
  margin: 0 auto;
}
.ln-step { text-align: center; }
.ln-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.ln-step img {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.ln-step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.ln-step p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* ----------------------------------------
   Letternaut — gallery
---------------------------------------- */
/* Tighten the gap between the feature cards and the gallery heading. */
.ln-features .features-grid { margin-bottom: 0; }
.ln-features .section-inner { padding-bottom: var(--space-lg); }
.ln-gallery .section-inner { padding-top: var(--space-md); }

.ln-gallery { background: var(--color-surface); }
.ln-gallery h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}
.ln-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.ln-gallery figure { text-align: center; }
.ln-gallery img {
  width: 100%;
  max-width: 190px;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}
.ln-gallery figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .ln-star-dot,
  .ln-tap-cue,
  .ln-pk-sel,
  .ln-tile-blank.is-filled,
  .ln-stage-win.is-on .ln-star { animation: none; }
  .ln-stage-win.is-on .ln-star { transform: scale(1); }
}

/* ----------------------------------------
   Mobile
---------------------------------------- */
@media (max-width: 768px) {
  .header-inner { padding: 0.75rem var(--space-sm); }
  .header-tagline { display: none; }
  .header-nav { gap: var(--space-sm); }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: var(--space-lg) var(--space-sm);
    text-align: center;
  }

  .hero-ctas { justify-content: center; }

  .hero-visual { order: -1; }
  .hero-visual img { width: 180px; height: 180px; }

  .section-inner { padding: var(--space-lg) var(--space-sm); }

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

  .support-links { flex-direction: column; gap: var(--space-xs); }

  .ln-steps { grid-template-columns: 1fr; gap: var(--space-lg); }
  .ln-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .ln-try-cue { margin-top: var(--space-sm); }
}
