/* Kaitelek — shared styles
   Palette: professional pastels on a cool paper ground.
   Each pastel maps to a platform stage: apricot = licensed, sky = live,
   sage = adopted, lavender = improving. */

:root {
  color-scheme: light;
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #1E2B3A;
  --ink-muted: #4E5B6A;
  --line: #DDE2E8;

  --apricot: #F5D9C6;
  --sky: #CFDDF0;
  --sage: #CFE3D8;
  --lavender: #DDD6EE;

  --action: #29506B;
  --action-ink: #FFFFFF;
  --action-hover: #1F4058;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141B23;
    --surface: #1B242F;
    --ink: #E7ECF1;
    --ink-muted: #A8B4C1;
    --line: #2C3743;

    --apricot: #4A3529;
    --sky: #25384D;
    --sage: #26402F;
    --lavender: #352E48;

    --action: #A9C8E4;
    --action-ink: #14202C;
    --action-hover: #C3D9EC;
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #141B23;
    --surface: #1B242F;
    --ink: #E7ECF1;
    --ink-muted: #A8B4C1;
    --line: #2C3743;

    --apricot: #4A3529;
    --sky: #25384D;
    --sage: #26402F;
    --lavender: #352E48;

    --action: #A9C8E4;
    --action-ink: #14202C;
    --action-hover: #C3D9EC;
}

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

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

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

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

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

a { color: var(--action); text-underline-offset: 0.18em; }
a:hover { color: var(--action-hover); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 13ch;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 22ch;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

p { margin: 0; max-width: 62ch; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--action);
  color: var(--action-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: 16px; color: var(--action-ink); }

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

.site-header { border-bottom: 1px solid var(--line); }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 18px;
}

/* Wordmark: all caps with open tracking. The markup stays "Kaitelek"
   so screen readers say the name instead of spelling out K-A-I... */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 26px; height: 26px; flex: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
}

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

.btn-secondary { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-secondary:hover { background: var(--surface); color: var(--ink); }

.site-nav .btn { min-height: 44px; padding: 8px 18px; margin-left: 8px; }
.site-nav .btn-primary,
.site-nav .btn-primary:hover { color: var(--action-ink); text-decoration: none; }
.site-nav .btn-primary:hover { background: var(--action-hover); }
.label-short { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

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

main { display: block; }

.section { padding-block: clamp(64px, 9vw, 112px); }
.section + .section { border-top: 1px solid var(--line); }

.section-head { display: grid; gap: 16px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--ink-muted); }

.lede { font-size: 1.2rem; line-height: 1.55; color: var(--ink-muted); }

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

.hero { padding-block: clamp(56px, 8vw, 104px) clamp(64px, 9vw, 112px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
}

.hero-copy { display: grid; gap: 24px; }

/* The stage ramp: the one memorable element */

.ramp-figure { margin: 0; }

.ramp {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: clamp(260px, 32vw, 340px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.ramp li {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 12px 10px;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-sm);
  min-width: 0;
  animation: rise 700ms cubic-bezier(.2,.7,.2,1) both;
}

.ramp li:nth-child(1) { height: 36%; background: var(--apricot); animation-delay: 0ms; }
.ramp li:nth-child(2) { height: 56%; background: var(--sky); animation-delay: 140ms; }
.ramp li:nth-child(3) { height: 78%; background: var(--sage); animation-delay: 280ms; }
.ramp li:nth-child(4) { height: 100%; background: var(--lavender); animation-delay: 420ms; }

.ramp strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.82rem, 1.1vw, 1rem);
  line-height: 1.2;
}

.ramp span { font-size: 0.875rem; line-height: 1.35; color: var(--ink-muted); }

.ramp-figure figcaption {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--ink-muted);
  max-width: 46ch;
}

@keyframes rise {
  from { clip-path: inset(100% 0 0 0 round 12px); }
  to { clip-path: inset(0 0 0 0 round 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ramp li { animation: none; }
}

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
}

.principles > div { display: grid; gap: 10px; align-content: start; }
.principles p { color: var(--ink-muted); }

/* ---------- Service rows (home) ---------- */

.service-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.service-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px 40px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.service-rows .name { display: grid; gap: 10px; align-content: start; justify-items: start; }
.service-rows h3 a { color: var(--ink); text-decoration: none; }
.service-rows h3 a:hover { text-decoration: underline; }
.service-rows p { color: var(--ink-muted); }

/* Stage chip: color = the stage the service moves you to */

.stage {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.stage-licensed { background: var(--apricot); }
.stage-live { background: var(--sky); }
.stage-adopted { background: var(--sage); }
.stage-improving { background: var(--lavender); }

/* ---------- CTA band ---------- */

.cta-band {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: clamp(32px, 6vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--lavender);
}
.cta-band p { color: var(--ink); }

/* ---------- Services page ---------- */

.service-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 80px);
  padding-block: clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.service-detail .intro { display: grid; gap: 14px; align-content: start; justify-items: start; }
.service-detail .intro p { color: var(--ink-muted); }

.included { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.included li::marker { color: var(--ink-muted); }

/* ---------- Services page: self-check ---------- */

.self-check-section { border-top: 1px solid var(--line); scroll-margin-top: 24px; }

.check {
  display: grid;
  gap: clamp(24px, 4vw, 36px);
  padding: clamp(22px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.check[hidden],
.btn[hidden] { display: none; }

.check-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.check-progress li {
  counter-increment: step;
  padding-top: 10px;
  border-top: 4px solid var(--line);
  min-width: 0;
}
.check-progress li::before { content: counter(step) ". "; }
.check-progress li:nth-child(1).done,
.check-progress li:nth-child(1)[aria-current] { border-color: var(--apricot); }
.check-progress li:nth-child(2).done,
.check-progress li:nth-child(2)[aria-current] { border-color: var(--sky); }
.check-progress li:nth-child(3).done,
.check-progress li:nth-child(3)[aria-current] { border-color: var(--sage); }
.check-progress li:nth-child(4)[aria-current] { border-color: var(--lavender); }
.check-progress li[aria-current] { color: var(--ink); }

.check-fieldset { display: grid; gap: 16px; border: 0; margin: 0; padding: 0; min-width: 0; }
.check-fieldset > legend { padding: 0; margin-bottom: 16px; }
.check-step-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.2;
}
.check-step-title:focus { outline: none; }
.check-step-title:focus-visible { outline: 3px solid var(--action); }
.check-hint { color: var(--ink-muted); }
.check-error { color: var(--ink); font-weight: 600; }
.check-error:empty { display: none; }

.check-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.check-nav [data-next] { margin-left: auto; }

/* Shared look for every choice: a bordered row with a native control */
.chip,
.signal,
.stage-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  cursor: pointer;
  min-width: 0;
}
.chip input,
.signal input,
.stage-option input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--action);
}
.chip:hover,
.signal:hover,
.stage-option:hover { border-color: var(--ink-muted); }
.chip:has(input:checked),
.signal:has(input:checked) { border-color: var(--action); background: var(--surface); }
.chip:has(input:focus-visible),
.signal:has(input:focus-visible),
.stage-option:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 2px; }

.check-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.chip span { line-height: 1.4; }
.chip strong { font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; margin-right: 4px; }

.signal-list { display: grid; gap: 10px; }

.stage-set { border: 0; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.stage-set legend { padding: 0; margin-bottom: 12px; font-weight: 600; color: var(--ink-muted); }
.stage-set .abbr {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-right: 6px;
}

.stage-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.stage-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-content: start;
  border-top: 6px solid var(--tint, var(--line));
}
.stage-option input { grid-row: 1; }
.stage-option-name { font-weight: 600; grid-column: 2; }
.stage-option-text { grid-column: 1 / -1; font-size: 0.92rem; line-height: 1.45; color: var(--ink-muted); }
.stage-option-licensed { --tint: var(--apricot); }
.stage-option-live { --tint: var(--sky); }
.stage-option-adopted { --tint: var(--sage); }
.stage-option-improving { --tint: var(--lavender); }
.stage-option:has(input:checked) { background: var(--tint, var(--surface)); border-color: var(--ink); border-top-color: var(--tint, var(--ink)); }
.stage-option:has(input:checked) .stage-option-text { color: var(--ink); }
.stage-option-unsure:has(input:checked) { background: var(--surface); }

/* Read-out */
.readout-block { display: grid; gap: 12px; }
.readout-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rec {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--paper);
  min-width: 0;
}
.rec-lead { background: var(--lavender); border-color: transparent; }
.rec h4 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }
.rec-lead h4 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
.rec h4 a { color: var(--ink); }
.rec ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.rec-lead ul { color: var(--ink); }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.readout-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.readout-module {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-width: 0;
}
.readout-module-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.readout-module .abbr { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.02em; }
.readout-module p { color: var(--ink-muted); }
.readout-module .readout-sub { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.readout-aside { font-size: 0.92rem; font-style: italic; }
.readout-module ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.97rem; }

.readout-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.readout-notes li {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-left: 4px solid var(--sky);
  background: var(--paper);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.readout-notes p { color: var(--ink-muted); }

.readout-caveat { color: var(--ink-muted); font-size: 0.95rem; }
.check-status { color: var(--ink-muted); font-size: 0.95rem; }
.check-status:empty { display: none; }
.check-noscript { color: var(--ink-muted); }

@media (max-width: 960px) {
  .stage-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-option-unsure { grid-column: 1 / -1; }
  .rec-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .check-chips,
  .stage-options,
  .readout-modules { grid-template-columns: minmax(0, 1fr); }
  .check-progress { font-size: 0.8rem; }
}

/* ---------- About page ---------- */

.name-story {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.name-story > div {
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 10px;
  align-content: start;
}
.name-story > div:nth-child(1) { background: var(--apricot); }
.name-story > div:nth-child(2) { background: var(--lavender); }

.name-story dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.name-story dd { margin: 0; color: var(--ink); max-width: 40ch; }

.together { margin-top: 28px; font-size: 1.2rem; max-width: 48ch; }

.team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.team li { display: grid; gap: 6px; align-content: start; }
.team .role { color: var(--ink-muted); font-weight: 600; }
.team p:last-child { color: var(--ink-muted); }

/* ---------- Contact page ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.contact-grid .primary { display: grid; gap: 24px; justify-items: start; }

.email-line { font-size: 1.15rem; }

.prep {
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--sky);
  display: grid;
  gap: 14px;
}
.prep ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }

/* ---------- Modules page ---------- */

.module-group { padding-block: clamp(40px, 6vw, 64px); border-top: 1px solid var(--line); }
.module-group:first-child { border-top: 0; padding-top: 0; }
.module-group > .section-head { margin-bottom: 28px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.module {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  border-top: 6px solid var(--tint, var(--sky));
  min-width: 0;
}
.module-head { display: grid; gap: 2px; }
.module .abbr {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.module .full { color: var(--ink-muted); font-weight: 600; font-size: 0.95rem; }
.module p { color: var(--ink-muted); }
.module ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.97rem; }
.module ul li::marker { color: var(--ink-muted); }

.tint-sky { --tint: var(--sky); }
.tint-sage { --tint: var(--sage); }
.tint-apricot { --tint: var(--apricot); }
.tint-lavender { --tint: var(--lavender); }

@media (max-width: 760px) {
  .module-grid { grid-template-columns: minmax(0, 1fr); }
}

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

.site-footer { border-top: 1px solid var(--line); }

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 32px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.site-footer p { max-width: 70ch; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero-grid,
  .service-detail,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }

  .principles,
  .team { grid-template-columns: minmax(0, 1fr); }

  .service-rows li { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .name-story { grid-template-columns: minmax(0, 1fr); }
  .ramp { gap: 6px; }
  .ramp li { padding: 10px 8px; }
  .ramp strong { font-size: 0.95rem; }
  .ramp span { font-size: 0.8rem; }
  .site-nav .btn { margin-left: 0; }
  .label-long { display: none; }
  .label-short { display: inline; }
}

.prep h2 { font-size: 1.35rem; max-width: none; }

:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
.page[hidden] { display: none; }
