/* TT-koll landing — Apple-style scrollytelling with register.liot.se's
   typography and palette. */

@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/SpaceGrotesk.woff2') format('woff2-variations'),
       url('fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000000;
  --white: #ffffff;
  --off-white: #f5f5f5;
  --grey-100: #e8e8e8;
  --grey-200: #d0d0d0;
  --grey-400: #888888;
  --grey-600: #555555;
  --grey-800: #222222;
  --grey-900: #111111;
  --yellow: #f0c800;
  --yellow-soft: #fff7c2;
  --red: #cc2222;
  --red-soft: #ffd9d9;
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: ui-monospace, 'Space Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
:root {
  --bg: var(--off-white);
  --card: var(--white);
  --text: var(--black);
  --text-2: var(--grey-800);
  --subtext: var(--grey-600);
  --dim: var(--grey-600);
  --border: var(--grey-100);
  --border-strong: var(--grey-200);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
/* Noise — register.liot.se */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; opacity: 0.03;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}
::selection { background: var(--text); color: var(--bg); }
a { color: var(--text); }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--text);
  z-index: 9999;
  transition: width 0.05s linear;
}

/* ---------- Top nav ----------
   TT-koll wordmark on the left, install CTA on the right. Bottom border
   fades in once the user has scrolled past the hero. */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), padding 0.25s var(--ease);
}
.top-nav.is-scrolled {
  border-bottom-color: var(--border);
  padding-top: 12px;
  padding-bottom: 12px;
}
/* Wordmark always visible on the left of the nav. */
.top-wordmark {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.15s var(--ease);
}
.top-wordmark:hover { opacity: 0.72; }

.top-cta {
  font-family: var(--f-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.top-cta:hover { background: var(--text); color: var(--bg); }

@media (max-width: 720px) {
  .top-wordmark { font-size: 18px; }
  .top-cta { font-size: 10px; padding: 7px 10px; }
}

/* ---------- Reveal animation primitive ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-delay="3"] { transition-delay: 0.3s; }
[data-reveal][data-delay="4"] { transition-delay: 0.4s; }
[data-reveal][data-delay="5"] { transition-delay: 0.5s; }
[data-reveal][data-delay="6"] { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(80px, 14vh, 160px) 32px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.section-head {
  max-width: 720px;
  margin: 0 auto 48px;
}
.section .kicker {
  display: inline-block;
  padding: 4px 10px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.section .kicker-yellow {
  background: var(--yellow);
  color: var(--black);
}
.section h2 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin-bottom: 24px;
}
.section h2 em {
  font-style: italic;
  background: var(--yellow);
  padding: 0 8px;
  margin: 0 -4px;
}
.section-head p,
.section > p:not(.kicker) {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text-2);
  max-width: 620px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 80px;
}
.hero .kicker {
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(80px, 16vw, 220px);
  letter-spacing: 0.01em;
  line-height: 0.9;
  margin-bottom: 28px;
}
.hero-lede {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.45;
}
.hero-lede a {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
}
.hero-lede a:hover { color: var(--text); border-color: var(--text); }

.scroll-hint {
  margin-top: 64px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.scroll-hint .arrow {
  display: inline-block;
  animation: scrollHintBob 1.8s var(--ease-out) infinite;
}
@keyframes scrollHintBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- CTAs ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.cta-primary,
.cta-secondary {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.cta-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.cta-primary:hover { background: transparent; color: var(--text); transform: translateY(-1px); }
.cta-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  padding: 16px 22px;
}
.cta-secondary:hover { background: var(--text); color: var(--bg); transform: translateY(-1px); }

/* ---------- Quote section (Problem) ---------- */
.section-quote {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.section-quote .quote-pre,
.section-quote .quote-post,
.section-quote .quote-sub {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(28px, 5vw, 56px);
  color: var(--text-2);
  line-height: 1.1;
  margin: 12px 0;
}
.section-quote .quote-sub {
  color: var(--dim);
  font-size: clamp(20px, 3vw, 30px);
  margin-top: 32px;
}
.section-quote .quote-num {
  font-family: var(--f-serif);
  font-size: clamp(140px, 24vw, 360px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 16px 0;
}

/* ---------- Demo card ---------- */
.section-demo .demo-card {
  max-width: 720px;
  margin: 0 auto;
}
.demo-frame {
  position: relative;
  background: var(--card);
  border: 1px solid var(--text);
  padding: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  text-align: left;
}
.demo-textarea {
  position: relative;
  padding: 28px 32px 36px;
  min-height: 200px;
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.demo-textarea p { display: block; }
.demo-line { display: block; }
/* Highlights are drawn as a pseudo-underline that wipes in left→right
   when activated. The word itself stays visible the whole time. */
.demo-mark {
  position: relative;
  display: inline-block;
}
.demo-mark::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s var(--ease-out);
}
.demo-mark.demo-warning::after { background: var(--yellow); }
.demo-mark.is-on::after { transform: scaleX(1); }
.demo-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.demo-badge.is-pulsing {
  animation: demoPulse 0.6s var(--ease-out);
}
.demo-badge.is-active {
  background: var(--yellow);
  color: var(--black);
}
@keyframes demoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}
.demo-tooltip {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 320px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 14px 16px;
  font-family: var(--f-sans);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.demo-tooltip.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.demo-tip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.demo-tip-sev {
  padding: 3px 7px;
  background: var(--red);
  color: var(--white);
}
.demo-tip-meta {
  color: var(--grey-600);
}
.demo-tip-title {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 10px;
}
.demo-tip-swap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
}
.demo-tip-wrong { text-decoration: line-through; color: var(--red); }
.demo-tip-arrow { color: var(--grey-400); }
.demo-tip-right {
  background: var(--yellow);
  padding: 1px 6px;
  color: var(--black);
}
.demo-tip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--grey-100);
}
.demo-tip-apply {
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 500;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  padding: 7px 14px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.demo-tip-link {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--black);
  border-bottom: 1px solid var(--black);
  text-decoration: none;
  padding-bottom: 1px;
}
.demo-caption {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  margin-top: 16px;
}

/* ---------- Modes ---------- */
.modes-list {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}
.mode {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: baseline;
}
.mode:first-child { border-top: none; }
.mode-num span {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dim);
  font-weight: 700;
}
.mode h3 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.15;
}
.mode p {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 540px;
}
.inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--black);
  color: var(--white);
  font-family: var(--f-serif);
  font-size: 14px;
  vertical-align: -3px;
  margin: 0 2px;
}
@media (max-width: 720px) {
  .mode { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Privacy ---------- */
.section-privacy {
  background: var(--text);
  color: var(--bg);
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}
.section-privacy .privacy-mark { margin-bottom: 24px; }
.section-privacy .privacy-claim {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin-bottom: 24px;
}
.section-privacy .privacy-claim em {
  font-style: italic;
  background: var(--yellow);
  color: var(--black);
  padding: 0 12px;
}
.section-privacy p.privacy-sub {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  color: #e0e0e0 !important;
  max-width: 640px;
  margin: 0 auto 48px;
  line-height: 1.5;
}
.privacy-list {
  list-style: none;
  max-width: 540px;
  margin: 0 auto;
  text-align: left;
}
.privacy-list li {
  padding: 14px 0;
  border-top: 1px solid var(--grey-800);
  font-size: 16px;
  color: var(--grey-200);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.privacy-list li:first-child { border-top: none; }
.privacy-list .check {
  color: var(--yellow);
  font-size: 10px;
  line-height: 1;
}
.privacy-list code {
  font-family: var(--f-mono);
  font-size: 13px;
  background: var(--grey-800);
  color: var(--yellow);
  padding: 1px 5px;
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
}
.stat-cell {
  padding: 36px 16px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.stat-cell:last-child { border-right: none; }
.stat-cell .num {
  font-family: var(--f-serif);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 10px;
}
.stat-cell .label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { border-bottom: 1px solid var(--border); }
}

/* ---------- Open source ---------- */
.section-source .section-head { margin-bottom: 32px; }

/* ---------- Final CTA ---------- */
.section-cta {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.section-cta h2 {
  font-size: clamp(48px, 8vw, 96px);
}
.section-cta > p {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 28px);
  margin-bottom: 36px;
  color: var(--text-2);
}

/* ---------- Footer ---------- */
.page-footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.6;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.page-footer a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  text-decoration: none;
  padding-bottom: 1px;
}
.page-footer a:hover { border-color: var(--text); }
.page-footer .sep { color: var(--dim); margin: 0 8px; }

@media (max-width: 720px) {
  .top-nav { padding: 12px 18px; }
  .section { padding: 80px 18px; }
  .section-privacy { padding-left: 18px; padding-right: 18px; }
  .page-footer { padding: 22px 18px; }
}
