/* Dark only. The colors follow the app's dark theme (K-Whisper docs/DESIGN.md): desk, sheet, signal blue,
   and the caption band. */
:root {
  --desk: #121417;
  --sheet: #1b1f23;
  --sheet-hover: #23282d;
  --deep: #0c0e10;
  --ink: #e8ebee;
  --graphite: #a2abb4;
  --faint: #78818a;
  --rule: #2c3137;
  --rule-strong: #3d444b;
  --accent: #3a73c0;
  --accent-hover: #3166ae;
  --accent-text: #7fb0ee;
  --accent-soft: #1c3150;
  --band: #08090b;
  --band-text: #f4f2ea;
  --band-progress: #5b9be8;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Montserrat", var(--font);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --bs-body-font-family: var(--font);
  --bs-body-bg: var(--desk);
  --bs-body-color: var(--ink);
  --bs-link-color-rgb: 127, 176, 238;
  --bs-link-hover-color-rgb: 168, 202, 245;
  --bs-border-color: var(--rule);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

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

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  padding-bottom: clamp(5rem, 3.5rem + 5vw, 8.5rem);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem);
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
  text-align: center;
}

h3 {
  font-size: 1.1rem;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.btn {
  font-weight: 600;
  border-radius: 6px;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
}

.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--rule-strong);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--sheet-hover);
  --bs-btn-hover-border-color: var(--graphite);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: var(--sheet-hover);
  --bs-btn-active-border-color: var(--graphite);
}

/* Header */
.site-header {
  padding: 1.1rem 0;

  .brand img {
    height: 4.4rem;
    width: auto;
    display: block;

    @media (max-width: 575.98px) {
      height: 3.2rem;
    }
  }
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  margin-right: 0.75rem;

  a {
    color: var(--graphite);
    font-weight: 600;
    text-decoration: none;

    &:hover {
      color: var(--ink);
    }
  }

  @media (max-width: 767.98px) {
    display: none;
  }
}

.icon-link-btn {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--graphite);
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;

  &:hover {
    color: var(--ink);
  }
}

/* Hero */
.hero {
  padding: clamp(2rem, 1rem + 4vw, 4.5rem) 0 0;
}

.hero-grid {
  display: grid;
  justify-items: center;
  gap: clamp(2.25rem, 1.5rem + 2vw, 3.25rem);
  text-align: center;
}

.hero-text {
  h1 {
    font-size: clamp(2.3rem, 1.4rem + 3vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    max-width: 16ch;
    margin: 0 auto 1.25rem;
  }

  .lede {
    color: var(--graphite);
    font-size: 1.2rem;
    max-width: 36rem;
    margin: 0 auto 2rem;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;

  .btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: 1.1rem;
  }

  .btn-link {
    --bs-btn-color: var(--accent-text);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-color: var(--ink);
    font-weight: 600;
    text-decoration: none;
  }
}

.hero-note {
  margin: 1rem 0 0;
  color: var(--faint);
  font-size: 0.95rem;
}

/* The caption band: the app's live caption, set as a subtitle cue with its timecode. */
.caption-band {
  position: relative;
  margin: 0;
  padding: 1.5rem 1.75rem 1.9rem;
  background: var(--band);
  color: var(--band-text);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 44rem;
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  @media (max-width: 575.98px) {
    min-height: 9rem;
    padding: 1.25rem 1.25rem 1.6rem;
  }
}

.cue-meta {
  display: flex;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: rgba(244, 242, 234, 0.5);
  margin-bottom: 0.6rem;
}

.cue-text {
  margin: 0;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.6em;

  .word {
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
  }

  .word.shown {
    opacity: 1;
  }
}

.cue-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(244, 242, 234, 0.08);

  span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--band-progress);
    transform-origin: left;
    transform: scaleX(0.46);
  }
}

/* Screenshots */
.shot {
  border-radius: 10px;
  overflow: hidden;
  background: var(--sheet);
  box-shadow:
    0 0 0 1px var(--rule),
    0 24px 48px -24px rgba(0, 0, 0, 0.7);

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

.hero-shot {
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}

/* Sections */
.section {
  padding: clamp(3.5rem, 2rem + 4vw, 6rem) 0 0;
}

.section-lede {
  color: var(--graphite);
  max-width: 44rem;
  margin: -1rem auto 2.25rem;
  text-align: center;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem 3rem;

  @media (max-width: 991.98px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (max-width: 575.98px) {
    grid-template-columns: 1fr;
  }

  li {
    border-top: 1px solid var(--rule);
    padding-top: 1.4rem;
    text-align: center;
  }

  .bi {
    display: block;
    font-size: 1.6rem;
    color: var(--accent-text);
    margin-bottom: 0.6rem;
  }

  h3 {
    margin-bottom: 0.4rem;
  }

  p {
    color: var(--graphite);
    margin: 0 auto;
    max-width: 34ch;
  }
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;

  @media (max-width: 991.98px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (max-width: 575.98px) {
    grid-template-columns: 1fr;
  }

  li {
    counter-increment: step;
    position: relative;
    padding-top: 2.75rem;
    color: var(--graphite);
    text-align: center;

    &::before {
      content: counter(step);
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 1.9rem;
      height: 1.9rem;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: var(--accent-soft);
      color: var(--accent-text);
      font-family: var(--display);
      font-weight: 700;
      font-size: 0.95rem;
    }
  }
}

.screens {
  display: grid;
  /* Ratios make the 16:10 and the tall screenshot the same height. */
  grid-template-columns: minmax(0, 1.96fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;

  @media (max-width: 767.98px) {
    grid-template-columns: 1fr;

    .screen-tall {
      max-width: 26rem;
      margin: 0 auto;
    }
  }

  figure {
    margin: 0;
  }

  figcaption {
    margin: 0.9rem auto 0;
    color: var(--graphite);
    font-size: 0.95rem;
    max-width: 52ch;
    text-align: center;
  }
}

/* Download */
.section-download {
  .download-unavailable {
    padding: 0.9rem 1.1rem;
    border-radius: 6px;
    background: var(--accent-soft);
  }
}

.systems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;

  @media (max-width: 991.98px) {
    grid-template-columns: 1fr;
  }
}

.system {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.4rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;

  &.is-yours {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);

    @media (max-width: 991.98px) {
      order: -1;
    }
  }
}

.system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;

  h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    margin: 0;
  }
}

.os-icon {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--deep);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;

  svg {
    width: 1.2rem;
    height: 1.2rem;
  }
}

.yours-tag {
  display: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;

  .is-yours & {
    display: inline-block;
  }
}

.variant + .variant {
  margin-top: 1.1rem;
}

.variant-name {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.variant-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-file {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;

  small {
    font-weight: 400;
    opacity: 0.75;
  }
}

.system-note {
  margin: auto 0 0;
  padding-top: 1.1rem;
  color: var(--faint);
  font-size: 0.9rem;
}

.all-releases {
  margin: 1.5rem 0 0;
  text-align: center;
}

.first-launch {
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  text-align: center;

  h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  > p {
    color: var(--graphite);
    max-width: 40rem;
    margin: 0 auto 2rem;
  }

  dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem 2.5rem;
    margin: 0;

    @media (max-width: 991.98px) {
      grid-template-columns: 1fr;
      max-width: 36rem;
      margin: 0 auto;
    }
  }

  dt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;

    .os-icon {
      width: 1.9rem;
      height: 1.9rem;
      font-size: 1rem;

      svg {
        width: 1rem;
        height: 1rem;
      }
    }
  }

  dd {
    margin: 0;
    color: var(--graphite);
    font-size: 0.95rem;
  }
}

/* FAQ */
.faq {
  max-width: 52rem;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;

  details {
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: 10px;
    transition: border-color 0.2s ease;

    &:hover,
    &[open]:not(.closing) {
      border-color: var(--rule-strong);
    }
  }

  summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.4rem;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;

    &::-webkit-details-marker {
      display: none;
    }

    .bi {
      flex: none;
      color: var(--graphite);
      transition: transform 0.26s var(--ease-out);
    }
  }

  details[open]:not(.closing) summary .bi {
    transform: rotate(180deg);
  }

  .faq-answer {
    overflow: hidden;
  }

  p {
    color: var(--graphite);
    margin: 0;
    padding: 0 1.4rem 1.25rem;
    max-width: 70ch;
  }
}

/* Footer (same layout as the other Karlosoft projects) */
.app-footer {
  flex-shrink: 0;
  padding: 3.25rem 0 2.5rem;
  background: var(--deep);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, #3f4775 25%, #479af4 75%, transparent 100%) 1;
  color: var(--faint);
  font-size: 0.95rem;

  h5 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.9rem;
  }

  p {
    line-height: 1.6;
  }

  a {
    color: var(--graphite);
    text-decoration: none;
    transition: color 0.15s ease;

    &:hover,
    &:focus-visible {
      color: var(--ink);
    }
  }

  p a {
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 3px;
  }

  ul li {
    margin-bottom: 0.45rem;
  }
}

/* Language picker, shown once there is more than one language */
.lang-modal {
  .modal-content {
    background: var(--desk);
    border: 0;
    border-radius: 0;
  }

  .modal-header {
    align-items: flex-start;
    border: 0;
    padding: 2rem 2rem 0.5rem;
  }

  .modal-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
  }

  .modal-header p {
    color: var(--graphite);
    margin: 0;
  }

  .modal-body {
    padding: 1.5rem 2rem 2.5rem;
  }
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
}

.lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;

  img {
    height: 45px;
    width: auto;
    max-width: 100%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  }

  &:hover,
  &.active {
    color: var(--ink);
    background: var(--sheet);
    border-color: var(--rule);
  }
}
