/* Nadhif website. Tokens follow the app's "Calm Glass" theme (Nadhif/Views/Theme.swift). */

:root {
  --ground: #F4F7FA;
  --card: #FFFFFF;
  --sunken: #EEF3F7;
  --wash: #EAF7F8;
  --hairline: #E3E9F0;
  --ink: #10233A;
  --ink-2: #52627A;
  --ink-3: #8A97A8;
  --link: #1F6FD1;
  --success: #1B7A4E;
  --warning: #8F5600;
  --danger: #B23A35;
  --cyan: #3CC8D8;
  --mint: #46D6A8;
  --blue: #2F7FE0;
  --action: linear-gradient(135deg, #0F8296, #2458C2);
  --action-hover: linear-gradient(135deg, #12909F, #2A63D2);
  --meter: linear-gradient(90deg, var(--cyan), var(--blue));
  --shadow: 0 1px 2px rgba(16, 35, 58, .06), 0 12px 32px -12px rgba(16, 35, 58, .18);
  --shadow-big: 0 2px 6px rgba(16, 35, 58, .06), 0 40px 80px -30px rgba(16, 35, 58, .35);

  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  color-scheme: light;
}

/* Light is the default; the header switch sets data-theme="dark". */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #15191F;
  --card: #1E242C;
  --sunken: #1A2027;
  --wash: #14292B;
  --hairline: #2E3640;
  --ink: #EEF2F6;
  --ink-2: #A3AFBF;
  --ink-3: #6F7B8B;
  --link: #6AAEFF;
  --success: #5BD39A;
  --warning: #F2B562;
  --danger: #F08A85;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-big: 0 2px 6px rgba(0, 0, 0, .3), 0 40px 80px -30px rgba(0, 0, 0, .8);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--sunken); border: 1px solid var(--hairline); padding: .1em .35em; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(42px, 7.4vw, 88px); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 36em; }
.muted { color: var(--ink-2); }

/* ---------- Arabic ---------- */

/* Readex Pro covers Arabic and Latin; Arabic letters must not be squeezed together. */
:root[lang="ar"] { --display: "Readex Pro", "SF Arabic", system-ui, sans-serif; --body: -apple-system, BlinkMacSystemFont, "SF Arabic", "Geeza Pro", system-ui, sans-serif; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] .brand, [lang="ar"] .disk-free, [lang="ar"] .light strong { letter-spacing: 0; }
[lang="ar"] h1, [lang="ar"] h2 { line-height: 1.25; }
[lang="ar"] body { line-height: 1.75; }
[lang="ar"] .brand { font-family: "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.02em; }
/* Commands, paths and shortcuts stay left-to-right inside Arabic text. */
[dir="rtl"] code, [dir="rtl"] kbd, [dir="rtl"] .term { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .term { text-align: left; }
.page h3 .en { color: var(--ink-3); font: 500 .75em var(--body); margin-inline-start: 6px; }
/* Sizes like "310 MB" keep their order. */
[dir="rtl"] .cat-size, [dir="rtl"] .light strong { direction: ltr; unicode-bidi: isolate; }

/* ---------- Header ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--hairline); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px var(--display); letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 22px; margin-inline-start: auto; }
.top nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
.theme {
  -webkit-appearance: none; appearance: none; margin: 18px 0 0; padding: 0 14px 0 12px;
  height: 38px; border-radius: 99px; gap: 8px; font: 500 15px var(--body);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--card); border: 1px solid var(--hairline); color: var(--ink-2);
  transition: color .2s, border-color .2s;
}
.theme:hover { color: var(--ink); border-color: var(--ink-3); }
.lang {
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 99px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--hairline); color: var(--ink-2);
  font: 600 14px var(--body); text-decoration: none;
}
.lang:hover { color: var(--ink); border-color: var(--ink-3); }
.lang:lang(ar) { font: 600 17px "Readex Pro", "SF Arabic", system-ui, sans-serif; }
.theme svg { width: 18px; height: 18px; flex: none; }
/* The icon and label show what a click switches to. */
.theme .sun, [data-theme="dark"] .theme .moon { display: none; }
[data-theme="dark"] .theme .sun { display: block; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font: 600 17px var(--body); text-decoration: none; cursor: pointer;
  border: 0; white-space: nowrap;
  transition: transform .2s, box-shadow .2s;
}
.btn-primary { background: var(--action); color: #fff; box-shadow: 0 10px 24px -10px rgba(36, 88, 194, .7); }
.btn-primary:hover { background: var(--action-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { color: var(--ink); background: var(--card); border: 1px solid var(--hairline); }
.btn-quiet:hover { border-color: var(--ink-3); }
.btn-small { padding: 9px 16px; font-size: 15px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-note { display: block; font-size: 14px; color: var(--ink-3); margin-top: 12px; }

/* ---------- Hero ---------- */

/* Only the bubbles are clipped, so the screenshot and its shadow are never cut. */
.hero { position: relative; padding: clamp(56px, 10vw, 120px) 0 clamp(24px, 4vw, 48px); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 11em; }
.hero .lede { margin-top: 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubble {
  position: absolute; bottom: -120px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.9) 0 7%, transparent 8%),
              radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 55%, transparent), color-mix(in srgb, var(--c) 18%, transparent) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  animation: rise var(--t) linear infinite;
  animation-delay: var(--d);
  opacity: 0;
}
@keyframes rise {
  0% { transform: translate(0, 0) scale(.8); opacity: 0; }
  10% { opacity: .9; }
  85% { opacity: .7; }
  100% { transform: translate(var(--x), -115vh) scale(1.05); opacity: 0; }
}

.shot {
  margin: clamp(56px, 8vw, 88px) auto 0;
  width: min(1040px, 100% - 2 * var(--gutter));
  perspective: 1400px;
}
.shot img {
  width: 100%;
  /* Matches the 28px rounded corners inside the 1234×855 screenshot at any size, with a little to spare. */
  border-radius: 2.6% / 3.75%;
  box-shadow: var(--shadow-big);
  transform-origin: 50% 0;
  transform: rotateX(calc(var(--tilt, 1) * 18deg)) scale(calc(.94 + (1 - var(--tilt, 1)) * .06));
  will-change: transform;
}

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 12vw, 150px) 0; }
.section-head { max-width: 44em; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head p { margin-top: 18px; }

/* ---------- The scan (sticky disk meter) ---------- */

.scan { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.disk {
  position: sticky; top: 104px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow);
}
.disk-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--ink-2); }
.disk-row strong { color: var(--ink); font-weight: 600; }
.disk-free { font: 700 clamp(52px, 6vw, 76px)/1 var(--display); letter-spacing: -.04em; margin: 22px 0 6px; font-variant-numeric: tabular-nums; }
.disk-free small { font-size: .4em; letter-spacing: 0; color: var(--ink-2); font-weight: 600; margin-inline-start: 6px; }
.meter { height: 10px; border-radius: 99px; background: var(--sunken); border: 1px solid var(--hairline); overflow: hidden; margin: 20px 0 14px; }
.meter span { display: block; height: 100%; width: var(--used, 63%); background: var(--meter); border-radius: inherit; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.disk-moved { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 15px; color: var(--ink-2); }
.disk-moved strong { color: var(--success); }

.cats { list-style: none; margin: 0; padding: 0; }
.cat { padding: 30px 0 34px; border-top: 1px solid var(--hairline); opacity: .35; transition: opacity .5s; }
.cat:last-child { border-bottom: 1px solid var(--hairline); }
.cat.active, .cat.done { opacity: 1; }
.cat-head { display: flex; align-items: center; gap: 14px; }
.cat-head h3 { flex: 1; }
.cat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--wash); color: #0F8296; flex: none; }
.cat-icon svg { width: 22px; height: 22px; }
.cat-size { font: 600 17px var(--body); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cat p { margin: 12px 0 0; margin-inline-start: 54px; color: var(--ink-2); max-width: 32em; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 6px; margin: 12px 0 0; margin-inline-start: 54px; }
.tag-safe { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.tag-review { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }

/* ---------- Sidebar tour ---------- */

.tour { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.side {
  position: sticky; top: 104px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--hairline); border-radius: 18px; padding: 14px 10px;
  font-size: 15px;
}
.side-group { color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 12px 12px 4px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; transition: background .25s, color .25s; }
.side a:hover { background: var(--sunken); }
.side a.on { background: #0E6C7C; color: #fff; }
.side a .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); flex: none; }
.side a.on .dot { background: #fff; }

.pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(72px, 10vw, 120px); }
.page { scroll-margin-top: 100px; }
.page-group { font-size: 15px; color: #0F8296; font-weight: 600; margin-bottom: 10px; }
[data-theme="dark"] .page-group { color: var(--cyan); }
.page > p { margin-top: 14px; color: var(--ink-2); max-width: 36em; }
.page ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 38em; }
.page li { padding-inline-start: 26px; position: relative; color: var(--ink-2); }
.page li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.page li strong { color: var(--ink); font-weight: 600; }

/* Small mock windows, drawn in HTML so they stay sharp and weigh nothing */
.mock {
  margin-top: 28px; background: var(--card); border: 1px solid var(--hairline);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; font-size: 14px;
}
.mock-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hairline); }
.mock-row:first-child { border-top: 0; }
.mock-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-row .meta { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { width: 26px; height: 26px; border-radius: 7px; flex: none; background: var(--c, var(--cyan)); opacity: .85; }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--ink-3); flex: none; }
.check.on { background: #0F8296; border-color: #0F8296; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.pill.crit { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.pill.warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.pill.ok { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.mock .btn-restore { font: 600 13px var(--body); color: var(--link); }

/* ---------- Safety ---------- */

.safety { background: var(--card); border-block: 1px solid var(--hairline); }
.safety-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 80px); }
.never { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.never span { padding: 9px 15px; border-radius: 99px; background: var(--sunken); border: 1px solid var(--hairline); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.never svg { width: 15px; height: 15px; color: var(--success); }
.safety h3 { font-size: clamp(24px, 2.6vw, 30px); }
.safety p { margin-top: 14px; color: var(--ink-2); }

.light { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(56px, 8vw, 88px); padding-top: 40px; border-top: 1px solid var(--hairline); }
.light strong { display: block; font: 700 clamp(34px, 4vw, 46px)/1 var(--display); letter-spacing: -.03em; }
.light span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 15px; max-width: 18em; }

/* ---------- Download band ---------- */

.get { text-align: center; }
.get .icon { width: 96px; height: 96px; margin: 0 auto 28px; }
.get .lede { margin: 18px auto 0; }
.get .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 34px; }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--hairline); padding: 48px 0 56px; font-size: 15px; color: var(--ink-2); }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot h4 { margin: 0 0 12px; font: 600 15px var(--body); color: var(--ink); }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot .brand { margin-bottom: 12px; }
.foot .about { max-width: 26em; }

/* ---------- How to use page ---------- */

.page-hero { padding: clamp(56px, 9vw, 104px) 0 clamp(32px, 5vw, 56px); }
.page-hero h1 { font-size: clamp(40px, 6vw, 72px); }
.page-hero .lede { margin-top: 20px; }

.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.jump a { padding: 8px 15px; border-radius: 99px; border: 1px solid var(--hairline); background: var(--card); color: var(--ink); text-decoration: none; font-size: 15px; }
.jump a:hover { border-color: var(--ink-3); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
  counter-increment: step;
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 20px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 18px;
  padding: 26px 28px;
}
.step::before {
  content: counter(step);
  grid-column: 1; grid-row: 1 / span 9;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 20px var(--display); color: #fff; background: var(--action);
}
/* Every line of a step stays in the text column, however many there are. */
.step > * { grid-column: 2; }
.step p { color: var(--ink-2); margin-top: 8px; max-width: 40em; }
.step .term {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  background: #10233A; color: #E6F6F8; border-radius: 10px; padding: 12px 14px;
  font: 14px/1.4 var(--mono); overflow-x: auto;
}
.step .term code { background: none; border: 0; padding: 0; color: inherit; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy { font: 600 13px var(--body); color: #10233A; background: var(--cyan); border: 0; border-radius: 7px; padding: 5px 10px; cursor: pointer; flex: none; }
.step-note { margin-top: 12px; font-size: 15px; padding: 12px 14px; border-radius: 10px; background: var(--wash); color: var(--ink); }

.howto + .howto { margin-top: clamp(72px, 10vw, 120px); }
.howto .section-head { margin-bottom: 32px; }

.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.place { background: var(--card); border: 1px solid var(--hairline); border-radius: 18px; padding: 24px; }
.place h3 { font-size: 19px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.place h3 kbd { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.place p { color: var(--ink-2); margin-top: 8px; font-size: 16px; }

.keys { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 16px; }
.keys td { padding: 11px 0; border-bottom: 1px solid var(--hairline); color: var(--ink-2); }
.keys td:first-child { width: 120px; color: var(--ink); }
kbd { background: var(--card); border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; padding-block: 20px; padding-inline: 0 36px; font: 600 18px var(--body); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: 4px; top: 16px; font: 400 26px var(--body); color: var(--ink-3); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--ink-2); max-width: 40em; }

/* ---------- Gallery ---------- */

@property --g-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.gallery { position: relative; overflow: hidden; }
.gallery::before {
  content: ""; position: absolute; inset: 18% 0 auto; height: 70%; z-index: -1;
  background: radial-gradient(60% 60% at 50% 40%, var(--wash), transparent 70%);
}
.gallery .section-head { margin-inline: auto; text-align: center; }
.gallery .section-head .lede { margin-inline: auto; }

.g { --dur: 5200ms; --dir: 1; }
:root[dir="rtl"] .g { --dir: -1; }
.g-stage { position: relative; width: min(1040px, 100%); margin-inline: auto; }

/* A slow aurora behind the window, in the app's colours. */
.g-glow {
  position: absolute; inset: 8% 6% -4%; border-radius: 40px; z-index: 0;
  background: conic-gradient(from var(--g-angle), var(--cyan), var(--blue), var(--mint), #7FDCEB, var(--cyan));
  filter: blur(70px); opacity: .32;
  animation: g-spin 22s linear infinite;
}
:root[data-theme="dark"] .g-glow { opacity: .22; }
@keyframes g-spin { to { --g-angle: 360deg; } }

.g-frame {
  position: relative; z-index: 1;
  aspect-ratio: 1225 / 781;
  border-radius: 1.6% / 2.5%;
  box-shadow: var(--shadow-big), 0 0 0 1px rgba(16, 35, 58, .06);
  background: var(--card);
  overflow: hidden;
  cursor: zoom-in;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.g-slide { position: absolute; inset: 0; margin: 0; }
.g-slide img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.g-slide figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Without script the window simply shows the first page; the strip below still lists every one. */
.g-slide:not(.is-active) { display: none; }
.js .g-slide { display: block; }

.js .g-slide {
  opacity: 0; visibility: hidden;
  transform: translateX(calc(var(--dir) * var(--from, 1) * 7%)) scale(.94);
  filter: blur(10px) saturate(.7);
  transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform 1.1s cubic-bezier(.2, .8, .2, 1),
              filter .9s cubic-bezier(.2, .8, .2, 1), visibility 0s 1.1s;
}
.js .g-slide.is-active {
  opacity: 1; visibility: visible; transform: none; filter: none; z-index: 2;
  transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform 1.1s cubic-bezier(.2, .8, .2, 1),
              filter .9s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.js .g-slide.is-leaving {
  visibility: visible; z-index: 1;
  transform: translateX(calc(var(--dir) * var(--from, 1) * -7%)) scale(.94);
}
/* The page drifts closer while it is shown. */
.js .g-slide.is-active img { animation: g-drift calc(var(--dur) + 1.2s) cubic-bezier(.3, .1, .3, 1) both; }
.js .g-slide:nth-child(even).is-active img { transform-origin: 70% 30%; }
.js .g-slide:nth-child(odd).is-active img { transform-origin: 30% 60%; }
@keyframes g-drift { from { transform: scale(1); } to { transform: scale(1.035); } }
.g.paused .g-slide img, .g.paused .g-progress span { animation-play-state: paused; }

/* Arrows: frosted discs on the window's edges. */
.g-arrow {
  position: absolute; top: 50%; z-index: 3;
  width: 52px; height: 52px; margin-top: -26px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .5);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  color: var(--ink); box-shadow: var(--shadow);
  cursor: pointer; opacity: 0;
  transition: opacity .3s, transform .3s cubic-bezier(.2, .8, .2, 1), background .2s;
}
.g-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.g-stage .g-prev { inset-inline-start: -26px; }
.g-stage .g-next { inset-inline-end: -26px; }
.g-stage:hover .g-arrow, .g-stage:focus-within .g-arrow { opacity: 1; }
.g-arrow:hover { background: var(--card); transform: scale(1.08); }
.g-arrow:active { transform: scale(.96); }
@media (hover: none) { .g-arrow { opacity: 1; } }
html:not(.js) .g-arrow { display: none; }

/* Counter, caption and tools under the window. */
.g-bar {
  width: min(1040px, 100%); margin: clamp(28px, 4vw, 40px) auto 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(16px, 3vw, 32px);
}
.g-count { margin: 0; font-family: var(--display); color: var(--ink-3); font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-count b {
  font-size: 48px; font-weight: 700; letter-spacing: -.03em; line-height: 1;
  background: var(--action); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block; min-width: 1.25em;
}
.g-caption { min-height: 3.6em; }
.g-caption h3 { font-size: clamp(22px, 2.4vw, 28px); }
.g-caption p { margin: 6px 0 0; color: var(--ink-2); }
.g-caption.swap > *, .g-count.swap b { animation: g-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.g-caption.swap p { animation-delay: .06s; }
@keyframes g-rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

.g-tools { display: flex; gap: 8px; }
.g-tool {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: color .2s, border-color .2s, transform .2s;
}
.g-tool:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.g-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-tool .i-play { display: none; fill: currentColor; stroke: none; }
.g-tool[aria-pressed="true"] .i-play { display: block; }
.g-tool[aria-pressed="true"] .i-pause { display: none; }
html:not(.js) .g-tools { display: none; }

.g-progress { width: min(1040px, 100%); height: 3px; margin: 18px auto 0; border-radius: 3px; background: var(--hairline); overflow: hidden; }
.g-progress span { display: block; height: 100%; background: var(--meter); transform: scaleX(0); transform-origin: left; }
:root[dir="rtl"] .g-progress span { transform-origin: right; background: linear-gradient(270deg, var(--cyan), var(--blue)); }
.g-progress span.run { animation: g-fill var(--dur) linear forwards; }
@keyframes g-fill { to { transform: scaleX(1); } }

/* The strip: every page as a small card, the current one lifted and ringed. */
.g-strip {
  list-style: none; margin: 22px auto 0; padding: 14px 4px 18px;
  width: min(1040px, 100%);
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.g-strip::-webkit-scrollbar { display: none; }
.g-strip li { flex: none; scroll-snap-align: center; }
.g-strip button {
  position: relative; width: 168px; padding: 0; border: 0; background: none; cursor: pointer; text-align: start;
  color: var(--ink-3); font: 500 13px/1.3 var(--body);
  opacity: .62; filter: saturate(.6);
  transition: opacity .35s, filter .35s, transform .45s cubic-bezier(.2, .8, .2, 1), color .3s;
}
.g-strip img {
  width: 100%; aspect-ratio: 1225 / 781; border-radius: 9px; background: var(--card);
  box-shadow: 0 1px 2px rgba(16, 35, 58, .08), 0 8px 18px -10px rgba(16, 35, 58, .3);
  outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .35s, box-shadow .35s;
}
.g-strip span { display: flex; gap: 6px; margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-strip i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-3); opacity: .8; }
.g-strip button:hover { opacity: .9; filter: none; transform: translateY(-3px); }
.g-strip button[aria-selected="true"] { opacity: 1; filter: none; color: var(--ink); transform: translateY(-6px); }
.g-strip button[aria-selected="true"] img { outline-color: var(--cyan); box-shadow: 0 14px 30px -12px rgba(36, 88, 194, .55); }
.g-strip button[aria-selected="true"] i { background: var(--action); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 1; font-weight: 700; }

/* Full size: the page opens over a dimmed, blurred site. */
.g-lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; display: none; place-items: center; overflow: hidden;
}
.g-lightbox[open] { display: grid; }
.g-lightbox::backdrop { background: rgba(8, 14, 22, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.g-lightbox img {
  max-width: min(94vw, 1225px); max-height: 82vh; width: auto; height: auto;
  border-radius: 12px; box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .7);
  animation: g-pop .5s cubic-bezier(.2, .9, .25, 1.05) both;
}
.g-lightbox img.swap { animation: g-fade .45s cubic-bezier(.2, .8, .2, 1) both; }
.g-lb-caption { position: absolute; bottom: 4vh; inset-inline: 0; margin: 0; text-align: center; color: #EEF2F6; font: 500 16px var(--body); padding-inline: 80px; }
.g-lb-caption b { font-family: var(--display); margin-inline-end: 8px; }
.g-lightbox .g-arrow { opacity: 1; position: fixed; }
.g-lightbox .g-prev { inset-inline-start: 3vw; }
.g-lightbox .g-next { inset-inline-end: 3vw; }
.g-close {
  position: fixed; top: 22px; inset-inline-end: 22px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer; transition: background .2s, transform .2s;
}
.g-close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }
.g-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@keyframes g-pop { from { opacity: 0; transform: scale(.9) translateY(14px); } }
@keyframes g-fade { from { opacity: 0; transform: scale(.98); } }

@media (max-width: 640px) {
  .g-bar { grid-template-columns: auto minmax(0, 1fr); }
  .g-tools { grid-column: 1 / -1; justify-content: flex-end; margin-top: -8px; }
  .g-count b { font-size: 38px; }
  .g-arrow { width: 42px; height: 42px; margin-top: -21px; }
  .g-stage .g-prev { inset-inline-start: -8px; }
  .g-stage .g-next { inset-inline-end: -8px; }
  .g-strip button { width: 128px; }
  .g-lb-caption { padding-inline: 24px; bottom: 3vh; font-size: 14px; }
  .g-lightbox .g-arrow { top: auto; bottom: 10vh; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .g-glow { animation: none; }
  .js .g-slide, .js .g-slide.is-active { transition: opacity .2s, visibility 0s; transform: none; filter: none; }
  .js .g-slide.is-active img, .g-caption.swap > *, .g-count.swap b, .g-lightbox img { animation: none; }
  .g-progress { display: none; }
}

/* ---------- Scroll reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { display: none; }
  .shot img { transform: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cat { opacity: 1; }
  .meter span { transition: none; }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .scan, .tour, .safety-grid { grid-template-columns: minmax(0, 1fr); }
  .disk { top: 72px; z-index: 5; padding: 16px 18px; border-radius: 16px; }
  .disk-free { font-size: 40px; margin: 10px 0 0; }
  .disk .meter { margin: 12px 0 8px; }
  .disk-moved { display: none; }
  .side { display: none; }
  .places { grid-template-columns: minmax(0, 1fr); }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot .wrap > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .top nav a:not(.keep) { display: none; }
  .top .wrap { gap: 10px; }
  .brand { font-size: 18px; }
  .lang { height: 34px; min-width: 34px; padding: 0 8px; }
  .cat p, .tag { margin-inline-start: 0; }
  .light { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .step { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .step > * { grid-column: 1; }
  .step::before { grid-row: auto; margin-bottom: 8px; }
  .hero .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Legal pages (generated by Scripts/render-legal.py) */
.legal { max-width: 46em; margin-bottom: clamp(80px, 12vw, 140px); color: var(--ink-2); }
.legal h2 { font-size: clamp(22px, 3vw, 28px); color: var(--ink); margin: 44px 0 12px; }
.legal p, .legal li { margin-top: 10px; }
.legal ol, .legal ul { padding-inline-start: 1.4em; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal-table { overflow-x: auto; margin-top: 16px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: start; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); }
.legal th { color: var(--ink); }
.legal-license { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
