/* Paper-and-ink palette matching the app */
:root {
  --paper: #f4e6c8;
  --paper-soft: #fdf6e3;
  --paper-shadow: #ebdfc4;
  --ink: #2a1f14;
  --ink-soft: rgba(42, 31, 20, 0.7);
  --ink-faint: rgba(42, 31, 20, 0.3);
  --accent-gold: #b8862b;
  --accent-burgundy: #7a2e3e;
  --accent-teal: #2a6e7e;
  --neon-bg: #0a0420;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Language toggle behavior */
html[lang="nb"] [lang="en"] { display: none !important; }
html[lang="en"] [lang="nb"] { display: none !important; }

/* Language toggle UI */
.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px;
  border-radius: 22px;
  border: 1px solid var(--ink-faint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
  border: 0;
  background: transparent;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}

.lang-btn:hover { opacity: 0.7; }
.lang-btn.active {
  opacity: 1;
  background: rgba(42, 31, 20, 0.08);
}

/* Hero */
.hero {
  background: var(--neon-bg);
  color: #fff;
  padding: 80px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-art {
  width: 100%;
  max-width: 320px;
  margin-bottom: 32px;
}

.hero-art img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.hero-copy {
  max-width: 640px;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #f4e6c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0 auto 16px;
  max-width: 580px;
  color: rgba(255, 255, 255, 0.95);
}

.hero-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.cta-badge {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
}

.cta-badge.alt {
  background: rgba(255, 255, 255, 0.06);
}

/* Official "Download on the App Store" badge button. */
.store-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.store-badge svg {
  height: 44px;
  width: auto;
  display: block;
}

.store-badge:hover,
.store-badge:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  outline: none;
}

/* When the visitor is on iOS/iPadOS, draw attention to the App Store
   badge and dim the still-unreleased Google Play one. Class added by
   script.js. */
.ios .store-badge {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 8px 22px rgba(0, 0, 0, 0.4);
}

.ios .cta-badge.alt {
  opacity: 0.55;
}

/* Sections */
.section {
  max-width: 980px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
  line-height: 1.15;
}

.section .section-eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 16px;
}

.section .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 720px;
  margin-bottom: 24px;
}

.footnote {
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}

/* Premise stands out — slightly tighter */
.premise {
  padding-top: 60px;
  padding-bottom: 40px;
}

.premise .lead {
  font-size: 22px;
  color: var(--ink);
  max-width: 760px;
}

/* Hero promo player — button + inline video + caption box live in
   the same wrapper. Clicking the button hides it and reveals the
   video; the caption appears under both and updates word-by-word
   in JS using the cue timings shipped with the app. */
.hero-art-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-art {
  position: relative;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  display: block;
  width: 100%;
}
.hero-art:hover .hero-art-play,
.hero-art:focus-visible .hero-art-play {
  transform: scale(1.08);
  background: rgba(244, 230, 200, 1);
}
.hero-art-play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(244, 230, 200, 0.92);
  color: #2a1f14;
  font-size: 20px;
  line-height: 52px;
  text-align: center;
  padding-left: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, background 0.18s ease;
  pointer-events: none;
}
.hero-art-video {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  display: block;
  background: #000;
}
/* HTML's `hidden` attribute would normally apply display:none, but
   our explicit display rules on these elements override it. Restore
   the expected behaviour so the elements actually stay hidden until
   the trigger fires. */
.hero-art[hidden],
.hero-art-video[hidden],
.hero-art-caption[hidden] {
  display: none;
}
/* Caption box — paper-and-ink to match the in-app subtitle style.
   `min-height` reserves space so the page doesn't jump when the
   first cue appears. */
.hero-art-caption {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 9, 4, 0.78);
  color: #f4e6c8;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0.1px;
}

/* Roaming characters — three rebels that walk across the bottom of
   the page. PNG sprite sheets (3 frames × 64px) at assets/roamers/.
   pointer-events: none so they don't block real content. Hidden on
   small viewports and when the user prefers reduced motion. */
.roamers {
  position: fixed;
  inset: auto 0 0 0;
  /* Tall enough to fit roamer-5 which sits at bottom: 28 (so its top
     reaches 28 + 64 = 92px). 110px gives clearance + breathing room. */
  height: 110px;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.roamer {
  position: absolute;
  bottom: 12px;
  width: 64px;
  height: 64px;
  background-repeat: no-repeat;
  background-size: 192px 64px;
  opacity: 0.55;
  will-change: transform, background-position;
}
.roamer-1 {
  background-image: url('assets/roamers/1-walk-happy.png');
  /* 4-frame variant (256×64). Overrides the shared 192×64 default. */
  background-size: 256px 64px;
  animation:
    roamer-walk-frames-4 0.6s steps(1) infinite,
    roamer-cross-slow 60s linear infinite;
}
.roamer-5 {
  background-image: url('assets/roamers/5-walk-sneaky.png');
  animation:
    roamer-walk-frames 0.45s steps(1) infinite,
    roamer-cross-med 45s linear infinite;
  animation-delay: -15s;
  bottom: 28px;
}
.roamer-9 {
  background-image: url('assets/roamers/9-walk-angry.png');
  animation:
    roamer-walk-frames 0.3s steps(1) infinite,
    roamer-cross-fast 30s linear infinite;
  animation-delay: -8s;
  bottom: 2px;
}

/* 3-frame sprite-sheet cycle: each frame occupies 64px of the 192px
   PNG. steps(1) keeps each frame visible for its share of the cycle
   rather than tweening between. */
@keyframes roamer-walk-frames {
  0%, 33.32% {
    background-position: 0 0;
  }
  33.33%, 66.65% {
    background-position: -64px 0;
  }
  66.66%, 100% {
    background-position: -128px 0;
  }
}

/* 4-frame variant for sprite-sheets that are 256×64 (4 × 64px). */
@keyframes roamer-walk-frames-4 {
  0%, 24.99% {
    background-position: 0 0;
  }
  25%, 49.99% {
    background-position: -64px 0;
  }
  50%, 74.99% {
    background-position: -128px 0;
  }
  75%, 100% {
    background-position: -192px 0;
  }
}
@keyframes roamer-cross-slow {
  0% { transform: translateX(-80px); }
  100% { transform: translateX(calc(100vw + 80px)); }
}
@keyframes roamer-cross-med {
  0% { transform: translateX(calc(100vw + 80px)); }
  100% { transform: translateX(-80px); }
}
@keyframes roamer-cross-fast {
  0% { transform: translateX(-80px); }
  100% { transform: translateX(calc(100vw + 80px)); }
}

/* Hide on phones — the screen is too small for ambient mascots */
@media (max-width: 768px) {
  .roamers { display: none; }
}

/* Respect motion preferences — turn the roamers off completely for
   users who've asked the OS for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .roamers { display: none; }
}

/* Mechanics — 2x2 card grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.card {
  background: #fff;
  border: 1px solid var(--ink-faint);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 2px 8px rgba(42, 31, 20, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 31, 20, 0.1);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}

.card p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Characters */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.char {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--ink-faint);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(42, 31, 20, 0.05);
}

.char-glyph {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: var(--fill, var(--ink));
  text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.15);
  min-width: 44px;
  text-align: center;
  display: inline-block;
}

/* Character card avatar. Default: brand-tinted box with a large
   styled digit/letter glyph as fallback when no sprite exists yet.
   When a .char-N rule below sets a background-image, that takes
   over and we hide the fallback text via color: transparent. */
.char-vid {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background-color: color-mix(in srgb, var(--fill, #2a1f14) 18%, #ffffff);
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 900;
  color: var(--fill, #2a1f14);
  text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  overflow: hidden;
}

/* Per-character image overrides. Animated cards (1, 5, 9) reuse the
   roamer sprite-sheets; static cards (2-4, 6-8, A-C) point at a
   single 64×64 portrait scaled to 72×72. Either way the text glyph
   is hidden so the image stands alone. */
.char-vid.char-static {
  background-position: center;
  background-size: 72px 72px;
  color: transparent;
  text-shadow: none;
}
.char-vid.char-1 {
  background-image: url('assets/roamers/1-walk-happy.png');
  background-size: 288px 72px;
  color: transparent;
  text-shadow: none;
  animation: char-sprite-4 0.6s steps(1) infinite;
}
.char-vid.char-2 { background-image: url('assets/characters/2.png'); }
.char-vid.char-3 { background-image: url('assets/characters/3.png'); }
.char-vid.char-4 { background-image: url('assets/characters/4.png'); }
.char-vid.char-5 {
  background-image: url('assets/roamers/5-walk-sneaky.png');
  background-size: 216px 72px;
  color: transparent;
  text-shadow: none;
  animation: char-sprite-3 0.4s steps(1) infinite;
}
.char-vid.char-6 { background-image: url('assets/characters/6.png'); }
.char-vid.char-7 { background-image: url('assets/characters/7.png'); }
.char-vid.char-8 { background-image: url('assets/characters/8.png'); }
.char-vid.char-9 {
  background-image: url('assets/roamers/9-walk-angry.png');
  background-size: 216px 72px;
  color: transparent;
  text-shadow: none;
  animation: char-sprite-3 0.4s steps(1) infinite;
}
.char-vid.char-a { background-image: url('assets/characters/a.png'); }
.char-vid.char-b { background-image: url('assets/characters/b.png'); }
.char-vid.char-c { background-image: url('assets/characters/c.png'); }

/* Card-slot frame cycles. Distinct from the roamer keyframes because
   the card sprites are scaled (216×72 / 288×72), so offsets shift by
   72px per frame instead of 64. */
@keyframes char-sprite-3 {
  0%, 33.32%   { background-position: 0     0; }
  33.33%, 66.65% { background-position: -72px 0; }
  66.66%, 100% { background-position: -144px 0; }
}
@keyframes char-sprite-4 {
  0%, 24.99%   { background-position: 0     0; }
  25%, 49.99%  { background-position: -72px 0; }
  50%, 74.99%  { background-position: -144px 0; }
  75%, 100%    { background-position: -216px 0; }
}

.char-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.char-info b {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.char-info span {
  font-size: 13px;
  color: var(--ink-soft);
}

/* Boards */
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.board {
  background: var(--bg, var(--paper));
  border: 1px solid var(--ink-faint);
  border-radius: 18px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 130px;
  position: relative;
  overflow: hidden;
}

.board::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  filter: blur(30px);
}

.board-icon {
  font-size: 32px;
  line-height: 1;
}

.board-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 4px;
}

.board-diff {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  margin-top: auto;
  padding-top: 8px;
}

/* Features */
.features-list {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.features-list li {
  background: var(--paper-soft);
  border-left: 4px solid var(--accent-gold);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.features-list li b {
  color: var(--accent-burgundy);
  font-weight: 800;
}

/* CTA */
.cta {
  background: var(--paper-shadow);
  border-radius: 28px;
  margin: 60px 24px;
  text-align: center;
  padding: 60px 28px;
  max-width: none;
}

.cta h2 {
  margin-bottom: 14px;
}

.cta p {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.55;
}

.cta-button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 16px 32px;
  border-radius: 28px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(42, 31, 20, 0.2);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(42, 31, 20, 0.3);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: rgba(244, 230, 200, 0.7);
  text-align: center;
  padding: 40px 24px;
  font-size: 14px;
}

.site-footer p {
  margin-bottom: 8px;
}

.site-footer .footer-meta {
  font-size: 12px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 600px) {
  .hero {
    padding: 60px 20px 40px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-tagline {
    font-size: 17px;
  }

  .section {
    padding: 60px 20px;
  }

  .section h2 {
    font-size: 26px;
  }

  .premise .lead {
    font-size: 19px;
  }

  .cta {
    margin: 40px 16px;
    padding: 40px 24px;
  }
}

/* =====================================================================
   CONTACT PAGE
   Subpage layout shared with the t1mcode.tech family of app sites —
   matches PeakCondition's contact form pattern but tinted to the
   paper-and-ink palette of this app.
   ===================================================================== */

.contact-page {
  background: var(--paper);
  color: var(--ink);
}

.page-nav {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-faint);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.page-nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.page-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.back-link {
  display: inline-block;
  color: var(--accent-burgundy);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
  transition: opacity 0.15s;
}

.back-link:hover {
  opacity: 0.7;
}

.page-header {
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--ink-faint);
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  color: var(--ink);
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
}

.breadcrumb a {
  color: var(--accent-burgundy);
  text-decoration: none;
  font-weight: 600;
}

.content-section {
  background: #ffffff;
  border: 1px solid var(--ink-faint);
  border-radius: 18px;
  padding: 28px 26px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(42, 31, 20, 0.05);
}

.content-section h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}

.content-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 18px;
  margin-bottom: 6px;
}

.content-section p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 12px;
}

/* Contact form */
.contact-form {
  margin-top: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  transition: border-color 0.15s, background-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-burgundy);
  background: #ffffff;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
}

.submit-btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.4px;
  padding: 13px 26px;
  border-radius: 22px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(42, 31, 20, 0.18);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(42, 31, 20, 0.26);
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Alert / response box */
.alert {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.alert-success {
  background: rgba(63, 112, 72, 0.12);
  color: #2d5634;
  border: 1px solid rgba(63, 112, 72, 0.35);
}

.alert-error {
  background: rgba(122, 46, 62, 0.10);
  color: var(--accent-burgundy);
  border: 1px solid rgba(122, 46, 62, 0.32);
}

.page-footer {
  margin-top: 32px;
  border-radius: 18px;
  padding: 28px 24px;
}

.effective-date {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.75;
}

.page-footer a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}

.page-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .page-header h1 {
    font-size: 26px;
  }

  .content-section {
    padding: 22px 20px;
  }
}
