/* QRIS Dinamis: shared styles for index.html and 404.html */

:root {
  --green: #34c759; /* brand colour, same as the app */
  --green-hover: #2bb04e;
  --green-text: #14783a; /* --green is only 2.2:1 on white, so green text uses this shade */
  --ink: #0c1f14;
  --ink-soft: #1c3a28;
  --muted: #46584c;
  --on-dark-muted: #b9cbbf;
  --on-dark-line: #2c4a37;
  --tint: #eefaf1;
  --line: #d3e4d8;
  --radius-s: 12px;
  --radius-m: 20px;
  --bg: #fff;
  --text: var(--ink); /* page text; --ink itself stays dark for text on green and dark bands */
  --highlight: var(--green);
  --screen: #fff; /* phone status bar and bottom strip, matches the screenshot background */
  --screen-ink: #000;
  color-scheme: light;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* the four scanner corners from the app icon, drawn as a 9-slice border image */
  --brackets: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 144 144' width='144' height='144'%3E%3Cpath fill='none' stroke='%2334c759' stroke-width='8' stroke-linecap='round' d='M4 44V20A16 16 0 0 1 20 4h24M100 4h24a16 16 0 0 1 16 16v24M140 100v24a16 16 0 0 1-16 16h-24M44 140H20A16 16 0 0 1 4 124v-24'/%3E%3C/svg%3E");
}

/* set by main.js from the saved choice or the system setting */
:root[data-theme="dark"] {
  --bg: #070d09;
  --text: #e8f2eb;
  --muted: #a9bdb0;
  --green-text: #4cd472;
  --tint: #11221a;
  --line: #24402e;
  --highlight: #1e7a3a; /* light text on the bright green would fail contrast */
  --screen: #0f172a; /* background of the -dark.png screenshots */
  --screen-ink: #fff;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  scroll-padding-top: 88px; /* keeps anchored sections clear of the sticky header */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3,
p,
ol,
dl,
dd {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

a,
button {
  cursor: pointer;
}

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

.on-dark :focus-visible {
  outline-color: #fff;
}

h1,
h2 {
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 1.2rem + 4.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.container {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(56px, 8vw, 112px);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-s);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: var(--ink-soft);
}

.btn-outline {
  border: 1.5px solid var(--text);
  background: var(--bg);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--tint);
}

.btn-small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.9375rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--tint);
  color: var(--text);
}

.icon-btn:hover {
  background: var(--line);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--green-text);
  font-weight: 700;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: var(--text);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.menu a:not(.btn):hover {
  background: var(--tint);
  color: var(--text);
}

/* "page" on the privacy policy, "location" for the section in view on the home page (main.js) */
.menu a[aria-current] {
  color: var(--text);
}

.menu .btn {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
}

.theme-toggle {
  display: none; /* needs JavaScript */
}

.menu .theme-toggle {
  margin-left: 8px;
}

.drawer-head .theme-toggle {
  margin: 0 8px 0 auto;
}

.js .theme-toggle {
  display: inline-flex;
}

.icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* below 800px the four menu items no longer fit on one row; keep in step with main.js */
@media (max-width: 799px) {
  .nav {
    flex-wrap: wrap;
  }

  .menu {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 16px;
  }

  .menu a:not(.btn) {
    min-height: 48px;
    font-size: 1rem;
  }

  .menu .btn {
    margin: 8px 0 0;
  }

  /* without JavaScript the links stay inline as above; with it they move into the drawer */
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .menu {
    display: none;
  }
}

/* ---------- Mobile drawer ---------- */

/* a native <dialog>: focus trap, Escape and the backdrop come from the browser */
.drawer {
  width: min(88vw, 340px);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
  translate: 100% 0;
}

.drawer[open] {
  translate: 0 0;
}

.drawer::backdrop {
  background: rgba(12, 31, 20, 0);
}

.drawer[open]::backdrop {
  background: rgba(12, 31, 20, 0.6);
}

html:has(.drawer[open]) {
  overflow: hidden; /* the page behind must not scroll */
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 12px 20px max(20px, env(safe-area-inset-bottom));
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 16px 24px;
}

.drawer-nav a {
  display: block;
  margin-inline: -12px;
  padding: 14px 12px;
  border-radius: var(--radius-s);
  text-decoration: none;
}

.drawer-nav a:hover {
  background: var(--tint);
}

.drawer-nav strong {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

/* same highlighter stroke as the headline, as press feedback */
.drawer-nav a:hover strong,
.drawer-nav a:active strong {
  background: linear-gradient(transparent 58%, var(--highlight) 58% 92%, transparent 92%);
}

.drawer-nav span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.drawer-cta {
  margin-top: auto; /* pinned to the bottom of the drawer */
  padding: 24px;
  border-radius: var(--radius-m);
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
}

.drawer-cta-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.drawer-cta p + p {
  margin-top: 6px;
}

.drawer-cta .btn {
  width: 100%;
  margin-top: 20px;
}

/* ---------- Scanner brackets and phone frame ---------- */

.scan {
  --scan-pad: clamp(24px, 4vw, 40px);
  position: relative;
  padding: var(--scan-pad);
}

.scan::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 48px solid transparent;
  border-image: var(--brackets) 48;
  pointer-events: none;
}

.phone {
  position: relative;
  width: min(100%, 290px);
  padding: 30px 0 16px;
  border: 9px solid var(--ink);
  border-radius: 42px;
  background: var(--screen);
  overflow: hidden;
  container-type: inline-size;
}

.phone::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 64px;
  height: 14px;
  margin-left: -32px;
  border-radius: 7px;
  background: var(--ink);
}

/* iOS-style status bar; sized in cqi so the clock and icons clear the notch on the smallest phones */
.status-bar {
  position: absolute;
  inset: 0 0 auto;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 9cqi;
  color: var(--screen-ink);
  font-family: -apple-system, "SF Pro Text", var(--font);
  font-size: 4.4cqi;
  font-weight: 600;
  line-height: 1;
}

.status-bar svg {
  height: 3.6cqi;
  fill: currentColor;
}

.phone-small .status-bar {
  height: 24px;
}

.phone img {
  width: 100%;
  object-fit: cover;
  object-position: top;
}

/* a phone that rises out of the bottom edge of its panel */
.phone-cut {
  padding-bottom: 0;
  border-bottom: 0;
  border-radius: 42px 42px 0 0;
}

.phone-small {
  padding-top: 24px;
  border-width: 7px;
  border-bottom: 0;
  border-radius: 32px 32px 0 0;
}

.phone-small::before {
  top: 7px;
  width: 44px;
  height: 10px;
  margin-left: -22px;
}

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

.hero {
  padding-block: clamp(48px, 8vw, 96px);
  background: var(--tint);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.mark {
  /* highlighter stroke in the brand green; the text stays ink so contrast holds */
  padding-inline: 0.08em;
  margin-inline: -0.08em;
  background: linear-gradient(transparent 58%, var(--highlight) 58% 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  white-space: nowrap;
}

.lede {
  max-width: 34em;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero .scan {
  /* hug the 290px phone; otherwise the frame grows to the image's intrinsic 372px and the phone sits left */
  width: min(100%, 290px + 2 * var(--scan-pad));
}

.hero .phone {
  /* the only shadow on the page: lifts the main product shot */
  box-shadow: 0 24px 48px -16px rgba(12, 31, 20, 0.35);
}

.hero .phone img {
  aspect-ratio: 372 / 600; /* trims the empty lower part of the screenshot */
}

@media (min-width: 760px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(32px, 5vw, 72px);
  }
}

/* ---------- Static vs dynamic ---------- */

.compare {
  background: var(--ink);
  color: #fff;
}

.compare-grid {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}

.compare-item {
  position: relative;
  padding: 32px;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--radius-m);
}

.compare-item h3 {
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
  font-weight: 700;
}

.compare-big {
  margin-top: 10px;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.compare-item p:last-child {
  margin-top: 10px;
  color: var(--on-dark-muted);
}

.compare-item.scan {
  border-color: transparent;
}

.compare-item.scan h3 {
  color: var(--green);
}

@media (min-width: 720px) {
  .compare-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ---------- Shared: tinted panel that holds phone shots ---------- */

.panel {
  display: flex;
  justify-content: center;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 40px) 0;
  border-radius: var(--radius-m);
  background: var(--tint);
  overflow: hidden;
}

/* ---------- How it works ---------- */

.steps-grid {
  display: grid;
  gap: 40px;
  align-items: start;
}

.steps {
  margin-top: 32px;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  color: var(--green-text);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.steps h3,
.feature-list dt {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.steps p,
.feature-list dd {
  margin-top: 6px;
  color: var(--muted);
}

.steps-visual img {
  aspect-ratio: 372 / 540;
}

@media (min-width: 760px) {
  .steps-grid {
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(40px, 6vw, 96px);
  }

  .steps-visual {
    position: sticky;
    top: 100px;
    order: -1;
  }
}

/* ---------- Features ---------- */

.features {
  padding-top: 0;
}

.features-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.feature-list {
  margin-top: 32px;
}

.feature-list div {
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.phones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 3vw, 28px);
  align-items: end;
  justify-items: center;
}

.phones .phone {
  width: min(100%, 230px);
}

/* different crops stagger the two phones while both stay flush with the panel edge */
.phones .phone:first-child img {
  aspect-ratio: 372 / 440;
}

.phones .phone:last-child img {
  aspect-ratio: 372 / 560;
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 96px);
  }
}

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

.cta {
  padding-block: clamp(56px, 8vw, 96px);
  background: var(--green);
  color: var(--ink); /* stays dark on green in both themes */
}

.cta-inner {
  display: grid;
  gap: 28px;
  align-items: center;
}

.cta p {
  max-width: 36em;
  margin-top: 12px;
  font-size: 1.125rem;
}

@media (min-width: 760px) {
  .cta-inner {
    grid-template-columns: 1fr auto;
    gap: 48px;
  }
}

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

.site-footer {
  padding-block: 40px 32px;
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 48px;
}

.site-footer .brand {
  color: #fff;
}

.footer-about p {
  max-width: 28em;
  margin-top: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 24px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: #fff;
  text-underline-offset: 4px;
}

.footer-links a:hover {
  color: var(--green);
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--on-dark-line);
}

/* ---------- 404 ---------- */

.notfound {
  padding-block: clamp(64px, 12vw, 140px);
  background: var(--tint);
  text-align: center;
}

.notfound .scan {
  display: inline-block;
  padding: 20px 48px;
}

.notfound .notfound-code {
  margin: 0;
  color: var(--text);
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.notfound h1 {
  margin-top: 32px;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.notfound p {
  max-width: 30em;
  margin: 12px auto 0;
  color: var(--muted);
}

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

/* ---------- Privacy policy ---------- */

.policy-head {
  padding-block: clamp(48px, 7vw, 88px);
  background: var(--tint);
}

.policy-head h1 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
}

.policy-date {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.policy {
  max-width: 44rem; /* a reading column, not the full container */
  padding-block: clamp(40px, 6vw, 72px);
}

.policy h2 {
  margin-top: 48px;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  letter-spacing: -0.02em;
}

.policy p,
.policy ul {
  margin: 12px 0 0;
}

.policy > p:first-child {
  margin-top: 0;
}

.policy ul {
  padding-left: 1.25em;
}

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

.policy a {
  color: var(--green-text);
  font-weight: 600;
  text-underline-offset: 3px;
  overflow-wrap: anywhere; /* the email address must not push a narrow screen sideways */
}

.policy a:hover {
  color: var(--text);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* drawer slides in and out; browsers without @starting-style just show and hide it */
  .drawer {
    transition: translate 0.28s ease, display 0.28s allow-discrete, overlay 0.28s allow-discrete;
  }

  .drawer::backdrop {
    transition: background-color 0.28s ease, display 0.28s allow-discrete, overlay 0.28s allow-discrete;
  }

  @starting-style {
    .drawer[open] {
      translate: 100% 0;
    }

    .drawer[open]::backdrop {
      background: rgba(12, 31, 20, 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
