/* Minimal, elegant, static site styling (no JS). */

:root {
  color-scheme: dark;
  /* Shared design language with the on-device control page (web/index.html):
     the same dark surfaces, and the four colours of the TinyTrip logo
     (yellow -> orange -> magenta -> blue) as the brand gradient. */
  --bg: #0b0e16;
  --bg2: #182036;
  --panel: #141a28;
  --panel2: #1b2334;
  --text: #e8ecf6;
  --muted: rgba(223, 230, 243, 0.66);
  --logo-yellow: #fffb00;
  --logo-orange: #ffae53;
  --logo-magenta: #ff2ae0;
  --logo-blue: #165efe;
  --accent: var(--logo-magenta);
  --accent-soft: rgba(255, 42, 224, 0.12);
  --accent-line: rgba(255, 42, 224, 0.35);
  --grad: linear-gradient(
    115deg,
    var(--logo-yellow),
    var(--logo-orange) 34%,
    var(--logo-magenta) 66%,
    var(--logo-blue)
  );
  --border: rgba(223, 230, 243, 0.12);
  --soft: rgba(223, 230, 243, 0.08);
  --soft2: rgba(223, 230, 243, 0.05);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.6;
  background: radial-gradient(1200px 600px at 18% -10%, var(--bg2), var(--bg) 60%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  opacity: 0.85;
}

.layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.layout > * {
  min-width: 0;
}

.sidenav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--bg));
}

.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 8px 22px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
}

.sidenav__brand:hover {
  opacity: 1;
}

/* Gradient is clipped to the word itself (not the whole flex box), so the
   full logo sweep is visible, same treatment everywhere. */
.brand-text,
.page-header__h1 {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.brand-mark {
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 7px rgba(255, 42, 224, 0.5)) drop-shadow(0 0 15px rgba(22, 94, 254, 0.3));
}

/* Hero lockup: mark + title + version badge on one aligned row,
   mirroring the on-device control page header. */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.hero-mark {
  width: 106px;
  height: 60px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(255, 42, 224, 0.45)) drop-shadow(0 0 30px rgba(22, 94, 254, 0.3));
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.hero-title .page-header__h1,
.hero-title .badge {
  margin: 0;
}

/* Transparent wrapper on desktop; becomes the scrollable pill strip on
   small screens (see the media queries). */
.sidenav__links {
  display: contents;
}

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

.sidenav__link {
  display: block;
  padding: 9px 12px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidenav__link:hover {
  background: var(--soft);
  color: var(--text);
  opacity: 1;
}

.sidenav__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  padding: 44px 36px 72px;
  max-width: 980px;
  margin: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
}

.page-footer {
  margin-top: auto;
  padding-top: 18px;
}

.page-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.page-header__h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.4px;
}

.page-header__sub {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 16px;
}

.section {
  padding: 20px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: -0.2px;
}

.section p {
  margin: 10px 0;
  max-width: 80ch;
  color: var(--muted);
}

.section p strong,
.section li strong {
  color: var(--text);
}

.steps {
  margin: 6px 0 4px;
  padding-left: 20px;
}

.steps li {
  margin: 6px 0;
  max-width: 80ch;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.list li {
  margin: 4px 0;
}

.callout {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  background: var(--soft2);
}

.callout--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.callout__title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

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

/* Signal flow: microphone to screen, left to right. The bar across the top
   is the logo gradient. */
.flow {
  list-style: none;
  margin: 18px 0 10px;
  padding: 21px 18px 18px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft2);
  overflow: hidden;
}

.flow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
}

.flow__step {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
}

.flow__step + .flow__step::before {
  content: "\2192";
  position: absolute;
  left: -21px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.flow__k {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.flow__v {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* The sixteen effects */
.fx {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fx li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--soft2);
  font-size: 14px;
}

.fx__n {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 0;
  text-align: center;
  width: 100%;
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Large tablets / small laptops */
  .layout {
    grid-template-columns: 240px 1fr;
  }

  .content {
    margin: 16px;
    padding: 36px 24px 64px;
  }

  .flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Three per row: the first step of the second row gets no arrow. */
  .flow__step:nth-child(4)::before {
    content: none;
  }

  .fx {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* Tablets and phones */
  .layout {
    grid-template-columns: 1fr;
  }

  /* Sticky frosted app bar, two compact rows: brand lockup on top, a
     full-width horizontally scrollable pill strip below. The strip fades
     out at its right edge as a "more links this way" affordance. */
  .sidenav {
    z-index: 50;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: block;
    background: rgba(11, 14, 22, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .sidenav__brand {
    margin: 0 0 10px;
  }

  .sidenav__links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Right-edge fade signals more pills off-screen; the trailing padding
       lets the last pill scroll fully clear of the fade. */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    padding-right: 36px;
  }

  .sidenav__links::-webkit-scrollbar {
    display: none;
  }

  .sidenav__group {
    display: contents;
  }

  .sidenav__link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 9px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  .sidenav__link.is-active {
    border-color: var(--accent-line);
  }

  .content {
    padding: 32px 24px 56px;
    margin: 12px;
    min-height: auto;
  }

  .page-header__h1 {
    font-size: 28px;
  }

  /* The collapsed top nav already shows the logo + wordmark right above the
     page header; a second big mark inches below reads as clutter.
     One brand per screen: keep the nav lockup, drop the hero mark. */
  .hero {
    gap: 0;
    margin-bottom: 6px;
  }

  .hero-mark {
    display: none;
  }

  /* Anchor jumps land below the sticky bar, not under it. */
  .section {
    scroll-margin-top: 112px;
  }

  /* Top to bottom on narrow screens. */
  .flow {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .flow__step + .flow__step::before {
    content: "\2193";
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
  }

  .fx {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  /* Mobile phones */
  .sidenav {
    padding: 10px 14px;
  }

  .sidenav__brand {
    font-size: 18px;
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 21px;
  }

  .sidenav__links {
    gap: 6px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    padding-right: 32px;
  }

  .sidenav__link {
    padding: 7px 13px;
    font-size: 13px;
  }

  .content {
    padding: 20px 16px 40px;
    margin: 8px;
  }

  .page-header__h1 {
    font-size: 24px;
  }

  .page-header__sub {
    font-size: 14px;
    line-height: 1.4;
  }

  .section {
    scroll-margin-top: 100px;
  }

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

  .section p,
  .steps li,
  .list li {
    font-size: 14px;
    line-height: 1.5;
  }

  .callout {
    padding: 12px;
    margin: 10px 0;
  }

  .callout__title {
    font-size: 14px;
  }

  .list {
    padding-left: 16px;
  }

  .flow {
    padding: 17px 12px 12px;
  }

  .fx {
    gap: 8px;
  }

  .fx li {
    padding: 9px 10px;
    font-size: 13px;
  }

  .footer-note {
    font-size: 12px;
  }

  .page-footer {
    padding-top: 12px;
  }
}
