/* klk — marketing site.
   Tokens mirror constants/theme.ts in the app repo. The rule that holds the system
   together: color only ever means "which klk." Chrome is warm ink; a klk hue appears
   only where it identifies a klk. */

:root {
  --paper: #faf8f3;
  --surface: #f3efe7;
  --surface-sunken: #ebe6dc;
  --ink: #191612;
  --ink-muted: #7a7065;
  --rule: rgba(25, 22, 18, 0.11);
  --accent: #4f7d66;
  --accent-pressed: #3e6753;
  --on-accent: #faf8f3;

  --pine: #4f7d66;
  --clay: #b5654a;
  --indigo: #4c6fa5;
  --plum: #8a5a7d;
  --ochre: #a8813c;
  --teal: #3f7c86;

  --screen: 22px;
  --heading: 'Fira Sans', ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --surface: #1e1b17;
    --surface-sunken: #0d0b09;
    --ink: #efeae1;
    --ink-muted: #9c9287;
    --rule: rgba(239, 234, 225, 0.12);
    --accent: #6fa88c;
    --accent-pressed: #8abfa4;
    --on-accent: #14120f;

    --pine: #6fa88c;
    --clay: #d08a6b;
    --indigo: #7c9bd1;
    --plum: #b98bac;
    --ochre: #d0a85b;
    --teal: #6baab4;
  }
}

* {
  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: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  font-weight: 600;
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(25px, 3.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--screen);
}

.narrow {
  max-width: 680px;
}

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

.overline {
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Chrome ─────────────────────────────────────────────────────────── */

.site-head {
  padding: 26px 0;
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--heading);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark svg {
  display: block;
}

.site-head nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.site-head nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-head nav a:hover {
  color: var(--ink);
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  padding: 48px 0 32px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
}

.hero-copy {
  max-width: 30ch;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero .lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-muted);
  max-width: 34ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
}

.btn:hover {
  background: var(--accent-pressed);
}

.btn.outline {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}

.btn.outline:hover {
  background: var(--surface);
}

.cta-note {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ── Sections ───────────────────────────────────────────────────────── */

section {
  padding: 56px 0;
}

.rule-top {
  border-top: 1px solid var(--rule);
}

.section-head {
  max-width: 34ch;
  margin-bottom: 40px;
}

.section-head h2 {
  margin-bottom: 14px;
}

.section-head p {
  color: var(--ink-muted);
  margin: 0;
}

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

@media (max-width: 760px) {
  .cols {
    grid-template-columns: 1fr;
  }
}

.col h3 {
  margin-bottom: 8px;
}

.col p {
  color: var(--ink-muted);
  font-size: 16px;
  margin: 0;
}

.col .hue-bar {
  display: block;
  width: 3px;
  height: 34px;
  border-radius: 4px;
  margin-bottom: 16px;
  background: var(--rule);
}

/* Philosophy — the emotional close. Wider measure, larger type, no columns. */

.manifesto {
  padding: 72px 0;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.manifesto .wrap {
  max-width: 680px;
}

.manifesto h2 {
  margin-bottom: 24px;
}

.manifesto p {
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.65;
}

.manifesto p:last-child {
  margin-bottom: 0;
}

/* ── Phone mockups ──────────────────────────────────────────────────── */

.phones {
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.phone {
  width: 258px;
  flex: none;
  border-radius: 38px;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 9px;
  box-shadow: 0 8px 24px rgba(25, 22, 18, 0.14);
}

/* Both phones stay the same size — scaling one down read as an inconsistency rather than
   as depth. The pair is staggered vertically instead, which the flex-end alignment on the
   container turns into an offset without touching either frame's dimensions. */
.phone.behind {
  margin-bottom: 26px;
}

.screen {
  border-radius: 30px;
  overflow: hidden;
  background: var(--paper);
  /* Tall enough for the feed screen's full contents — moment bar, a whole post, and the
     tab bar — to sit inside the frame rather than overflowing past its bottom edge. */
  height: 580px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.4;
}

.screen .title {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  padding: 16px 14px 8px;
}

/* moment bar */

.moment-bar {
  display: flex;
  gap: 4px;
  padding: 10px 8px;
  border-bottom: 0.5px solid var(--rule);
}

.moment {
  width: 54px;
  text-align: center;
}

.moment .ring {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 999px;
  border: 2px solid var(--rule);
  padding: 3px;
}

.moment .disc {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-muted);
}

.moment .cap {
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* post */

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  flex: none;
}

.post-head .who {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}

.post-head .attr {
  text-align: right;
  line-height: 1.25;
}

.post-head .klk {
  font-size: 10px;
  font-weight: 600;
}

.post-head .when {
  font-size: 10px;
  color: var(--ink-muted);
}

/* The app posts at the photo's own ratio; the mockup pins it square so the whole post —
   icons, likes, caption — still fits inside the frame.

   The "photo" is a CSS-drawn scene rather than a real image: it keeps the repo
   dependency-free, it can't go stale against the app, and an illustrated lake sits
   honestly next to illustrated chrome where a stock photo would read as a real capture
   and make the rest look fake by comparison. Layers paint back to front — sky, sun,
   far ridge, near ridge, water, glare. */
.photo {
  aspect-ratio: 1 / 1;
  flex: none;
  position: relative;
  overflow: hidden;
  background: linear-gradient(#f6e2c8 0%, #f0cfae 42%, #e8bfa0 58%);
}

.photo::before {
  /* Sun, low and hazy. */
  content: '';
  position: absolute;
  top: 24%;
  left: 34%;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, #fff4dd 38%, rgba(255, 231, 194, 0) 72%);
}

.photo::after {
  /* Water — the bottom 42%, with the sun's glare smeared down it. */
  content: '';
  position: absolute;
  inset: 58% 0 0;
  background:
    radial-gradient(58% 88% at 44% 0%, rgba(255, 243, 219, 0.7), transparent 68%),
    linear-gradient(#c2a98d 0%, #8d8b7e 42%, #5d6963 100%);
}

/* Two ridges, and the far one is deliberately much paler — aerial perspective is the
   only thing separating them into distinct hills rather than one dark mass. */
.photo .ridge {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 42%;
  height: 26%;
  background: #b09a84;
  clip-path: polygon(0 100%, 0 46%, 17% 22%, 31% 44%, 46% 14%, 63% 42%, 78% 26%, 100% 52%, 100% 100%);
}

.photo .ridge.near {
  bottom: 42%;
  height: 17%;
  background: #5c4c40;
  clip-path: polygon(0 100%, 0 62%, 22% 30%, 38% 58%, 57% 26%, 74% 54%, 100% 34%, 100% 100%);
}

.post-body {
  padding: 8px 14px 14px;
}

.icons {
  display: flex;
  gap: 16px;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.icons svg {
  display: block;
}

.likes {
  font-size: 12px;
  font-weight: 600;
}

.caption-line {
  font-size: 12px;
  color: var(--ink);
  margin-top: 4px;
}

.caption-line b {
  font-family: var(--heading);
  font-weight: 600;
}

.comment-line {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* klks hub */

.hub-intro {
  padding: 4px 14px 14px;
  font-size: 12px;
  color: var(--ink-muted);
}

.klk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 14px;
  border-bottom: 0.5px solid var(--rule);
}

.klk-row .bar {
  width: 3px;
  height: 34px;
  border-radius: 4px;
  flex: none;
}

.klk-row .name {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 14px;
}

.klk-row .members {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.klk-row .state {
  margin-left: auto;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-transform: uppercase;
}

/* tab bar */

.tabbar {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 0 16px;
  border-top: 0.5px solid var(--rule);
  background: var(--surface);
  color: var(--ink-muted);
}

.tabbar .on {
  color: var(--accent);
}

/* ── Legal pages ────────────────────────────────────────────────────── */

.doc {
  padding: 24px 0 72px;
}

.doc h1 {
  font-size: clamp(29px, 5vw, 40px);
  margin-bottom: 8px;
}

.doc .updated {
  color: var(--ink-muted);
  font-size: 14px;
  margin-bottom: 40px;
}

.doc h2 {
  font-size: 23px;
  margin: 40px 0 12px;
}

.doc h3 {
  margin: 26px 0 8px;
}

.doc p,
.doc li {
  font-size: 16px;
  line-height: 1.6;
}

.doc ul {
  padding-left: 22px;
  margin: 0 0 1.1em;
}

.doc li {
  margin-bottom: 8px;
}

.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 11px 11px 0;
  padding: 18px 20px;
  margin: 0 0 1.4em;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ── Support FAQ ────────────────────────────────────────────────────── */

.faq {
  border-top: 1px solid var(--rule);
  margin-bottom: 1.4em;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 16px;
  padding: 16px 28px 16px 0;
  cursor: pointer;
  position: relative;
  list-style: none;
}

/* Safari still paints the default disclosure triangle without this. */
.faq summary::-webkit-details-marker {
  display: none;
}

/* The chevron is drawn from two borders on a rotated square, so it inherits
   currentColor and needs no SVG or icon font. */
.faq summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  top: 25px;
}

.faq .answer {
  padding: 0 0 16px;
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 32px 0 48px;
  font-size: 14px;
  color: var(--ink-muted);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
}

.site-foot a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--ink);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.site-foot .copyright {
  margin: 6px 0 0;
  font-size: 13px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-copy {
    max-width: none;
  }

  .phones {
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .phone.behind {
    display: none;
  }
}
