/*
 * OrganKey site styles.
 *
 * The palette is the app's GlassColors (lib/app/theme/app_theme.dart),
 * verbatim: deep navy background, restrained glass surfaces, a cyan/blue
 * accent for active states and white type. Glow is an interaction state, not
 * decoration — the same rule the app's SRS §2.1 sets.
 *
 * The site commits to the app's one dark world rather than shipping a light
 * theme. `color-scheme: dark` is declared so form controls and scrollbars
 * match.
 */

:root {
  /* Backgrounds and surfaces */
  --bg: #030e1c;
  --bg-alt: #061629;
  --surface: rgba(16, 44, 76, 0.55);
  --surface-solid: #0a2038;
  --surface-strong: #0d2846;

  /* Ink */
  --ink: #edf4ff;
  --ink-soft: #b4c9e2;
  --ink-faint: #8aa6c6;

  /* Brand */
  --cyan: #30ccff;
  --blue: #075cfa;
  --blue-dark: #0549c9;
  --gold: #ffd27a;
  --success: #4fd69c;

  --outline: rgba(83, 150, 214, 0.26);
  --outline-strong: #254c70;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --page-max: 1160px;

  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.32);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.35), 0 26px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(48, 204, 255, 0.55), 0 0 24px rgba(48, 204, 255, 0.25);

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;

  color-scheme: dark;
}

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

/* `[hidden] { display: none }` is an attribute selector, so any class that
   sets `display` outranks it. Anything toggled with `hidden` needs this. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
  background-color: var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;

  background-image:
    radial-gradient(900px 560px at 82% -8%, rgba(48, 204, 255, 0.14), transparent 70%),
    radial-gradient(760px 500px at 0% 18%, rgba(7, 92, 250, 0.14), transparent 68%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------------------ type -- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.45rem);
}

h3 {
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.lead {
  color: var(--ink-soft);
  font-size: 1.07rem;
  line-height: 1.7;
  max-width: 62ch;
}

h1 + .lead,
h2 + .lead,
h3 + .lead {
  margin-top: 20px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.accent {
  color: var(--cyan);
}

/* ------------------------------------------------------------------ nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(3, 14, 28, 0.82);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--outline);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
  box-shadow: 0 0 0 1px var(--outline);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--cyan);
}

.brand-tag {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--outline);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 3px;
  flex: none;
}

.lang-switch button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 4px 11px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.lang-switch button.is-active {
  background: var(--blue);
  color: #fff;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.97rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, #1a6dff 0%, var(--blue) 100%);
  color: #fff;
  border-color: rgba(48, 204, 255, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--outline);
}

.btn-ghost:hover {
  background: var(--surface-strong);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.88rem;
  flex: none;
}

/* A store CTA with no URL is not a link, and must not look like one. */
.is-disabled {
  cursor: default;
  pointer-events: none;
}

.btn.is-disabled {
  background: var(--surface);
  color: var(--ink-faint);
  border-color: var(--outline);
  box-shadow: none;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.store-badge {
  display: inline-block;
  border-radius: 13px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.store-badge:not(.is-disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.store-badge.is-disabled {
  opacity: 0.7;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.dot-ok {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
  box-shadow: 0 0 0 4px rgba(79, 214, 156, 0.16);
}

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

.hero {
  padding: 68px 0 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  align-items: center;
}

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

/* Screenshots are real renders of the app at 1366×768. They sit in a device
   frame drawn in CSS so no bitmap bezel has to be maintained. */
.device {
  position: relative;
  border-radius: 22px;
  padding: 10px;
  background: linear-gradient(160deg, #13304f, #07172b);
  box-shadow: 0 0 0 1px var(--outline-strong), var(--shadow-lift),
    0 40px 120px rgba(7, 92, 250, 0.22);
}

.device img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  aspect-ratio: 1366 / 768;
  background: var(--surface-solid);
}

/* --------------------------------------------------------------- section -- */

.section {
  padding: 80px 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(6, 22, 41, 0.9), rgba(6, 22, 41, 0.6));
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
}

.section-head {
  max-width: 680px;
  margin-bottom: 44px;
}

.section-head .lead {
  margin-top: 16px;
}

.section-head.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head.centered .lead {
  margin-left: auto;
  margin-right: auto;
}

/* ----------------------------------------------------------------- grids -- */

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 20px;
}

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

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow-soft);
}

.card h3 {
  margin-bottom: 9px;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(48, 204, 255, 0.12);
  border: 1px solid rgba(48, 204, 255, 0.3);
  color: var(--cyan);
  margin-bottom: 16px;
}

.card-icon.gold {
  background: rgba(255, 210, 122, 0.12);
  border-color: rgba(255, 210, 122, 0.35);
  color: var(--gold);
}

/* ------------------------------------------------------------- showcase -- */

/* Feature row: copy on one side, a real screenshot on the other. */
.showcase {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 52px;
  align-items: center;
}

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

.showcase + .showcase {
  margin-top: 84px;
}

.showcase.flip {
  grid-template-columns: 1.15fr 0.85fr;
}

.showcase.flip .showcase-copy {
  order: 2;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.ticks li {
  position: relative;
  padding-left: 28px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.ticks li + li {
  margin-top: 10px;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(-45deg);
}

.ticks strong {
  color: var(--ink);
  font-weight: 700;
}

/* ----------------------------------------------------------------- chips -- */

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--outline);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- stats -- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-soft);
}

.stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cyan);
  line-height: 1.1;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ----------------------------------------------------------------- quiet -- */

.quiet {
  background: linear-gradient(150deg, #0b2442 0%, #0a1b33 60%, #071427 100%);
  border: 1px solid var(--outline-strong);
  color: var(--ink);
  border-radius: 28px;
  padding: 56px 48px;
  box-shadow: var(--shadow-lift);
}

.quiet h2 {
  max-width: 20ch;
}

.quiet .lead {
  margin-top: 18px;
  max-width: 66ch;
}

.quiet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
}

.quiet-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 20px;
}

.quiet-item strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.quiet-item span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ------------------------------------------------------------------- cta -- */

.cta {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 28px;
  padding: 58px 40px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.cta::after {
  content: '';
  position: absolute;
  inset: auto -10% -60% -10%;
  height: 260px;
  background: radial-gradient(closest-side, rgba(48, 204, 255, 0.2), transparent);
  pointer-events: none;
}

.cta-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin: 0 auto 24px;
  box-shadow: 0 0 0 1px var(--outline-strong), var(--shadow-lift);
}

.cta h2,
.cta .lead,
.cta .store-row {
  position: relative;
}

.cta .lead {
  margin: 18px auto 0;
  max-width: 54ch;
}

.cta .store-row {
  justify-content: center;
}

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

.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--outline);
  padding: 46px 0 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}

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

.footer-links a {
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 600;
}

.footer-legal {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--outline);
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.footer-credit {
  color: var(--ink-faint);
  font-size: 0.86rem;
  margin-top: 8px;
}

.footer-credit a {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ doc pages -- */

.doc {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px 90px;
}

.doc h1 {
  font-size: clamp(2rem, 4.6vw, 2.8rem);
}

.doc h2 {
  font-size: 1.4rem;
  margin: 46px 0 14px;
  padding-top: 8px;
}

.doc h3 {
  font-size: 1.06rem;
  margin: 28px 0 10px;
}

.doc p,
.doc li {
  color: var(--ink-soft);
  font-size: 1rem;
}

.doc strong {
  color: var(--ink);
}

.doc p + p,
.doc p + ul,
.doc p + ol,
.doc ul + p,
.doc ol + p {
  margin-top: 14px;
}

.doc ul,
.doc ol {
  margin: 14px 0;
  padding-left: 24px;
}

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

.updated {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-top: 12px !important;
}

.callout {
  background: rgba(48, 204, 255, 0.08);
  border: 1px solid rgba(48, 204, 255, 0.3);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin: 26px 0;
}

.callout p {
  color: var(--ink);
}

.callout.warn {
  background: rgba(255, 210, 122, 0.08);
  border-color: rgba(255, 210, 122, 0.35);
}

.doc-toc {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 22px 26px;
  margin: 30px 0 10px;
}

.doc-toc h2 {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  padding: 0;
  font-weight: 800;
}

.doc-toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
}

.doc-toc li {
  margin: 0 0 6px;
  break-inside: avoid;
}

.doc-toc li + li {
  margin-top: 0;
}

.doc-toc a {
  font-size: 0.93rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  background: var(--surface);
}

th,
td {
  text-align: left;
  padding: 13px 18px;
  font-size: 0.93rem;
  border-bottom: 1px solid var(--outline);
  vertical-align: top;
  color: var(--ink-soft);
}

th {
  background: var(--surface-strong);
  font-weight: 700;
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--outline);
}

.doc-nav a {
  font-weight: 600;
  font-size: 0.94rem;
}

/* --------------------------------------------------------------- support -- */

.faq {
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 18px 22px;
  margin-bottom: 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cyan);
  line-height: 1;
  flex: none;
}

.faq[open] summary::after {
  content: '\2013';
}

.faq[open] summary {
  margin-bottom: 12px;
}

.faq p + p {
  margin-top: 10px;
}

.faq p,
.faq li {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 980px) {
  .hero-grid,
  .showcase,
  .showcase.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .showcase.flip .showcase-copy {
    order: 0;
  }

  .showcase + .showcase {
    margin-top: 64px;
  }

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

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

  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
  }

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

  .nav-links {
    display: none;
  }

  .lang-switch {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 44px 0 48px;
  }

  .section {
    padding: 58px 0;
  }

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

  .device {
    padding: 6px;
    border-radius: 14px;
  }

  .device img {
    border-radius: 9px;
  }

  .quiet {
    padding: 36px 22px;
    border-radius: var(--r-lg);
  }

  .cta {
    padding: 42px 20px;
  }

  .doc {
    padding: 44px 16px 72px;
  }

  .doc-toc ol {
    columns: 1;
  }

  .store-row .store-badge img {
    width: 170px;
    height: auto;
  }

  .brand-tag {
    display: none;
  }

  /* Brand + language switch + a download button do not fit across a phone,
     and a flex row that does not fit widens the document. The button goes:
     the hero's store badges are a screen away. */
  .nav .btn {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .nav,
  .footer,
  .doc-nav,
  .store-row {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
