/* ===================================================================
   Knytr — knytr.app
   Tokens hämtade från docs/master (Knytr_masterdokument) och
   docs/design (Knytr_UI-analys_och_designplan), 14 juli 2026.
   =================================================================== */

:root {
  --bg: #FCFAF7;
  --surface: #FFFFFF;
  --text: #18231F;
  --muted: #66736D;
  --primary: #1F6F64;
  --primary-strong: #17554C;
  --primary-soft: #DDEFEA;
  --attention: #E6A23C;
  --danger: #B7443E;
  --info: #356E9E;

  --radius-card: 18px;
  --radius-control: 12px;
  --radius-sheet: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --max-width: 1180px;
  --motion-fast: 170ms;
  --motion-med: 220ms;
  --ease: cubic-bezier(.22,.61,.36,1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion-med: 0ms; }
}

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

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(24,35,31,0.16);
}
.btn-ghost:hover { border-color: var(--text); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-header { display: none; }
@media (min-width: 860px) { .btn-header { display: inline-flex; } }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(252,250,247,0.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(24,35,31,0.06);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.brand-mark { display: inline-flex; }
.brand-mark img { display: block; width: 30px; height: 30px; object-fit: contain; }
.brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-word.small { font-size: 16px; }
.site-nav {
  display: none;
  gap: 28px;
  font-size: 15px;
  color: var(--muted);
}
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--text); }
@media (min-width: 860px) { .site-nav { display: flex; } }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 24px 64px;
  text-align: center;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.12;
  margin-bottom: 20px;
}
@media (min-width: 640px) { .hero h1 { font-size: 56px; } }
.hero-lede {
  font-size: 19px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 18px;
}
.hero-micro {
  font-size: 14px;
  color: var(--muted);
}
.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 56px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  animation: bob 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Feature scroll (the core requested effect) ---------- */
.feature-scroll {
  position: relative;
  /* height is set inline via JS based on number of stops for precise control */
}
.feature-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.feature-sticky-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 900px) {
  .feature-sticky-inner {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.feature-text { order: 2; }
.feature-phone-wrap { order: 1; display: flex; justify-content: center; }
@media (min-width: 900px) {
  .feature-text { order: 1; }
  .feature-phone-wrap { order: 2; }
}

.feature-progress {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.dot {
  border: none;
  background: rgba(24,35,31,0.08);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion-med) var(--ease), color var(--motion-med) var(--ease);
}
.dot[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.feature-panels { position: relative; min-height: 130px; }
.feature-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--motion-med) var(--ease), transform var(--motion-med) var(--ease);
  pointer-events: none;
}
.feature-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}
.feature-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.feature-panel h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 14px;
}
.feature-copy {
  font-size: 17px;
  color: var(--muted);
  max-width: 440px;
}

/* ---------- Phone mockup ---------- */
.phone {
  position: relative;
  width: 272px;
  height: 556px;
  background: #14201C;
  border-radius: 44px;
  padding: 14px;
  box-shadow: 0 30px 60px -20px rgba(24,35,31,0.35), 0 2px 6px rgba(24,35,31,0.08);
}
.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #14201C;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  padding: 30px 16px 16px;
}
.screen {
  position: absolute;
  inset: 0;
  padding: 30px 16px 16px;
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition: opacity var(--motion-med) var(--ease), transform var(--motion-med) var(--ease);
  pointer-events: none;
}
.screen.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scr-topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.scr-greeting { font-size: 15px; font-weight: 700; }
.scr-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.scr-h1 { font-size: 19px; font-weight: 700; }
.scr-count { font-size: 12px; color: var(--muted); align-self: center; }

.avatar-row { display: flex; }
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c, var(--primary));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.avatar:first-child { margin-left: 0; }
.avatar-sm { width: 20px; height: 20px; font-size: 10px; margin-left: 0; }

.scr-card {
  background: var(--surface);
  border: 1px solid rgba(24,35,31,0.06);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 18px;
}
.scr-card-primary { background: var(--primary-soft); border-color: transparent; }
.scr-card-label { font-size: 11px; font-weight: 700; color: var(--primary-strong); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.scr-card-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.scr-card-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(24,35,31,0.08);
  border-radius: 999px;
  padding: 4px 9px;
}
.chip-info { color: var(--info); background: #EAF2F8; border-color: transparent; }

.scr-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 0 8px;
}
.scr-section-label:first-of-type { margin-top: 0; }

.scr-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FBF0DF;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #7A5416;
  margin-bottom: 4px;
}
.scr-banner-sm { font-size: 11.5px; margin-top: 12px; }
.scr-banner-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--attention); flex-shrink: 0; }

.scr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(24,35,31,0.05);
  font-size: 13.5px;
}
.scr-check {
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1.6px solid rgba(24,35,31,0.22);
  flex-shrink: 0;
}
.scr-check-on { background: var(--primary); border-color: var(--primary); }
.scr-row-title { flex: 1; font-weight: 600; }
.scr-row-done { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.scr-row-due { font-size: 11.5px; color: var(--muted); }
.scr-row-tag { font-size: 10.5px; color: var(--muted); background: rgba(24,35,31,0.05); padding: 3px 7px; border-radius: 999px; }

.scr-add {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.segmented {
  display: flex;
  background: rgba(24,35,31,0.06);
  border-radius: 999px;
  padding: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.segmented span { padding: 5px 10px; border-radius: 999px; }
.segmented .is-on { background: var(--surface); color: var(--text); }

.scr-event { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.scr-event-time { font-size: 12px; font-weight: 700; width: 34px; color: var(--muted); }
.scr-event-bar { width: 4px; height: 30px; border-radius: 3px; background: var(--c, var(--primary)); }
.scr-event-title { font-size: 13.5px; font-weight: 700; }
.scr-event-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.scr-knyt-card {
  background: var(--surface);
  border: 1px solid rgba(24,35,31,0.07);
  border-radius: 16px;
  padding: 16px;
}
.scr-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(24,35,31,0.08);
  margin: 12px 0 6px;
  overflow: hidden;
}
.scr-progress span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.scr-progress-label { font-size: 11px; color: var(--muted); }

/* ---------- Så fungerar det ---------- */
.how { padding: 96px 0; }
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .how-steps { grid-template-columns: repeat(3, 1fr); } }
.how-steps li { display: flex; gap: 16px; align-items: flex-start; }
.how-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.how-steps h3 { font-size: 17px; margin-bottom: 6px; }
.how-steps p { color: var(--muted); font-size: 15px; }

/* ---------- Trust ---------- */
.trust { padding: 64px 0 96px; }
.trust-inner h2 { font-size: 28px; margin-bottom: 32px; text-align: center; }
.trust-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .trust-grid { grid-template-columns: repeat(3, 1fr); } }
.trust-item {
  background: var(--surface);
  border: 1px solid rgba(24,35,31,0.06);
  border-radius: var(--radius-card);
  padding: 22px;
}
.trust-item h3 { font-size: 16px; margin-bottom: 8px; }
.trust-item p { color: var(--muted); font-size: 14.5px; }
.trust-note { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 28px; }

/* ---------- Waitlist ---------- */
.waitlist {
  background: var(--primary-soft);
  padding: 88px 0;
}
.waitlist-inner { max-width: 560px; text-align: center; }
.waitlist-inner h2 { font-size: 30px; margin-bottom: 12px; }
.waitlist-lede { color: var(--primary-strong); font-size: 16px; margin-bottom: 32px; }
.waitlist-form {
  display: flex;
  flex-direction: column;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
}
@media (min-width: 560px) {
  .waitlist-form { flex-direction: row; align-items: flex-start; }
}
.field { flex: 1; text-align: left; width: 100%; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary-strong);
}
.field input {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-control);
  border: 1.5px solid rgba(24,35,31,0.14);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}
.field input:focus { border-color: var(--primary); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
  min-height: 16px;
}
.waitlist-form .btn { width: 100%; }
@media (min-width: 560px) { .waitlist-form .btn { width: auto; } }
.waitlist-success {
  margin-top: 20px;
  font-weight: 600;
  color: var(--primary-strong);
  background: var(--surface);
  border-radius: var(--radius-control);
  padding: 14px 18px;
}
.waitlist-privacy {
  margin-top: 24px;
  font-size: 13px;
  color: var(--primary-strong);
  opacity: 0.85;
}
.waitlist-privacy a { text-decoration: underline; }

/* ---------- FAQ ---------- */
.faq { padding: 88px 0 110px; }
.faq-inner { max-width: 720px; }
.faq h2 { font-size: 28px; margin-bottom: 24px; }
.faq details {
  border-bottom: 1px solid rgba(24,35,31,0.08);
  padding: 16px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--primary);
  font-size: 20px;
  font-weight: 400;
  margin-left: 12px;
}
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin-top: 10px; font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgba(24,35,31,0.08); padding: 32px 0 48px; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner nav a { text-decoration: none; color: var(--muted); }
.footer-inner nav a:hover { color: var(--text); }
.footer-copy { width: 100%; margin-top: 4px; }

/* ---------- Legal / content pages ---------- */
.legal-hero { padding: 64px 24px 32px; }
.legal-hero .section-inner { max-width: 720px; }
.legal-hero h1 { font-size: 34px; line-height: 1.15; margin-bottom: 10px; }
@media (min-width: 640px) { .legal-hero h1 { font-size: 40px; } }
.legal-updated { color: var(--muted); font-size: 14px; }

.legal-content { padding: 0 0 96px; }
.legal-content .section-inner { max-width: 720px; }
.legal-content h2 { font-size: 21px; margin: 40px 0 12px; }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p { color: var(--muted); font-size: 16px; margin-bottom: 14px; line-height: 1.6; }
.legal-content ul { margin: 0 0 14px; padding-left: 20px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.legal-content li { margin-bottom: 6px; }
.legal-content strong { color: var(--text); }
.legal-content a { color: var(--primary); text-decoration: underline; }
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
}
.legal-back:hover { color: var(--text); }

.support-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin: 32px 0 8px; }
@media (min-width: 760px) { .support-grid { grid-template-columns: repeat(2, 1fr); } }
.support-card { background: var(--surface); border: 1px solid rgba(24,35,31,0.06); border-radius: var(--radius-card); padding: 22px; }
.support-card h3 { font-size: 16px; margin-bottom: 8px; }
.support-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }
.support-card a { color: var(--primary); font-weight: 600; text-decoration: none; }
.support-card a:hover { text-decoration: underline; }

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

/* ---------- Small-screen safety ---------- */
@media (max-width: 380px) {
  .phone { width: 240px; height: 490px; }
  .hero h1 { font-size: 34px; }
}
