:root {
  --bg-page: #fbf8f3;
  --bg-sky: #e8f4fa;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f5f2eb;
  --bg-badge: #e6f4ea;
  --bg-accent-soft: #fff3e8;
  --bg-teal-soft: #e6f6f7;
  --border-subtle: #ddd7cc;
  --border-strong: #c9c0b1;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #526071;
  --brand-green: #2e7d32;
  --brand-green-hover: #246528;
  --brand-green-text: #1b5e20;
  --accent-tangerine: #e06d1f;
  --accent-tangerine-text: #a84908;
  --accent-teal: #0e7c86;
  --focus-ring: #0e7c86;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0f172a;
    --bg-sky: #132238;
    --bg-surface: #182334;
    --bg-surface-alt: #1f2d42;
    --bg-badge: #173322;
    --bg-accent-soft: #332215;
    --bg-teal-soft: #132f36;
    --border-subtle: #2c3b52;
    --border-strong: #3c4f6c;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --brand-green: #81c784;
    --brand-green-hover: #9ad69c;
    --brand-green-text: #a5d6a7;
    --accent-tangerine: #f6a25e;
    --accent-tangerine-text: #ffb980;
    --accent-teal: #4fd1c5;
    --focus-ring: #4fd1c5;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-page);
  background-image: linear-gradient(180deg, var(--bg-sky) 0%, var(--bg-page) 440px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a {
  color: var(--brand-green-text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-teal);
}

a:focus-visible,
button:focus-visible,
video:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap--narrow {
  max-width: 820px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: color-mix(in srgb, var(--bg-surface) 90%, transparent);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  min-height: 44px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-secondary);
}

.nav-list a:hover {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.back-link:hover {
  border-color: var(--brand-green-text);
}

/* Hero */
.hero {
  padding: 36px 0 32px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-badge);
  border: 1px solid var(--border-subtle);
  color: var(--brand-green-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-tangerine);
  flex-shrink: 0;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 4.4vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-lead {
  margin: 0 0 20px;
  max-width: 66ch;
  font-size: 18px;
  color: var(--text-secondary);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-primary {
  border: 1px solid var(--brand-green);
  background-color: var(--brand-green);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #0b1910;
  }

  .btn-primary:hover {
    color: #0b1910;
  }
}

.btn-secondary {
  border: 1px solid var(--brand-green);
  background-color: var(--bg-badge);
  color: var(--brand-green-text);
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  color: var(--brand-green-text);
}

.btn-outline {
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--brand-green);
  color: var(--brand-green-text);
}

.hero-tiles {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: stretch;
}

.hero-tiles > * {
  min-width: 0;
}

.hero-tiles .wordplay-card {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

/* Video Figures */
.video-card {
  margin: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.video-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #0f172a;
  border: 1px solid var(--border-subtle);
}

.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: #0f172a;
}

.video-caption {
  margin: 0;
  padding: 2px 4px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Testimonial Quote Carousel */
.quote-carousel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--accent-tangerine);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.sally-quote {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  min-height: 160px;
  transition: opacity 200ms ease;
}

.sally-quote.is-fading {
  opacity: 0;
}

.sally-quote p {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text-primary);
}

.sally-quote cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-tangerine-text);
}

.quote-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.quote-nav-group,
.quote-meta-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.quote-btn:hover {
  border-color: var(--brand-green);
  color: var(--brand-green-text);
}

.quote-btn[aria-pressed="true"] {
  background-color: var(--bg-accent-soft);
  border-color: var(--accent-tangerine);
  color: var(--accent-tangerine-text);
}

.quote-counter {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Slide the S Wordplay Showcase */
.wordplay-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.wordplay-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wordplay-eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-teal);
}

.wordplay-stage {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: clamp(1.75rem, 3.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  max-width: 100%;
}

.wp-villager {
  order: 1;
}

.wp-s {
  order: 2;
  display: inline-block;
  padding: 0 6px;
  margin: 0 1px;
  border-radius: 8px;
  background-color: var(--bg-accent-soft);
  border: 1.5px solid var(--accent-tangerine);
  color: var(--accent-tangerine-text);
  font-weight: 900;
  will-change: transform;
}

.wp-gap {
  order: 3;
  display: inline-block;
  width: 0.34em;
}

.wp-ally {
  order: 4;
  display: inline-flex;
  align-items: baseline;
}

.wordplay-stage[data-mode="sally"] .wp-gap {
  order: 2;
}

.wordplay-stage[data-mode="sally"] .wp-s {
  order: 3;
  text-transform: uppercase;
}

.wordplay-stage[data-mode="sally"] .wp-a {
  text-transform: lowercase;
}

.wordplay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--brand-green);
  background-color: var(--brand-green);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .wordplay-btn {
    color: #0b1910;
  }
}

.wordplay-btn:hover {
  background-color: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
}

.wordplay-caption {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
}

.wordplay-static-hint {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 32px 0;
}

.section-header {
  margin-bottom: 22px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-green-text);
  margin-bottom: 6px;
}

h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--text-primary);
}

.section-subtitle {
  margin: 0;
  color: var(--text-secondary);
  max-width: 68ch;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.module-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.module-card--optional {
  grid-column: 1 / -1;
}

.module-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-teal-soft);
  color: var(--accent-teal);
}

.module-icon--tangerine {
  background-color: var(--bg-accent-soft);
  color: var(--accent-tangerine-text);
}

.module-icon--green {
  background-color: var(--bg-badge);
  color: var(--brand-green-text);
}

.module-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: var(--text-primary);
}

.module-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-teal-soft);
  border: 1px solid var(--border-subtle);
  color: var(--accent-teal);
  font-size: 13px;
  font-weight: 700;
}

.module-card p {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
}

.module-note {
  font-size: 14px;
  color: var(--text-muted);
}

.module-optional-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.module-optional-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Install Section */
.install-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 24px;
}

.install-intro-copy {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.install-intro-copy h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.install-intro-copy p {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-secondary);
}

.install-intro-copy p:last-child {
  margin-bottom: 0;
}

.device-guide-shell {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.device-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.device-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.device-tab:hover {
  border-color: var(--brand-green);
  color: var(--brand-green-text);
}

.device-tab[aria-selected="true"] {
  background-color: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .device-tab[aria-selected="true"] {
    color: #0b1910;
  }
}

.device-panel[hidden] {
  display: none;
}

.device-panel h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--text-primary);
}

.device-panel h4 {
  margin: 18px 0 8px;
  font-size: 17px;
  color: var(--brand-green-text);
}

.device-steps {
  margin: 10px 0 16px;
  padding-left: 22px;
}

.device-steps li {
  color: var(--text-secondary);
  font-size: 16px;
}

.device-steps li + li {
  margin-top: 8px;
}

.device-callout {
  background-color: var(--bg-accent-soft);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-tangerine);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 15px;
  color: var(--text-primary);
}

.device-tip {
  background-color: var(--bg-badge);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-green);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--text-primary);
}

.tips-heading {
  margin: 28px 0 14px;
  font-size: 21px;
  color: var(--text-primary);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tip-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.tip-card h4 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--brand-green-text);
}

.tip-card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* About & Access Callout */
.about-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.about-copy p {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--text-secondary);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.access-box {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.access-box h3 {
  margin: 0;
  font-size: 19px;
}

.access-box p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.contact-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}

/* Legal & Document Pages */
.doc-main {
  padding: 32px 0 24px;
}

.doc-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
}

.doc-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  line-height: 1.2;
}

.effective-date {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--text-muted);
}

.doc-card h2 {
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 20px;
  line-height: 1.3;
  color: var(--brand-green-text);
}

.doc-card p,
.doc-card li {
  color: var(--text-secondary);
  font-size: 16px;
}

.doc-card ul {
  padding-left: 22px;
  margin: 10px 0 16px;
}

.doc-card li + li {
  margin-top: 8px;
}

code {
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
}

/* Footer */
.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--border-subtle);
  padding: 26px 0 40px;
  font-size: 15px;
  color: var(--text-muted);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.disclaimer {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .hero-tiles,
  .modules-grid,
  .module-optional-layout,
  .install-intro-grid,
  .tips-grid,
  .about-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 26px;
  }
}

@media (max-width: 640px) {
  .sally-quote {
    min-height: 185px;
  }

  .doc-card,
  .about-card,
  .device-guide-shell {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .wp-s,
  .sally-quote,
  .btn-primary,
  .btn-secondary,
  .btn-outline {
    transition: none !important;
  }
}
