/* Tsugi website. Colours follow the Android app's Material 3 theme
   (android/app/src/main/kotlin/com/dfect/tsugi/ui/Common.kt). No web fonts, no
   third-party requests: the system font is used. */

:root {
  color-scheme: light dark;
  --primary: #425f9b;
  --on-primary: #ffffff;
  --primary-container: #d7e5fe;
  --on-primary-container: #0e1a39;
  --tertiary-container: #f4d6ff;
  --on-tertiary-container: #251327;
  --accent: #34518f;
  --bg: #f7faff;
  --on-bg: #161c24;
  --on-variant: #414754;
  --surface-low: #edf5ff;
  --surface: #e5f0fd;
  --surface-high: #e2e9f8;
  --surface-highest: #dce3f2;
  --outline-variant: #bfc7d9;
  --device: #1b1e25;
  --radius-l: 28px;
  --radius-m: 16px;
  --radius-s: 12px;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #b2c9fe;
    --on-primary: #1d305f;
    --primary-container: #2c467c;
    --on-primary-container: #d7e5fe;
    --tertiary-container: #543b5b;
    --on-tertiary-container: #f4d6ff;
    --bg: #10141c;
    --on-bg: #dce3f2;
    --on-variant: #bfc7d9;
    --surface-low: #161c24;
    --surface: #1a2028;
    --surface-high: #252b34;
    --surface-highest: #2f353f;
    --outline-variant: #414754;
    --device: #0f1115;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-bg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 12px; }
.lead { font-size: 1.2rem; color: var(--on-variant); max-width: 34em; }
.muted { color: var(--on-variant); }
.small { font-size: 0.9rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--on-bg); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--on-variant); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
}
.site-nav a:hover { background: var(--surface); color: var(--on-bg); }
@media (max-width: 640px) { .site-nav a.hide-small { display: none; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 0; cursor: pointer;
}
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { filter: brightness(1.08); }
.btn-tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn-tonal:hover { filter: brightness(1.04); }
.btn-text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn[aria-disabled="true"] {
  background: var(--surface-highest); color: var(--on-variant);
  cursor: default; filter: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.chip {
  display: inline-block; padding: 4px 12px; border-radius: 8px;
  background: var(--tertiary-container); color: var(--on-tertiary-container);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
}

/* ---------- hero ---------- */

.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero .chip { margin-bottom: 20px; }
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; }
}

/* A drawing of the remote screen, built from the app's own layout. */
.phone {
  width: min(320px, 100%); margin: 0 auto; aspect-ratio: 9 / 19;
  background: var(--device); border-radius: 44px; padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(60, 25, 5, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
@media (prefers-color-scheme: dark) {
  .phone { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px #2f353f; }
}
.screen {
  height: 100%; border-radius: 34px; overflow: hidden;
  background: #10141c; color: #dce3f2;
  display: flex; flex-direction: column; gap: 10px; padding: 34px 14px 16px;
  font-size: 11px; line-height: 1.4;
}
.screen .label { color: #b2c9fe; font-weight: 600; font-size: 10px; }
.screen .muted-label { color: #bfc7d9; font-weight: 600; font-size: 10px; }
.slides { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; align-items: end; }
.slide {
  aspect-ratio: 16 / 9; border-radius: 8px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #f7faff, #d7e5fe);
}
.slide::before {
  content: ""; position: absolute; left: 10%; top: 18%; width: 55%; height: 12%;
  border-radius: 3px; background: #425f9b;
}
.slide::after {
  content: ""; position: absolute; left: 10%; top: 42%; width: 70%; height: 36%;
  border-radius: 3px;
  background: repeating-linear-gradient(#9eaecf 0 8%, transparent 8% 24%);
}
.slide.next { background: linear-gradient(135deg, #dce3f2, #b6c8eb); }
.laser {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  left: 62%; top: 52%; background: #ff2020;
  box-shadow: 0 0 0 2px #8b0000, 0 0 10px 3px rgba(255, 32, 32, 0.6);
}
.strip { display: flex; gap: 6px; }
.strip span { flex: 1; aspect-ratio: 16 / 9; border-radius: 4px; background: #2f353f; }
.strip span.on { outline: 2px solid #b2c9fe; background: #2c467c; }
.notes {
  flex: 1; background: #1a2028; border-radius: 16px; padding: 12px;
  color: #dce3f2; font-size: 12px; overflow: hidden;
}
.notes p { margin: 0 0 8px; }
.timer { display: flex; justify-content: space-between; color: #bfc7d9; font-size: 10px; }
.timer b { color: #dce3f2; font-size: 15px; font-variant-numeric: tabular-nums; }
.controls { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.controls span {
  display: flex; align-items: center; justify-content: center; height: 54px;
  border-radius: 18px; font-weight: 700; font-size: 13px;
}
.controls .prev { background: #252b34; color: #dce3f2; }
.controls .nxt { background: #b2c9fe; color: #1d305f; font-size: 15px; }

/* ---------- sections ---------- */

section { padding: 64px 0; }
section.tinted { background: var(--surface-low); }
.section-head { max-width: 40em; margin-bottom: 36px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border-radius: var(--radius-m); padding: 24px;
}
section.tinted .card { background: var(--bg); }
.card p { color: var(--on-variant); margin: 0; }
.card .icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: var(--primary-container); color: var(--on-primary-container);
}
.card .icon svg { width: 24px; height: 24px; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding: 24px; border-radius: var(--radius-m); background: var(--surface); }
section.tinted .step { background: var(--bg); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700;
}
.step p { color: var(--on-variant); margin: 0; }

/* ---------- download ---------- */

/* Two by two: phones on top, computers below. */
.platforms { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .platforms { grid-template-columns: 1fr; } }
.platform {
  display: flex; flex-direction: column; gap: 6px;
  padding: 28px; border-radius: var(--radius-l); background: var(--surface);
}
section.tinted .platform { background: var(--bg); }
.platform h3 { font-size: 1.3rem; margin-bottom: 0; }
.platform .req { color: var(--on-variant); font-size: 0.9rem; margin-bottom: 14px; }
.platform .actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.platform .actions .btn { width: 100%; }
.platform .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chip.soon { background: var(--surface-highest); color: var(--on-variant); }
.btn { white-space: nowrap; }
.platform .note { font-size: 0.85rem; color: var(--on-variant); margin: 8px 0 0; }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; }
.faq details {
  border-radius: var(--radius-m); background: var(--surface); margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--on-variant); border-bottom: 2px solid var(--on-variant);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details > div { padding: 0 22px 18px; color: var(--on-variant); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- document pages (privacy) ---------- */

.doc { max-width: 760px; padding-top: 48px; padding-bottom: 64px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.doc h2 { font-size: 1.35rem; margin-top: 40px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 4px; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--outline-variant); }
.doc th { color: var(--on-variant); font-weight: 600; }
.doc .summary {
  background: var(--primary-container); color: var(--on-primary-container);
  border-radius: var(--radius-m); padding: 20px 24px; margin: 24px 0;
}
.doc .summary p { margin: 0; }
@media (max-width: 560px) {
  .doc table, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { display: none; }
  .doc tr { border-bottom: 1px solid var(--outline-variant); padding: 8px 0; }
  .doc td { border: 0; padding: 4px 0; }
  .doc td:first-child { font-weight: 600; }
}

/* ---------- footer ---------- */

.site-footer { padding: 40px 0 56px; border-top: 1px solid var(--outline-variant); color: var(--on-variant); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--on-variant); }

a[href^="mailto:"] { white-space: nowrap; }
