/* FITS QR — palette lifted from fits.dk's own stylesheet. */
:root {
  --navy: #0b1524;
  --navy-mid: #13233e;
  --indigo: #0818a0;
  --violet: #586eff;
  --teal: #00b2b8;
  --teal-light: #7feaef;
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.62);
  --ink-faint: rgba(255, 255, 255, 0.42);
  --hairline: rgba(255, 255, 255, 0.12);
  --display: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shell: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

/* ── Header ─────────────────────────────────────────────────────────── */
.masthead {
  background: rgba(11, 21, 36, 0.82);
  border-bottom: 1px solid var(--hairline);
}
.masthead .shell {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 20px;
  min-height: 64px;
}
/* The shared navigation (css/cocode-nav.css) lays the links out; this gives them the site's look. */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand img { width: 30px; height: 30px; display: block; border-radius: 7px; }
.masthead .cocode-nav { flex: 1 1 auto; gap: 0 4px; }
.masthead .cocode-nav a { padding: 0 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-dim); }
.masthead .cocode-nav a:hover { color: var(--ink); }
.masthead .cocode-nav .brand { padding: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
/* Phones: the language switch sits on the name's row, top right, so the links keep their own row. */
@media (max-width: 47.99em) {
  .lang-switch { position: absolute; top: 10px; right: 16px; }
  .masthead .cocode-nav .brand + a { margin-left: -10px; }
}
/* Wide screens: one row, kept in view while scrolling. */
@media (min-width: 48em) {
  .masthead { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
}
section[id] { scroll-margin-top: 72px; }
main:focus { outline: 0; }
.lang-switch:hover { color: var(--ink); border-color: var(--teal); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--teal);
  color: #04222a;
}
.btn-primary:hover { background: var(--teal-light); color: #04222a; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--teal); transform: translateY(-1px); }
.btn-sm { font-size: 13.5px; padding: 8px 15px; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 68px 0 40px;
  background:
    radial-gradient(900px 620px at 88% 8%, rgba(88, 110, 255, 0.30), transparent 68%),
    radial-gradient(760px 540px at 6% 46%, rgba(0, 178, 184, 0.20), transparent 68%),
    linear-gradient(172deg, var(--navy) 0%, var(--navy-mid) 52%, #0a1a5c 100%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at 50% 30%, #000 45%, transparent 78%);
}
.hero .shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal-light);
  padding: 6px 13px;
  border: 1px solid rgba(0, 178, 184, 0.42);
  border-radius: 999px;
  background: rgba(0, 178, 184, 0.09);
}
h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 5.4vw, 4.15rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 22px 0 0;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  color: var(--teal-light);
}
.lede {
  font-size: 1.135rem;
  color: var(--ink-dim);
  max-width: 46ch;
  margin: 20px 0 0;
  text-wrap: pretty;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.cta-note {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 14px 0 0;
}

/* ── Phone replica — the app screen, one-to-one ─────────────────────── */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 46px;
  padding: 11px;
  background: linear-gradient(160deg, #2b3752, #0d1728 60%);
  box-shadow:
    0 44px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
  justify-self: end;
  flex: none;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: linear-gradient(168deg, #0b1524 0%, #13233e 42%, #0818a0 100%);
  touch-action: pan-y;
  user-select: none;
}
.phone-screen::before,
.phone-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.phone-screen::before {
  top: -120px; left: -140px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0, 178, 184, 0.20) 0%, rgba(0, 178, 184, 0) 70%);
}
.phone-screen::after {
  bottom: -160px; right: -120px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(88, 110, 255, 0.28) 0%, rgba(88, 110, 255, 0) 70%);
}
.screen-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 30px 0 14px;
}
.app-logo { width: 126px; height: auto; display: block; }
.app-tagline {
  margin-top: 9px;
  padding: 5px 14px;
  border: 1px solid rgba(0, 178, 184, 0.45);
  border-radius: 999px;
  background: rgba(0, 178, 184, 0.10);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-light);
  white-space: nowrap;
}

/* the swipeable track */
.pager {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  margin-top: 12px;
}
.track {
  display: flex;
  height: 100%;
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.track.dragging { transition: none; }
.card {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}

.qr-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-glow {
  position: absolute;
  width: min(100%, 296px);
  aspect-ratio: 1;
  border-radius: 40px;
  background: radial-gradient(circle, rgba(0, 178, 184, 0.55) 0%, rgba(0, 178, 184, 0) 68%);
  filter: blur(20px);
  animation: pulse 4.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1.02); opacity: 0.55; }
  50% { transform: scale(1.14); opacity: 0.85; }
}
.qr-card {
  position: relative;
  width: min(100%, 296px);
  aspect-ratio: 1;
  padding: 14px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.qr-card img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.scan-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
}
.scan-hint svg { width: 16px; height: 16px; flex: none; }

.rows {
  margin-top: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.10);
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(11, 21, 36, 0.62);
}
.row svg { width: 18px; height: 18px; flex: none; }
.row-name { font-size: 15px; font-weight: 600; }
.row-role { font-size: 11px; font-weight: 500; color: rgba(127, 234, 239, 0.75); }
.row-value { font-size: 14px; font-weight: 500; }
.row-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(9, 26, 38, 0.78);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}
.row-foot b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--teal-light);
}
.row-foot i {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(127, 234, 239, 0.5); flex: none;
}

.dots {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
}
.dots button {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: width 0.28s ease, background 0.28s ease;
}
.dots button[aria-current="true"] { width: 22px; background: var(--teal); }

/* ── Stage: the phone plus its fullscreen controls ──────────────────── */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  justify-self: end;
}
.stage-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.stage-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
}
.stage-link:hover { color: var(--teal-light); border-bottom-color: currentColor; }

/* The app screen is a fixed 390x844 box. Filling a viewport scales it as one block,
   so the layout stays pixel-for-pixel what the phone shows instead of reflowing. */
.phone:fullscreen {
  transform: scale(var(--fit, 1));
  transform-origin: center center;
  box-shadow: none;
  border-radius: 0;
  background: none;
  padding: 0;
}
.phone:fullscreen .phone-screen { border-radius: 0; }
.phone::backdrop { background: #05090f; }

/* ── Kiosk page: the app alone ──────────────────────────────────────── */
body.kiosk {
  background: #05090f;
  overflow: hidden;
}
/* Fixed to the viewport so the scaled phone is centred against the real screen box,
   with no page flow to shift it. */
.kiosk-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.kiosk .phone {
  transform: scale(var(--fit, 1));
  transform-origin: center center;
  justify-self: auto;
}
.kiosk-back,
.kiosk-fs {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  z-index: 5;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.55;
  transition: opacity 0.18s ease;
}
.kiosk-back { left: max(16px, env(safe-area-inset-left)); color: var(--ink); }
.kiosk-fs { right: max(16px, env(safe-area-inset-right)); background: rgba(11, 21, 36, 0.7); }
.kiosk-back:hover,
.kiosk-fs:hover { opacity: 1; }

/* Small screens: the app takes the whole display and the chrome gets out of the way. */
@media (max-width: 520px) {
  body.kiosk .phone { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  body.kiosk .phone-screen { border-radius: 0; }
  .kiosk-back span, .kiosk-fs span { display: none; }
}

/* ── vCard payload readout — the signature panel ────────────────────── */
.payload {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: #08111d;
  padding: 44px 0;
}
.payload .shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 44px;
  align-items: start;
}
.payload h2 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.payload p {
  color: var(--ink-dim);
  margin: 12px 0 0;
  max-width: 42ch;
  text-wrap: pretty;
}
.vcard {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-dim);
  background: #0b1524;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 20px 22px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.vcard .k { color: var(--teal); }
.vcard .v { color: var(--ink); }

/* Rendered only when JavaScript is off, which is the one state where the vCard above
   still shows its masked digits. Spans both columns so it reads as a footnote. */
.payload .shell > noscript { grid-column: 1 / -1; }
.vcard-note {
  max-width: none;
  font-size: 0.875rem;
  border-left: 2px solid var(--hairline);
  padding-left: 14px;
}

/* ── Facts ──────────────────────────────────────────────────────────── */
.facts { padding: 56px 0; }
.facts .shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.fact {
  padding: 26px 24px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}
.fact svg { width: 22px; height: 22px; color: var(--teal); }
.fact h3 {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 700;
  margin: 14px 0 6px;
  letter-spacing: -0.01em;
}
.fact p { margin: 0; font-size: 14.5px; color: var(--ink-dim); text-wrap: pretty; }

/* ── Install steps — a real sequence, so it is numbered ─────────────── */
.get {
  padding: 8px 0 72px;
}
.get h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.get > .shell > p {
  color: var(--ink-dim);
  margin: 0 0 20px;
  max-width: 54ch;
}
/* The shared cocode-apps install block: F-Droid first, then the APK (the main button), then Obtainium. */
.install {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}
.install a,
.install .fdroid-soon {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.install .fdroid-soon {
  padding: 0 20px;
  border: 1px dashed var(--ink-faint);
  border-radius: 999px;
  color: var(--ink-dim);
}
.install li:nth-child(2) a {
  padding: 0 22px;
  border-radius: 999px;
  background: var(--teal);
  color: #04222a;
}
.install li:nth-child(2) a:hover { background: var(--teal-light); color: #04222a; }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 24px 22px 22px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--teal);
}
.steps h3 {
  font-family: var(--display);
  font-size: 1.04rem;
  font-weight: 700;
  margin: 10px 0 6px;
}
.steps p { margin: 0; font-size: 14.5px; color: var(--ink-dim); text-wrap: pretty; }
.steps code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--teal-light);
  background: rgba(0, 178, 184, 0.10);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--hairline);
  padding: 22px 0 32px;
  font-size: 14px;
  color: var(--ink-faint);
}
.site-foot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: center;
}
.site-foot .cocode-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin-right: auto; }
.site-foot .cocode-footer a { padding: 0; color: var(--ink-dim); }
.site-foot .cocode-footer a:hover,
.site-foot .foot-about:hover { color: var(--ink); }
.site-foot .foot-about { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-dim); }

/* ── Persian/RTL and Danish share the LTR layout; Danish needs nothing ── */

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  .hero .shell {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 44px;
  }
  .lede { max-width: 52ch; }
  .cta-row { justify-content: center; }
  .stage { justify-self: center; }
  .payload .shell { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .payload p { max-width: none; }
}

/* Laptop-height viewports: scale the whole phone so the app screen keeps its exact
   390x844 proportions instead of being cropped. */
@media (min-width: 1061px) and (max-height: 920px) {
  .hero .phone {
    transform: scale(0.82);
    transform-origin: top center;
    margin-bottom: -150px;
  }
  .hero { padding-top: 46px; }
}

@media (max-width: 460px) {
  .shell { padding: 0 16px; }
  .hero { padding: 44px 0 30px; }
  /* The phone scales as one block so the app screen keeps its exact proportions. */
  .hero .phone {
    width: 390px;
    transform: scale(var(--phone-scale, 0.86));
    transform-origin: top center;
    margin-bottom: calc(844px * (var(--phone-scale, 0.86) - 1));
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qr-glow { animation: none; }
  .track { transition: none; }
  .btn:hover { transform: none; }
}
