/* chiral-ftp.com: one stylesheet, no framework. The page sits on the brand
   gradient (navy at the top of the window, gold at the bottom); text lives on
   dark panels so it stays readable wherever it lands on the gradient. */

:root {
  --bg-top: #101e3e;
  --ink: #f5f3ec;
  --muted: #b9c0cf;
  --faint: #8790a3;
  --gold: #d9b65e;
  --gold-light: #f2d98a;
  --panel: rgba(13, 17, 30, 0.78);
  --panel-edge: rgba(242, 217, 138, 0.14);
  --radius: 14px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

html { background: var(--bg-top); }

/* The gradient fills the window, not the page: navy at the top, gold at the
   bottom, the same on a short page as on a long one. A fixed layer rather
   than background-attachment: fixed, which iOS Safari ignores. */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  background: linear-gradient(180deg,
    #101e3e 0%, #142445 10%, #1a2b4e 20%, #203258 30%, #2d4064 40%,
    #394d70 50%, #51627e 60%, #747e8d 70%, #aaa18c 80%, #e0c479 90%, #f1ca61 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; border-radius: 6px; }

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

code, kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

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

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 30, 62, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-edge);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }

.wordmark { font-family: var(--mono); font-weight: 500; letter-spacing: -0.02em; font-size: 1.3rem; }
.wordmark span { color: var(--gold); }

.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); text-decoration: none; }
/* Download stays one click away on every page, in the sticky header. */
.nav .nav-download { color: #17140b; background: var(--gold); font-weight: 600; padding: 2px 12px; border-radius: 8px; }
.nav .nav-download:hover { color: #17140b; background: var(--gold-light); }
.nav { align-items: center; }

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

.hero { padding: 72px 0 40px; text-align: center; }
.hero .mark { width: 96px; height: 96px; margin: 0 auto 18px; }
.hero h1 { margin: 0; font-family: var(--mono); font-weight: 500; letter-spacing: -0.02em; font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1.1; }
.hero h1 span { color: var(--gold); }
.hero .tagline { font-size: clamp(1.1rem, 2.6vw, 1.35rem); margin: 18px auto 0; max-width: 46ch; }
.hero .sub { color: var(--muted); margin: 10px auto 0; max-width: 60ch; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-size: 1rem;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--gold); color: #17140b; }
.btn-primary:hover { background: var(--gold-light); }
.btn-secondary { background: rgba(255, 255, 255, 0.06); color: var(--ink); border-color: rgba(255, 255, 255, 0.18); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn small { font-weight: 400; opacity: 0.75; }

.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.platforms li { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.9rem; color: var(--muted); }

.version-note { color: var(--faint); font-size: 0.85rem; margin-top: 12px; min-height: 1.4em; }

.devices { width: 100%; }

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

section { padding: 36px 0; }
section > .wrap > h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 6px; }
section > .wrap > .lead { color: var(--ink); opacity: 0.9; margin: 0 0 24px; max-width: 70ch; }
/* Text straight on the gradient, not on a panel: a soft shadow keeps it
   readable over the lighter, gold half. */
section > .wrap > h2, section > .wrap > .lead, .hero p, .version-note, .shots figcaption { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 22px;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.card .icon { width: 36px; height: 36px; margin-bottom: 12px; color: var(--gold); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: #17140b; font-weight: 700; margin-bottom: 10px;
}
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); }

.split { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) { .split { grid-template-columns: 1.1fr 1fr; } }
.split p { color: var(--muted); }
.split ul { color: var(--muted); padding-left: 1.2em; }
.split li { margin: 4px 0; }
.split strong { color: var(--ink); }

/* ---------- screenshots ---------- */

figure { margin: 0; }
figure img { border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.shots figcaption { color: var(--ink); opacity: 0.85; }

.shots-wide { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
/* The foldable (nearly square) beside three phones: about the same height. */
.shots-phone { display: grid; gap: 16px; grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; margin-top: 24px; }
@media (max-width: 700px) { .shots-phone { grid-template-columns: repeat(3, minmax(0, 1fr)); } .shots-phone .fold { grid-column: 1 / -1; max-width: 420px; justify-self: center; } }

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

.dl { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dl .panel { display: flex; flex-direction: column; gap: 10px; }
.dl .panel.recommended { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.dl h3 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl .tag { font-size: 0.75rem; font-weight: 600; color: #17140b; background: var(--gold); padding: 2px 8px; border-radius: 999px; }
.dl .req { color: var(--faint); font-size: 0.9rem; margin: 0; }
.dl ol { margin: 0; padding-left: 1.2em; color: var(--muted); }
.dl ol li { margin: 3px 0; }
.dl .files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.dl .files .btn { padding: 9px 14px; font-size: 0.92rem; }

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

footer { padding: 40px 0 56px; }
footer .panel { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
footer p { margin: 0; color: var(--muted); font-size: 0.92rem; }

@media (max-width: 600px) {
  .hero { padding-top: 48px; }
  .nav { width: 100%; justify-content: flex-start; padding-bottom: 10px; }
  .nav .nav-download { order: -1; }
  .panel { padding: 18px; }
}
