/* ==========================================================================
   Korpalis design system
   Palette: Warm Plum #7B3070 · Soft Orange #FFAD60 · deep plum-black base
   Font: DM Sans (served via Bunny Fonts, EU-hosted, GDPR friendly)
   Voice: clean, calm, premium. No pulsing animations.
   ========================================================================== */

/* Tokens live in their own file so the portal app can share them.
   Editing a colour there changes both the site and the portal. */
@import "tokens.css";

* { box-sizing: border-box; }

/* The browser default for [hidden] is display:none, but any component rule
   that sets its own display (.btn is inline-block) outranks it and the
   element stays on screen. Restore the intent for every element. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}

.section-intro {
  max-width: 640px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.muted { color: var(--text-muted); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(14, 10, 17, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; background: rgba(242, 237, 243, 0.05); }
.nav-links a.is-current { color: var(--text); }

.nav-links a.nav-cta {
  color: var(--bg);
  background: var(--orange);
  font-weight: 600;
  margin-left: 8px;
}
.nav-links a.nav-cta:hover { background: #ffbd7f; color: var(--bg); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

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

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--orange); color: var(--bg); }
.btn-primary:hover { background: #ffbd7f; color: var(--bg); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 90px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 78% 30%, rgba(123, 48, 112, 0.32), transparent 70%),
    radial-gradient(ellipse 45% 40% at 15% 85%, rgba(255, 173, 96, 0.07), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero h1 .accent {
  background: linear-gradient(100deg, var(--plum-bright), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.16rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 42px; }

.hero-proof {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.hero-proof strong {
  display: block;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-visual { position: relative; }
.hero-visual svg { display: block; width: 100%; }

/* ---------- Trust bar ---------- */

.trustbar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 26px 0;
}
.trustbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px 42px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.trustbar-inner span { white-space: nowrap; }
.trustbar-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

/* ---------- Cards / offerings ---------- */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.card-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-muted); font-size: 0.98rem; }
.card ul {
  margin: 0 0 22px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card ul li { margin-bottom: 7px; }
.card .card-link { margin-top: auto; font-weight: 600; }

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

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.principle {
  border-left: 2px solid var(--plum-bright);
  padding: 6px 0 6px 24px;
}
.principle h3 { font-size: 1.08rem; margin-bottom: 8px; }
.principle p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* ---------- Topic grid (research) ---------- */

.coverage-group-label {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.coverage-group-label:not(:first-of-type) { margin-top: 26px; }

.sourcing-note {
  color: var(--text-faint);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 30px 0 0;
  max-width: 60ch;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.topic-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.topic-tile span {
  display: block;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-weight: 400;
  margin-top: 4px;
}

/* ---------- Goal picker ---------- */

.goal-label {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.goal-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
}
.goal-tile strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.goal-tile span {
  display: block;
  color: var(--text-faint);
  font-size: 0.83rem;
  line-height: 1.4;
}
.goal-tile:hover { border-color: var(--border-strong); }
.goal-tile.is-active {
  background: var(--orange-soft);
  border-color: var(--orange);
}
.goal-tile.is-active strong { color: var(--orange); }

.filter-divider {
  display: block;
  margin: 4px 0 10px;
}

.filter-group-label {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 2px 0 8px;
}

/* ---------- Filters and research cards ---------- */

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.is-active {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}

#research-count { color: var(--text-faint); font-size: 0.88rem; margin: 4px 0 26px; }

.topic-hint {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin: 0 0 14px;
  min-height: 1.3em;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
}
.research-card h3 { font-size: 1.06rem; margin: 0 0 10px; }
.research-card > p { color: var(--text-muted); font-size: 0.94rem; flex-grow: 1; }

.research-card-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--plum-soft);
  color: #d9a8d0;
}
.tag-beginner { background: rgba(127, 216, 164, 0.14); color: var(--ok); }
.tag-intermediate { background: var(--orange-soft); color: var(--orange); }
.tag-advanced { background: rgba(255, 143, 143, 0.13); color: var(--error); }

.research-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 16px;
  font-size: 0.85rem;
}
.research-source { color: var(--text-faint); }

.research-empty {
  grid-column: 1 / -1;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

/* ---------- Locked / waitlist panel ---------- */

.locked-panel {
  background: linear-gradient(140deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 660px;
  margin: 56px auto 0;
}
.locked-panel h2 { margin-bottom: 12px; }
.locked-panel p { color: var(--text-muted); max-width: 460px; margin: 0 auto 26px; }

/* ---------- Forms ---------- */

.form-inline {
  display: flex;
  gap: 10px;
  max-width: 480px;
  flex-wrap: wrap;
}
.form-inline input[type="email"] { flex: 1 1 240px; }

.form-stack { display: grid; gap: 16px; max-width: 560px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 13px 16px;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--orange);
}
textarea { min-height: 140px; resize: vertical; }

label { font-size: 0.9rem; color: var(--text-muted); }
label.field-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.consent-row input { margin-top: 4px; }

.form-status { min-height: 1.4em; font-size: 0.92rem; margin: 6px 0 0; }
.form-status[data-kind="ok"] { color: var(--ok); }
.form-status[data-kind="error"] { color: var(--error); }
.form-status[data-kind="busy"] { color: var(--text-muted); }

/* Honeypot: visually removed, still in the DOM for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.cta-band {
  background:
    radial-gradient(ellipse 70% 120% at 50% 130%, rgba(123, 48, 112, 0.45), transparent 70%),
    var(--bg-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 88px 0;
}
.cta-band h2 { max-width: 620px; margin: 0 auto 14px; }
.cta-band p { color: var(--text-muted); max-width: 520px; margin: 0 auto 30px; }
.cta-band form { margin: 0 auto; justify-content: center; }

/* ---------- Consulting page ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.check-list { list-style: none; margin: 0 0 28px; padding: 0; }
.check-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 13px;
  color: var(--text-muted);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--plum);
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 40% 70%);
}

.booking-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.booking-invite {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px;
  color: var(--text-faint);
}

/* ---------- Legal pages ---------- */

.legal {
  max-width: 760px;
  margin: 0 auto;
}
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 8px; }
.legal .legal-updated { color: var(--text-faint); font-size: 0.9rem; margin-bottom: 42px; }
.legal h2 { font-size: 1.35rem; margin-top: 44px; }
.legal h3 { font-size: 1.05rem; margin-top: 28px; }
.legal p, .legal li { color: var(--text-muted); font-size: 0.97rem; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 18px 0;
}
.legal th, .legal td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.legal th { color: var(--text); background: var(--surface); }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 64px 0 36px;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p { color: var(--text-faint); max-width: 280px; font-size: 0.9rem; }

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--text); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 18px;
  transform: translateY(110%);
  transition: transform 0.3s ease;
  pointer-events: none;
}
.cookie-banner.is-visible { transform: translateY(0); pointer-events: auto; }

.cookie-banner-inner {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner-text { flex: 1 1 340px; }
.cookie-banner-text h2 { font-size: 1.05rem; margin-bottom: 6px; }
.cookie-banner-text p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
.cookie-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}
.cookie-banner-actions .btn { padding: 11px 18px; font-size: 0.92rem; }

/* ---------- Reveal animation (single fade, no pulsing) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* ---------- Reading progress (long-form documents) ---------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  /* Above the sticky header (z-index 60) so it reads as a page-level bar. */
  z-index: 70;
  background: transparent;
  pointer-events: none;
}

.reading-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--plum-bright), var(--orange));
  transition: width 0.12s linear;
}

.reading-progress.is-complete .reading-progress-fill {
  background: var(--ok);
}

.reading-progress-readout {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
}

.reading-progress-readout.is-complete {
  color: var(--ok);
}

/* Checkmark on completion: the state change must not be colour alone. */
.reading-progress-readout.is-complete::before {
  content: "✓";
  margin-right: 5px;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  /* Keep the state change, drop the animation. */
  .reading-progress-fill { transition: none; }
}

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

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 480px; margin: 0 auto; }
  .cards-3, .principles { grid-template-columns: 1fr; }
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .research-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 68px 0; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 12px 18px 20px;
    gap: 2px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.nav-cta { margin: 10px 0 0; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
