/* halytin.fi
   Tokens: cool Nordic daylight around one dark alarm keypad.
   The keypad (calculator) is the only loud element on the site. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DSEG7";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/DSEG7Classic-Bold.woff2") format("woff2");
}

:root {
  /* Base palette */
  --lumi: #f2f5f7;        /* page background, cool snow */
  --paperi: #ffffff;      /* raised surfaces */
  --graniitti: #1d242b;   /* text */
  --harmaa: #56626d;      /* secondary text */
  --kuura: #cbd4db;       /* lines */
  --yo: #1b2530;          /* keypad body */
  --yo-2: #26323e;
  --lcd: #c4d2ad;         /* backlit LCD */
  --lcd-ink: #1c2a1a;
  --led: #2f9a62;         /* status LED, "best fit" */
  --led-glow: #4fd28f;
  --amber: #b06d12;       /* lock-in / caution */
  --fokus: #2f6fde;

  --wrap: 72rem;
  --measure: 38rem;
  --radius-key: 10px;
  --radius-device: 22px;

  /* Type scale (1.25) */
  --fs-small: 0.8125rem;
  --fs-body: 1.0625rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.5rem, 2.6vw, 1.95rem);
  --fs-h1: clamp(2.1rem, 5.2vw, 3.35rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--lumi);
  color: var(--graniitti);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
}

img, svg { max-width: 100%; display: block; }

a { color: #1d4f9a; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--paperi); padding: 0.5rem 0.75rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3 {
  font-stretch: 78%;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-top: 0; }
h3 { font-size: var(--fs-h3); font-stretch: 85%; }

p { margin: 0 0 1em; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.lead { font-size: 1.1875rem; color: var(--harmaa); max-width: 34rem; }
.muted { color: var(--harmaa); }
.small { font-size: var(--fs-small); }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.site-header { border-bottom: 1px solid var(--kuura); background: var(--lumi); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-stretch: 80%; font-size: 1.25rem;
  color: var(--graniitti); text-decoration: none;
}
.led {
  width: 0.62rem; height: 0.62rem; border-radius: 50%;
  background: var(--led); box-shadow: 0 0 0 3px rgba(47, 154, 98, 0.16);
}
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.site-header nav a { color: var(--graniitti); text-decoration: none; font-size: 0.9688rem; }
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] { font-weight: 600; }

/* Hero with keypad */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.hero-copy { padding-top: 0.5rem; }
.hero-copy .checked { margin-top: 1.5rem; }

.keypad {
  background: linear-gradient(180deg, var(--yo-2), var(--yo) 38%);
  color: #d5dde4;
  border-radius: var(--radius-device);
  padding: 1.1rem 1.1rem 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 44px -22px rgba(17, 25, 33, 0.6);
}
.keypad-status { display: flex; align-items: center; gap: 1.1rem; font-size: var(--fs-small); color: #a4b3c0; margin-bottom: 0.8rem; }
.keypad-status span { display: inline-flex; align-items: center; gap: 0.4rem; }
.status-led { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3a4653; }
.status-led.on { background: var(--led-glow); box-shadow: 0 0 8px var(--led-glow); }

.lcd {
  background: var(--lcd);
  color: var(--lcd-ink);
  border-radius: 8px;
  padding: 0.75rem 0.9rem 0.8rem;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.38);
  margin-bottom: 1rem;
  min-height: 7.4rem;
}
.lcd-label { font-size: var(--fs-small); font-weight: 600; margin: 0; }
.lcd-row { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.digits { position: relative; font-family: "DSEG7", ui-monospace, monospace; font-weight: 700; font-size: clamp(2.3rem, 9vw, 3.1rem); line-height: 1.15; letter-spacing: 0.02em; }
.digits .ghost { position: absolute; inset: 0; color: rgba(28, 42, 26, 0.09); pointer-events: none; }
.digits .value { position: relative; }
.lcd-unit { font-weight: 700; font-size: 1.35rem; }
.lcd-sub { margin: 0.1rem 0 0; font-size: 0.9375rem; font-weight: 600; min-height: 1.5em; }
.lcd-note { margin: 0; font-size: var(--fs-small); }
.lcd.refresh { animation: lcd-refresh 260ms steps(2, end); }
@keyframes lcd-refresh { 0% { opacity: 0.55; } 100% { opacity: 1; } }

.keygroup { border: 0; padding: 0; margin: 0 0 0.85rem; min-width: 0; }
.keygroup legend { font-size: var(--fs-small); color: #a4b3c0; padding: 0; margin-bottom: 0.4rem; }
.keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; }
.keys.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.key {
  appearance: none; border: 0; cursor: pointer;
  background: #e6ecf0; color: var(--graniitti);
  border-radius: var(--radius-key);
  padding: 0.62rem 0.5rem;
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
  box-shadow: 0 3px 0 #8d9aa6;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem; text-align: center;
  min-height: 2.75rem;
}
.key:hover { background: #f1f5f8; }
.key[aria-pressed="true"] { background: #ffffff; transform: translateY(2px); box-shadow: 0 1px 0 #8d9aa6; }
.key .kled { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #b7c2cb; flex: none; }
.key[aria-pressed="true"] .kled { background: var(--led); box-shadow: 0 0 6px var(--led-glow); }
.keypad .fine { font-size: var(--fs-small); color: #a4b3c0; margin: 0.3rem 0 0; }
.keypad .fine a { color: #cfe0f2; }

/* Comparison */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section + .section { border-top: 1px solid var(--kuura); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head p { margin: 0; max-width: 34rem; }

.compare { width: 100%; border-collapse: collapse; background: var(--paperi); border: 1px solid var(--kuura); border-radius: 12px; overflow: hidden; font-variant-numeric: tabular-nums; }
.compare caption { text-align: left; padding: 0 0 0.6rem; color: var(--harmaa); font-size: 0.9375rem; caption-side: top; }
.compare th, .compare td { padding: 0.85rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--kuura); }
.compare thead th { font-size: var(--fs-small); font-weight: 600; color: var(--harmaa); background: #f7f9fa; }
.compare tbody tr:last-child td, .compare tbody tr:last-child th { border-bottom: 0; }
.compare .total { font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
.compare .name { font-weight: 700; font-stretch: 85%; font-size: 1.0625rem; }
.compare .name a { color: inherit; }
.compare .type { display: block; font-weight: 400; font-stretch: 100%; font-size: var(--fs-small); color: var(--harmaa); }
.compare tr.best .name::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led-glow); margin-right: 0.45rem; vertical-align: 0.1em; }
.compare tr.nofit td, .compare tr.nofit th { color: var(--harmaa); }
.compare tr.nofit .total { font-weight: 400; }
.feat { list-style: none; margin: 0; padding: 0; font-size: 0.9063rem; }
.feat li { white-space: nowrap; }
.feat .no { color: var(--harmaa); text-decoration: line-through; text-decoration-thickness: 1px; }
.feat .unk { color: var(--harmaa); }
.lock { color: var(--amber); font-weight: 600; }
.compare .lock { display: block; font-size: var(--fs-small); }
.table-scroll { overflow-x: auto; }
.cta {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  background: var(--yo); color: #fff; padding: 0.55rem 0.8rem; border-radius: 8px; white-space: nowrap;
}
.cta:hover { background: #2c3a48; }
.cta.plain { background: transparent; color: #1d4f9a; padding-left: 0; text-decoration: underline; }
.adlabel { display: block; font-size: 0.75rem; color: var(--harmaa); margin-top: 0.3rem; }
.why { font-size: var(--fs-small); color: var(--amber); display: block; margin-top: 0.2rem; }

/* Two-column prose */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; }
.cols h3 { margin-top: 0; }

.checklist { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.checklist li { padding: 0.7rem 0 0.7rem 1.6rem; border-bottom: 1px solid var(--kuura); position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0.1rem; top: 1.15rem; width: 0.7rem; height: 0.7rem; border: 2px solid var(--graniitti); border-radius: 3px; }

/* Provider page */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0 0 1.5rem; max-width: var(--measure); }
.facts dt { color: var(--harmaa); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sources { font-size: 0.9375rem; color: var(--harmaa); }
.sources li { word-break: break-word; }
.breadcrumb { font-size: var(--fs-small); margin-bottom: 1rem; }
.breadcrumb a { color: var(--harmaa); }

.notice { background: var(--paperi); border-left: 3px solid var(--amber); padding: 0.8rem 1rem; max-width: var(--measure); margin: 0 0 1.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--kuura); padding: 2rem 0 2.5rem; font-size: 0.9375rem; color: var(--harmaa); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { color: var(--graniitti); }

/* Mobile */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .compare, .compare tbody, .compare tr, .compare td, .compare th { display: block; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare caption { display: block; padding: 0.7rem 0.9rem 0.2rem; }
  .compare tr { border-bottom: 1px solid var(--kuura); padding: 0.6rem 0; }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare td, .compare th { border-bottom: 0; padding: 0.25rem 0.9rem; }
  .compare td[data-label]::before { content: attr(data-label) ": "; color: var(--harmaa); font-size: var(--fs-small); }
  .compare td.ctacell::before, .compare td.featcell::before { content: none; }
  .feat { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .lcd.refresh { animation: none; }
  .key[aria-pressed="true"] { transform: none; }
}
