/* Calctro: palette taken from the calculator itself. */
:root {
  --glass: #e4e8de;        /* page: pale LCD glass */
  --glass-deep: #c3cbb5;   /* LCD window */
  --ink: #1d221e;          /* segment ink */
  --ink-soft: #4b544d;
  --gold: #a27a26;         /* f shift */
  --gold-light: #d7b25e;
  --blue: #2b65a6;         /* g shift */
  --blue-light: #7fb0e6;
  --body: #2a2521;         /* calculator body */
  --body-deep: #1b1714;
  --cap-text: #f3f0e8;
  --measure: 38rem;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--glass);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); max-width: 14ch; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.45rem; }
p { margin: 0; }

a { color: var(--blue); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; padding: 8px 12px;
  background: var(--ink); color: var(--glass); z-index: 10;
}
.skip:focus { top: 8px; }

/* ---------- Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  max-width: 1280px; margin: 0 auto;
}
.wordmark { display: block; width: 132px; color: var(--ink); }
.wordmark svg { display: block; width: 100%; height: auto; }
.top__nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-weight: 500; }
.top__nav a { color: var(--ink); text-decoration: none; }
.top__nav a:hover { text-decoration: underline; }
.top__cta {
  padding: 6px 14px; border-radius: 6px;
  background: var(--body); color: var(--cap-text) !important;
}
.top__cta:hover { background: var(--body-deep); text-decoration: none !important; }
@media (max-width: 640px) {
  .top__nav a:not(.top__cta) { display: none; }
}

/* ---------- LCD svg (shared) */
.lcd__svg { display: block; width: 100%; height: auto; }
.lcd__svg .on { fill: var(--ink); }
.lcd__svg .off { fill: var(--ink); opacity: 0.055; }
.lcd__svg .ann { font: 600 10px "Barlow", sans-serif; fill: var(--ink); }
.lcd__svg .ann.off { opacity: 0; }

/* ---------- Hero */
.hero { max-width: 1280px; margin: 0 auto; padding: 48px var(--gutter) 88px; }
.hero__mark {
  max-width: 640px;
  margin: 8px 0 40px;
}
.hero__mark .off { opacity: 0.075; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.hero__copy { display: grid; gap: 22px; padding-top: 8px; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 30rem; }
.hero__price { color: var(--ink-soft); max-width: 26rem; }
.hero__calc { display: grid; gap: 14px; }
.hero__try { color: var(--ink-soft); font-size: 0.98rem; }
.hero__note { min-height: 1.6em; color: var(--blue); font-size: 0.98rem; }
kbd {
  font: 600 0.82rem "Barlow Condensed", sans-serif;
  padding: 1px 7px; border-radius: 4px;
  background: var(--body); color: var(--cap-text);
  box-shadow: 0 2px 0 var(--body-deep);
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__mark { margin-bottom: 28px; }
}
@media (max-width: 720px) {
  .hero__calc { max-width: 420px; }
}

/* ---------- Store buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-grid; gap: 0; min-width: 168px;
  padding: 9px 18px 10px; border-radius: 10px;
  background: var(--ink); color: var(--glass); text-decoration: none;
  line-height: 1.15;
}
.store__note { font-size: 0.78rem; opacity: 0.8; }
.store__name { font: 600 1.35rem "Barlow Condensed", sans-serif; }
.store[href]:hover { background: #000; }
.store[aria-disabled="true"] { cursor: default; }
.stores--dark .store { background: var(--cap-text); color: var(--body); }

/* ---------- Sections */
.why, .models, .screens {
  max-width: 1280px; margin: 0 auto;
  padding: 72px var(--gutter);
  border-top: 1px solid rgba(29, 34, 30, 0.14);
}
.section-lede { margin: 14px 0 44px; max-width: var(--measure); color: var(--ink-soft); font-size: 1.12rem; }

.proof {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: 26px 0;
}
.proof + .proof { border-top: 1px solid rgba(29, 34, 30, 0.1); }
.proof__lcd {
  background: var(--glass-deep);
  border-radius: 10px;
  padding: 14px 18px 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
  max-width: 460px;
}
.proof__text { display: grid; gap: 8px; max-width: var(--measure); }
.proof__text p { color: var(--ink-soft); }
@media (max-width: 760px) {
  .proof { grid-template-columns: 1fr; }
}

.facts {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 48px;
}
.facts li { max-width: 34rem; color: var(--ink-soft); padding-left: 18px; border-left: 3px solid var(--gold); }
.facts li:nth-child(even) { border-left-color: var(--blue); }
.facts strong { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Models */
.models__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 36px;
}
.model { margin: 0; display: grid; gap: 16px; align-content: start; }
.model figcaption { display: grid; gap: 6px; }
.model figcaption p { color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 1000px) { .models__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .models__grid { grid-template-columns: 1fr; } }

/* ---------- Devices */
.screens__grid {
  display: grid;
  grid-template-columns: 1.55fr 0.65fr;
  grid-template-areas: "land port" "tab port" "fold fold";
  gap: 44px 40px;
  align-items: end;
}
.device { margin: 0; display: grid; gap: 12px; }
.device figcaption { color: var(--ink-soft); font-size: 0.98rem; max-width: 30rem; }
.device__screen {
  position: relative;
  background: #d9ddd4;
  border: 10px solid #121212;
  border-radius: 28px;
  overflow: hidden;
  display: grid; place-items: center;
}
.device__face { width: 88%; }
.device--phone-land { grid-area: land; }
.device--phone-land .device__screen { aspect-ratio: 19.5 / 9; }
.device--phone-land .device__face { width: 70%; }
.device--phone-port { grid-area: port; width: 100%; max-width: 300px; justify-self: end; }
.device--phone-port .device__screen { aspect-ratio: 9 / 19.5; border-radius: 34px; place-items: end center; padding-bottom: 6%; }
.device--phone-port .device__face { width: 94%; }
.device--tablet { grid-area: tab; }
.device--tablet .device__screen { aspect-ratio: 4 / 3; border-width: 14px; border-radius: 22px; }
.device--tablet .device__face { width: 74%; }
.device--fold { grid-area: fold; width: 100%; max-width: 640px; }
.device--fold .device__screen { aspect-ratio: 1 / 0.92; border-radius: 24px; place-items: start center; }
.device--fold .device__face { width: 90%; margin-top: 30%; }
.device__crease {
  position: absolute; left: 0; right: 0; top: 50%; height: 10px; transform: translateY(-50%);
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.16) 50%, rgba(0,0,0,0));
  pointer-events: none;
}
@media (max-width: 820px) {
  .screens__grid { grid-template-columns: 1fr; grid-template-areas: "land" "port" "tab" "fold"; }
  .device--phone-port { justify-self: start; }
}

/* ---------- Download */
.download { background: var(--body); color: var(--cap-text); }
.download__inner {
  max-width: 1280px; margin: 0 auto;
  padding: 80px var(--gutter);
  display: grid; gap: 18px; justify-items: start;
}
.download p { color: #cfc8bd; max-width: var(--measure); font-size: 1.12rem; }
.download h2 { color: var(--gold-light); }

.foot {
  max-width: 1280px; margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--ink-soft); font-size: 0.95rem;
}

/* =========================================================
   Calculator face (sizes are relative to the face width)
   ========================================================= */
.face-host { container-type: inline-size; }
.face {
  --t1: #cbb27a; --t2: #f1dfae; --t3: #a88a4c;   /* gold trim */
  position: relative;
  display: grid;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.12)),
    var(--body);
  border-radius: 3.2cqw;
  box-shadow: 0 1.6cqw 3.6cqw rgba(20, 16, 12, 0.32), inset 0 0.25cqw 0 rgba(255,255,255,0.08);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
}
.face--silver { --t1: #b9bcbd; --t2: #eef0f0; --t3: #8d9193; }

.face__band {
  display: flex; align-items: center; gap: 3cqw;
  border-radius: 1.4cqw;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 0.15cqw, rgba(0,0,0,0.035) 0.15cqw 0.4cqw),
    linear-gradient(180deg, var(--t2), var(--t1) 55%, var(--t3));
}
.lcd {
  background: linear-gradient(180deg, #b9c1a9, var(--glass-deep));
  border-radius: 0.9cqw;
  box-shadow: inset 0 0.35cqw 0.8cqw rgba(0,0,0,0.38), 0 0 0 0.35cqw rgba(0,0,0,0.55);
}
.face__brand { margin-left: auto; display: grid; justify-items: end; line-height: 1; color: #2a2521; }
.face__logo { font: 600 1em "Barlow", sans-serif; letter-spacing: 0.02em; }
.face__badge { font-weight: 700; letter-spacing: 0.06em; opacity: 0.85; }

.face__keys { display: grid; position: relative; min-height: 0; }
.key {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: center;
  cursor: default;
}
button.key { cursor: pointer; }
.key__f {
  color: var(--gold-light);
  white-space: nowrap; overflow: visible;
  display: grid; place-items: end center;
}
.key__cap {
  flex: 1;
  display: flex; flex-direction: column;
  border-radius: 0.8cqw;
  background: linear-gradient(180deg, #48423c 0%, #35302b 62%, #1d1916 62%, #191512 100%);
  box-shadow: 0 0.42cqw 0 #0f0c0a, inset 0 0.18cqw 0 rgba(255,255,255,0.14);
  transition: transform 60ms ease-out, box-shadow 60ms ease-out;
}
.key__main {
  flex: 0 0 62%;
  display: grid; place-items: center;
  color: var(--cap-text);
  font-weight: 500;
  white-space: nowrap;
}
.key__g {
  flex: 1;
  display: grid; place-items: center;
  color: var(--blue-light);
  white-space: nowrap;
}
.key--f .key__cap { background: linear-gradient(180deg, #e5c46f, #c79c3e 62%, #a77f2c 62%, #9b7426); }
.key--f .key__main { color: #2a2118; font-weight: 600; }
.key--g .key__cap { background: linear-gradient(180deg, #6e9fd6, #3f74b5 62%, #2e5d96 62%, #2a5689); }
.key--g .key__main { color: #0f1a29; font-weight: 600; }
.key--enter .key__cap { overflow: hidden; }
.key--enter .key__main { flex-basis: 82%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.02; }
.key.is-down .key__cap, button.key:active .key__cap {
  transform: translateY(0.3cqw);
  box-shadow: 0 0.12cqw 0 #0f0c0a, inset 0 0.18cqw 0 rgba(255,255,255,0.06);
}
@media (prefers-reduced-motion: reduce) { .key__cap { transition: none; } }

.bracket {
  position: relative;
  align-self: start;
  z-index: 1;
  pointer-events: none;
  border: solid var(--gold-light);
  border-width: 0.18cqw 0.18cqw 0 0.18cqw;
  display: grid; place-items: center;
}
.bracket span {
  background: var(--body);
  color: var(--gold-light);
  letter-spacing: 0.08em;
  line-height: 1;
}

/* Landscape face: proportions of the real calculator (128 x 79 mm) */
.face--landscape {
  aspect-ratio: 128 / 79;
  min-height: 0;
  grid-template-rows: 26% minmax(0, 1fr);
  gap: 2.6cqw;
  padding: 2.8cqw 3.2cqw 3.6cqw;
}
.face--landscape .face__band { padding: 1.5cqw 3cqw; }
.face--landscape .lcd { width: 60%; padding: 0.9cqw 1.4cqw 0.5cqw; }
.face--landscape .face__logo { font-size: 3.1cqw; }
.face--landscape .face__badge { font-size: 1.9cqw; margin-top: 0.6cqw; }
.face--landscape .face__keys {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  column-gap: 2.1cqw; row-gap: 0.5cqw;
}
.face--landscape .key__f { height: 2.6cqw; font-size: 1.62cqw; }
.face--landscape .key__main { font-size: 2.6cqw; }
.face--landscape .key--enter .key__main { font-size: 2.2cqw; }
.face--landscape .key__g { font-size: 1.55cqw; }
.face--landscape .bracket { height: 0.9cqw; margin-top: -0.2cqw; }
.face--landscape .bracket span { font-size: 1.25cqw; padding: 0 0.8cqw; transform: translateY(-0.1cqw); }

/* Portrait re-flow: the same keys in two 4 x 5 blocks */
.face--portrait {
  grid-template-rows: auto auto;
  gap: 4cqw;
  padding: 5cqw 5cqw 6.5cqw;
  border-radius: 5cqw;
}
.face--portrait .face__band { flex-direction: column; align-items: stretch; padding: 3.4cqw 4cqw 2.6cqw; gap: 2.4cqw; }
.face--portrait .lcd { width: 100%; padding: 1.8cqw 2.4cqw 1cqw; border-radius: 1.6cqw; }
.face--portrait .face__brand { display: flex; align-items: baseline; justify-content: space-between; margin-left: 0; width: 100%; }
.face--portrait .face__logo { font-size: 5cqw; }
.face--portrait .face__badge { font-size: 3.4cqw; }
.face--portrait .face__keys {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(4, 15.5cqw) 3cqw repeat(4, 15.5cqw);
  column-gap: 4cqw; row-gap: 1.2cqw;
}
.face--portrait .key__f { height: 4.8cqw; font-size: 3cqw; }
.face--portrait .key__cap { border-radius: 1.5cqw; box-shadow: 0 0.8cqw 0 #0f0c0a, inset 0 0.3cqw 0 rgba(255,255,255,0.14); }
.face--portrait .key__main { font-size: 4.7cqw; }
.face--portrait .key--enter .key__main { font-size: 4.2cqw; }
.face--portrait .key__g { font-size: 2.9cqw; }
.face--portrait .key.is-down .key__cap, .face--portrait button.key:active .key__cap { transform: translateY(0.6cqw); }
.face--portrait .bracket { height: 1.6cqw; margin-top: -0.4cqw; border-width: 0.3cqw 0.3cqw 0 0.3cqw; }
.face--portrait .bracket span { font-size: 2.3cqw; padding: 0 1.4cqw; transform: translateY(-0.2cqw); }
