/* Mecmua's website. One stylesheet, no framework; colours follow the system. */

@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f2ea;
  --paper-2: #efe8db;
  --card: #fffdf8;
  --ink: #1d1a16;
  --ink-2: #4a443c;
  --muted: #776e62;
  --line: #e4dccd;
  --line-2: #d6ccb9;
  --green: #2c6a4f;
  --green-hover: #24583f;
  --green-ink: #ffffff;
  --green-soft: #e2ede5;
  --gold: #a67c32;
  --gold-bright: #c9a15a;
  --gold-soft: #f4e8cf;
  --logo-bg: #141311;
  --band: #191714;
  --band-ink: #efe8dc;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 12px 30px -14px rgb(40 30 10 / 22%);
  --shadow-lg: 0 2px 6px rgb(40 30 10 / 6%), 0 40px 90px -30px rgb(40 30 10 / 40%);
  --radius: 14px;
  --wrap: 1180px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-2: #181614;
    --card: #1c1a17;
    --ink: #efe9df;
    --ink-2: #cfc6b8;
    --muted: #9b9285;
    --line: #2b2723;
    --line-2: #3a342e;
    --green: #5aa983;
    --green-hover: #6cbb94;
    --green-ink: #0c1a13;
    --green-soft: #1b2b22;
    --gold: #d2ac66;
    --gold-bright: #dcb672;
    --gold-soft: #2a2317;
    --band: #0c0b0a;
    --band-ink: #efe8dc;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 30px -14px rgb(0 0 0 / 60%);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 30%), 0 40px 90px -30px rgb(0 0 0 / 80%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; font-variation-settings: 'SOFT' 50, 'WONK' 0; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.8rem, 1.3rem + 1.9vw, 2.8rem); }
h3 { font-size: 1.3rem; }
strong { font-weight: 600; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.center-text { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── header ───────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header[data-scrolled] { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgb(0 0 0 / 30%); }
.header-row { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.32rem; font-weight: 500; letter-spacing: -0.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; font-size: .95rem; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--paper-2); }
.menu-toggle { display: none; margin-left: 4px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 12px; right: 12px; height: 1.6px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, top .25s ease; }
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded='true'] span:first-child { top: 20px; transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] span:last-child { top: 20px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .header-row { gap: 12px; }
  .header-cta { margin-left: auto; }
  .menu-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; gap: 2px; padding: 10px 16px 16px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px -24px rgb(0 0 0 / 35%);
    transform-origin: top; transform: scaleY(.96); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .nav[data-open] { opacity: 1; transform: none; visibility: visible; transition: opacity .2s ease, transform .2s ease; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; border-radius: 12px; }
}

/* ── buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 500 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--green-ink); box-shadow: 0 1px 0 rgb(255 255 255 / 15%) inset, 0 8px 20px -10px color-mix(in srgb, var(--green) 70%, transparent); }
.btn-primary:hover { background: var(--green-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); border-color: var(--ink-2); }
.btn-light { background: var(--band-ink); color: #191714; }
.btn-light:hover { background: #fff; transform: translateY(-1px); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-row.center { justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 4px var(--gold-soft); }
.kicker { display: inline-block; font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }

/* ── sections ─────────────────────────────────────────────────────── */

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.section-head p { color: var(--ink-2); font-size: 1.1rem; }
.lead { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); line-height: 1.6; max-width: 640px; }
.center-text .lead, .section-head .lead { margin-left: auto; margin-right: auto; }
.display-s { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── hero ─────────────────────────────────────────────────────────── */

.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 0; text-align: center; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 760px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 50% 38%, color-mix(in srgb, var(--gold-bright) 22%, transparent), transparent 70%),
    radial-gradient(30% 34% at 80% 20%, color-mix(in srgb, var(--green) 10%, transparent), transparent 70%);
}
.hero h1 { max-width: 15ch; margin: 22px auto 22px; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 400; }
.hero .lead { margin: 0 auto 32px; }
.hero .note { margin-top: 18px; font-size: .9rem; color: var(--muted); }
.hero-shot { margin: clamp(40px, 6vw, 64px) auto 0; max-width: 1180px; padding: 0 24px; position: relative; }
.hero-shot .frame { border-radius: 16px 16px 0 0; border-bottom: 0; }
.scheme-switch { display: inline-flex; margin-top: 18px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); gap: 2px; }
.scheme-switch button { border: 0; background: transparent; color: var(--muted); font: 500 .85rem/1 var(--sans); padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.scheme-switch button[aria-pressed='true'] { background: var(--paper-2); color: var(--ink); }

/* A screenshot in a window frame. */
.frame {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--card);
  box-shadow: var(--shadow-lg);
}
.frame::before {
  content: ''; display: block; height: 26px; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16px 13px, #e0685a 4.5px, transparent 5px),
    radial-gradient(circle at 32px 13px, #e7b34b 4.5px, transparent 5px),
    radial-gradient(circle at 48px 13px, #6cbf6a 4.5px, transparent 5px),
    var(--paper-2);
}
.frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.frame.crop-right img { object-position: top right; }

/* ── values strip ─────────────────────────────────────────────────── */

.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.value { padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.value h3 { font-size: 1.2rem; margin-bottom: 8px; }
.value p { margin: 0; color: var(--ink-2); font-size: .98rem; }
.icon-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-bottom: 18px; }
.icon-badge svg { width: 22px; height: 22px; }
@media (max-width: 860px) { .values { grid-template-columns: minmax(0, 1fr); } }

/* ── feature rows ─────────────────────────────────────────────────── */

.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 10vw, 128px); }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .feature-text { order: 2; }
.feature-text p { color: var(--ink-2); font-size: 1.06rem; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.ticks li::before {
  content: ''; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%232c6a4f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .ticks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235aa983' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E"); }
}
@media (max-width: 900px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .feature-text { order: 0; }
}

.tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: 500 .9rem/1 var(--sans); padding: 9px 16px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.tabs button[aria-selected='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 10%); }
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; transition: opacity .35s ease, transform .35s ease; }
.swap > [hidden] { display: block; opacity: 0; transform: translateY(6px); pointer-events: none; visibility: hidden; }

/* ── small feature grid ───────────────────────────────────────────── */

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tile { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tile h3 { font-size: 1.12rem; margin-bottom: 6px; }
.tile p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.tile .icon-badge { width: 40px; height: 40px; margin-bottom: 14px; background: var(--green-soft); color: var(--green); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ── extensions ───────────────────────────────────────────────────── */

/* Four across on a wide screen, so every extension is on show at once rather than a few and a scroll. */
.ext-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .ext-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .ext-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .ext-grid { grid-template-columns: minmax(0, 1fr); } }
.ext-card[hidden] { display: none; }
.ext-tools { display: none; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 20px; }
.js .ext-tools { display: flex; }
.ext-tools .tabs { margin-bottom: 0; }
.ext-tools .tabs button[aria-pressed='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 10%); }
.ext-tools .count { margin-left: 4px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ext-tools .sort { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.ext-tools select { font: 500 .9rem/1.2 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.ext-tools select:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
@media (max-width: 540px) { .ext-tools { flex-direction: column; align-items: stretch; } .ext-tools .tabs { justify-content: center; } .ext-tools .sort { justify-content: space-between; } }
.section-head.compact { margin-bottom: clamp(22px, 3vw, 30px); }
.section-head.compact .lead { font-size: 1.05rem; max-width: 600px; }
.section.top-tight { padding-top: clamp(36px, 5vw, 56px); }
.price.free { color: var(--green); }
.ext-card {
  display: flex; flex-direction: column; text-decoration: none; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ext-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.ext-card .thumb { aspect-ratio: 2 / 1; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.ext-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .6s ease; }
.ext-card:hover .thumb img { transform: scale(1.03); }
.ext-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ext-card .top { display: flex; align-items: center; gap: 10px; }
.ext-card h3 { margin: 0; font-size: 1.12rem; }
.ext-card p { margin: 0; color: var(--ink-2); font-size: .9rem; flex: 1; }
.ext-card .top .ext-icon { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
.ext-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.ext-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.ext-icon.lg { width: 76px; height: 76px; font-size: 40px; border-radius: 20px; }
.price { font-weight: 600; color: var(--ink); }
.price-tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; font-size: .9rem; }

.ext-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.ext-hero h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); margin: 0 0 6px; }
.ext-hero .lead { margin: 0; }
.buy-box { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 240px; }
.buy-box .fine { font-size: .82rem; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .ext-hero { grid-template-columns: auto 1fr; }
  .buy-box { grid-column: 1 / -1; min-width: 0; }
}
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 26px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.gallery { display: grid; gap: 14px; }
.gallery .frame img { aspect-ratio: 16 / 10; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 150px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--card); cursor: pointer; opacity: .7; transition: opacity .2s, border-color .2s; }
.thumbs button[aria-pressed='true'] { border-color: var(--gold-bright); opacity: 1; }
.thumbs img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.caption { font-size: .9rem; color: var(--muted); text-align: center; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.side-card { position: sticky; top: 92px; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.side-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .94rem; }
.side-card dt { color: var(--muted); }
.side-card dd { margin: 0; text-align: right; }
.side-card h3 { font-size: 1.05rem; margin-bottom: 14px; }

/* ── prose (descriptions, legal pages) ────────────────────────────── */

.prose { font-size: 1.05rem; color: var(--ink-2); }
.prose h2 { font-size: 1.6rem; color: var(--ink); margin: 1.8em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; color: var(--ink); margin: 1.5em 0 .4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--gold); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--paper-2); padding: 2px 6px; border-radius: 6px; }
.prose a { color: var(--green); text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose .updated { font-size: .9rem; color: var(--muted); }

.changelog { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.changelog li { padding-left: 18px; border-left: 2px solid var(--line-2); }
.changelog .v { font-weight: 600; color: var(--ink); }
.changelog .d { color: var(--muted); font-size: .9rem; margin-left: 8px; }
.changelog ul { margin: 6px 0 0; padding-left: 1.1em; color: var(--ink-2); }

/* ── name story ───────────────────────────────────────────────────── */

.story { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; max-width: 980px; margin: 0 auto; }
.story .script { font-family: 'Amiri', 'Traditional Arabic', 'Arabic Typesetting', 'Geeza Pro', 'Segoe UI', serif; font-size: clamp(4.5rem, 3rem + 6vw, 8rem); line-height: 1.2; color: var(--gold); direction: rtl; }
.story blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); line-height: 1.45; font-weight: 400; color: var(--ink); }
.story blockquote em { color: var(--gold); }
.story p { color: var(--ink-2); margin-top: 18px; }
@media (max-width: 760px) { .story { grid-template-columns: 1fr; text-align: center; } }

/* ── FAQ ──────────────────────────────────────────────────────────── */

.faq { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative; font-family: var(--serif); font-size: 1.22rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .25s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq .answer { padding: 0 0 22px; color: var(--ink-2); max-width: 70ch; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ── closing band ─────────────────────────────────────────────────── */

.band { background: var(--band); color: var(--band-ink); border-radius: 28px; padding: clamp(44px, 7vw, 84px) clamp(24px, 6vw, 80px); text-align: center; position: relative; overflow: hidden; }
.band::before { content: ''; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--gold-bright) 45%, transparent); border-radius: 20px; pointer-events: none; }
.band::after { content: ''; position: absolute; width: 520px; height: 520px; left: 50%; top: -340px; transform: translateX(-50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--gold-bright) 30%, transparent), transparent); pointer-events: none; }
.band h2 { color: #f7f0e3; position: relative; }
.band p { color: #cfc5b5; max-width: 560px; margin: 0 auto 28px; position: relative; }
.band .cta-row { position: relative; }
.band .btn-ghost { color: #f2ebdf; border-color: #4b443b; }
.band .btn-ghost:hover { background: #24211d; border-color: #7a7062; }

/* ── download page ────────────────────────────────────────────────── */

.os-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 820px) { .os-grid { grid-template-columns: minmax(0, 1fr); } }
.os-card { padding: 32px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.os-card[data-recommended] { border-color: color-mix(in srgb, var(--gold-bright) 60%, var(--line)); box-shadow: var(--shadow); }
.os-card .os-head { display: flex; align-items: center; gap: 14px; }
.os-card .os-head svg { width: 34px; height: 34px; color: var(--ink); }
.os-card h2 { font-size: 1.6rem; margin: 0; }
.os-card .req { color: var(--muted); font-size: .92rem; margin: 0; }
.os-card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.os-card .btn { white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }
.os-card .alt { font-size: .92rem; color: var(--muted); }
.os-card .alt a { color: var(--ink-2); }
.badge-soon { align-self: flex-start; display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; color: var(--ink-2); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 600; font-size: .95rem; }
.steps strong { color: var(--ink); }
.hash { font-family: var(--mono); font-size: .78rem; word-break: break-all; color: var(--muted); }

/* ── forms ────────────────────────────────────────────────────────── */

.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 7px; font-size: .92rem; font-weight: 500; color: var(--ink-2); }
.form input, .form textarea, .form select {
  font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--gold-bright); box-shadow: 0 0 0 4px var(--gold-soft); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .form .row { grid-template-columns: 1fr; } }
.form .hidden-field { position: absolute; left: -9999px; }
.panel { padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.notice { padding: 14px 16px; border-radius: 12px; font-size: .95rem; border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink-2); }
.notice.error { border-color: color-mix(in srgb, #c0392b 50%, var(--line)); color: #b03a2e; background: color-mix(in srgb, #c0392b 8%, var(--card)); }
@media (prefers-color-scheme: dark) { .notice.error { color: #f0938a; } }
.plain-list { padding-left: 1.2em; }

.key-box { margin: 28px auto 18px; max-width: 620px; text-align: left; display: grid; gap: 8px; }
.replace-key { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); text-align: left; }
.replace-key h3 { margin: 0 0 6px; font-size: 1rem; }
.key-box label { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.key-box textarea { width: 100%; font: 400 .8rem/1.5 var(--mono); padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); resize: none; word-break: break-all; }
.key-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.seal { width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--green-soft); color: var(--green); }
.spinner { width: 42px; height: 42px; margin: 0 auto 24px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--gold-bright); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { margin-top: 26px; }

/* "Open in Mecmua" can do nothing at all when Mecmua is not installed; this says what to do then. */
.open-hint { display: none; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.open-hint[data-shown] { display: block; animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-3px); } }

/* ── about ────────────────────────────────────────────────────────── */

.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-card { padding: 28px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); text-align: center; position: sticky; top: 92px; }
.monogram { width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 3rem; color: var(--gold); background: radial-gradient(circle at 30% 25%, var(--gold-soft), var(--paper-2)); border: 1px solid var(--line-2); }
.about-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.about-card p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ── footer ───────────────────────────────────────────────────────── */

.site-footer { margin-top: clamp(64px, 9vw, 110px); border-top: 1px solid var(--line); padding: 56px 0 36px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 6px 0 14px; }
.footer-grid a { display: block; text-decoration: none; color: var(--ink-2); padding: 4px 0; }
.footer-grid a:hover { color: var(--ink); }
.footer-brand p { color: var(--muted); margin-top: 12px; max-width: 30ch; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ── motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }
  .hero-shot { animation: rise 1s cubic-bezier(.2, .7, .2, 1) .15s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.985); } }
}

.error-text { color: #b03a2e; }
@media (prefers-color-scheme: dark) { .error-text { color: #f0938a; } }

/* A cropped screenshot: no window chrome, its own proportions. */
.frame.plain::before { display: none; }
.frame.plain img { aspect-ratio: auto; }

/* ── phones (the phone page and its feature) ──────────────────────── */

.phones { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 3vw, 28px); }
.phone { width: min(236px, 44%); border-radius: 36px; border: 7px solid #1f1c19; background: #1f1c19; overflow: hidden; box-shadow: var(--shadow-lg); }
.phone:nth-child(2) { margin-top: 38px; }
.phone img { display: block; width: 100%; aspect-ratio: 1170 / 2532; object-fit: cover; object-position: top; border-radius: 28px; }
@media (prefers-color-scheme: dark) { .phone { border-color: #3a342e; background: #3a342e; } }

/* Guides: the numbered steps with a picture-less look of their own. */
.guide h2 { margin-top: 2.2em; }
.guide .steps li { padding-bottom: 4px; }
.guide .steps li > p { margin: .5em 0 0; }
.callout { margin: 20px 0; padding: 16px 20px; border-radius: var(--radius); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold-bright) 45%, var(--line)); color: var(--ink-2); font-size: .98rem; }
.callout strong { color: var(--ink); }
.callout.plain { background: var(--card); border-color: var(--line); }
.addr { font-family: var(--mono); font-size: .9em; background: var(--paper-2); padding: 2px 7px; border-radius: 6px; word-break: break-all; }
.guide pre { margin: 12px 0; padding: 14px 16px; border-radius: 12px; background: var(--band); color: var(--band-ink); font: .88rem/1.5 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.toc a:hover { border-color: var(--gold-bright); color: var(--ink); }

/* ── docs: topics on the left, the article, its headings on the right ── */

kbd { font: 500 .82em/1 var(--mono); background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; vertical-align: .08em; }
.docs { display: grid; grid-template-columns: 264px minmax(0, 1fr) 208px; gap: 0 56px; max-width: 1400px; margin: 0 auto; padding: 0 24px; align-items: start; }

.doc-side { position: sticky; top: 68px; height: calc(100vh - 68px); height: calc(100dvh - 68px); border-right: 1px solid var(--line); }
.doc-side-inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 32px 20px 40px 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.doc-filter { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.doc-filter:focus-within { border-color: var(--gold-bright); box-shadow: 0 0 0 3px var(--gold-soft); }
.doc-filter svg { width: 16px; height: 16px; flex: none; }
.doc-filter input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: .93rem; outline: none; }
.doc-filter input::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1); opacity: .55; }
.doc-group h2 { font: 600 .72rem/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--gold); margin: 28px 12px 10px; }
.doc-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.doc-group a, .doc-soon { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 10px; font-size: .95rem; line-height: 1.35; text-decoration: none; color: var(--ink-2); transition: background .15s, color .15s; }
.doc-group a:hover { background: var(--paper-2); color: var(--ink); }
.doc-group a[aria-current='page'] { background: var(--gold-soft); color: var(--ink); font-weight: 500; box-shadow: inset 3px 0 0 var(--gold-bright); }
.doc-soon { color: var(--muted); cursor: default; }
.doc-out { color: var(--muted); font-size: .85em; }
.soon-pill { font: 600 .66rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.doc-none { margin: 20px 12px; font-size: .92rem; color: var(--muted); }
.doc-none a { color: var(--green); }
.doc-side-foot { margin: 32px 12px 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

.doc-main { padding: 40px 0 96px; min-width: 0; max-width: 760px; }
.doc-main .crumbs { margin-bottom: 18px; }
.doc-main h1 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.1rem); margin-bottom: .35em; }
.doc-lead { font-size: clamp(1.1rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); margin-bottom: 36px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.doc-body { font-size: 1.06rem; color: var(--ink-2); }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2 { position: relative; font-size: clamp(1.45rem, 1.3rem + .6vw, 1.75rem); color: var(--ink); margin: 2.2em 0 .6em; }
.doc-body h3 { font-size: 1.2rem; color: var(--ink); margin: 1.6em 0 .4em; }
.doc-anchor { position: absolute; left: -1.05em; padding-right: .3em; color: var(--gold-bright); text-decoration: none; opacity: 0; transition: opacity .15s; }
.doc-body h2:hover .doc-anchor, .doc-anchor:focus-visible { opacity: 1; }
.doc-body a:not(.doc-card):not(.doc-anchor) { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc-body a:not(.doc-card):not(.doc-anchor):hover { text-decoration-thickness: 2px; }
.doc-body strong { color: var(--ink); }
.doc-body ul { padding-left: 1.2em; }
.doc-body li { margin: .45em 0; }
.doc-body li::marker { color: var(--gold); }
.doc-body .steps { margin: 1.2em 0 1.4em; }
.doc-body .steps li { margin: 0; }

.doc-note { margin: 1.5em 0; padding: 16px 20px 16px 22px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold-bright) 40%, var(--line)); box-shadow: inset 4px 0 0 var(--gold-bright); font-size: 1rem; color: var(--ink-2); }
.doc-note.tip { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); box-shadow: inset 4px 0 0 var(--green); }
.doc-note strong { color: var(--ink); }

.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 1.2em 0; }
.doc-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink-2); font-size: .95rem; line-height: 1.5; transition: border-color .2s, transform .2s, box-shadow .2s; }
.doc-card:hover { border-color: var(--gold-bright); transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-card svg { flex: none; width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); }
.doc-card strong { display: block; margin-bottom: 2px; font-family: var(--serif); font-size: 1.12rem; font-weight: 500; color: var(--ink); }

.doc-figure { margin: 1.8em 0; }
.doc-figure img, .doc-figure video { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
.doc-figure figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); text-align: center; }

.doc-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.doc-pager a { display: grid; gap: 4px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.doc-pager a:hover { border-color: var(--gold-bright); box-shadow: var(--shadow); }
.doc-pager span { font-size: .82rem; color: var(--muted); }
.doc-pager strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; color: var(--ink); }
.doc-pager .prev span::before { content: '← '; }
.doc-pager .next { text-align: right; }
.doc-pager .next span::after { content: ' →'; }
.doc-help { margin-top: 28px; font-size: .92rem; color: var(--muted); }
.doc-help a { color: var(--green); }

.doc-toc { position: sticky; top: 68px; padding: 44px 0 32px; max-height: calc(100vh - 68px); overflow-y: auto; }
.doc-toc h2 { font: 600 .72rem/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; font-size: .88rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s; }
.doc-toc a:hover { color: var(--ink); }
.doc-toc a[data-active] { color: var(--ink); border-left-color: var(--gold-bright); }

.doc-menu-button, .doc-scrim { display: none; }

@media (max-width: 1180px) {
  .docs { grid-template-columns: 240px minmax(0, 1fr); gap: 0 48px; }
  .doc-toc { display: none; }
}

@media (max-width: 860px) {
  .docs { display: block; padding: 0; }
  .doc-main { padding: 28px 16px 72px; margin: 0 auto; }
  .doc-menu-button {
    position: sticky; top: 68px; z-index: 40; display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left;
    background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: var(--ink); font: 500 .98rem/1.3 var(--sans);
  }
  .doc-menu-button svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
  .doc-menu-button small { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); }
  .doc-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(86vw, 320px); height: 100%;
    background: var(--paper); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateX(-104%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
  }
  .doc-side[data-open] { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .doc-side-inner { padding: 22px 16px 40px; }
  .doc-group a, .doc-soon { padding: 10px 12px; font-size: 1rem; }
  .doc-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgb(0 0 0 / 35%); opacity: 0; transition: opacity .28s; }
  .doc-scrim[hidden] { display: none; }
  .doc-scrim[data-open] { opacity: 1; }
  .doc-anchor { display: none; }
}

@media (max-width: 560px) {
  .doc-cards, .doc-pager { grid-template-columns: minmax(0, 1fr); }
}
