/* ==========================================================================
   Konki — shared stylesheet
   --------------------------------------------------------------------------
   Every value below is lifted from the app, not invented for the web:

     Neutrals      Assets.xcassets — Background / Surface / Surface2 /
                   Accent / ButtonText, light and dark
     Eight tints   PanelTint.swift — fill and ink, light and dark
     Type scale    Metrics.swift — phone values at the low end of each
                   clamp(), iPad values at the high end
     Radii         cardCornerRadius 18/26, controlCornerRadius 14/18

   The point is that the site and the app can't drift. If a tint changes in
   PanelTint.swift, it changes here, and nowhere else.
   ========================================================================== */

:root {
  /* Neutrals — light */
  --bg:          #FAF7F2;
  --surface:     #FFFFFF;
  --surface-2:   #F0EBE2;
  --accent:      #6E3AC4;
  --button-text: #FFFFFF;

  --ink:         #1A1714;
  --ink-2:       #6B635A;
  --hairline:    rgba(26, 23, 20, 0.09);

  /* Eight tints — light. fill = the card wash, ink = the icon.
     They are deliberately different colours: the logo's hues are fully
     saturated, and twelve saturated cards would read as a toy. */
  --red-fill:     #FBE9E7;  --red-ink:     #C63A2E;
  --green-fill:   #E6F4EA;  --green-ink:   #2A7D45;
  --blue-fill:    #E6ECFC;  --blue-ink:    #2049BF;
  --yellow-fill:  #FDF0C9;  --yellow-ink:  #D4A50E;
  --purple-fill:  #EFE7FD;  --purple-ink:  #6626C7;
  --orange-fill:  #FDEDDF;  --orange-ink:  #C85C10;
  --sky-fill:     #DFF3F5;  --sky-ink:     #0E7C8C;
  --magenta-fill: #FCE7EF;  --magenta-ink: #C01358;

  /* Type — clamp() runs from the phone value to the iPad value */
  --t-hero:     clamp(2.5rem, 1.6rem + 4.4vw, 4.5rem);
  --t-screen:   clamp(2.125rem, 1.55rem + 2.8vw, 3.5rem);
  --t-section:  clamp(1.5rem, 1.2rem + 1.5vw, 2.125rem);
  --t-sheet:    clamp(1.375rem, 1.15rem + 1.1vw, 1.75rem);
  --t-body:     clamp(1.0625rem, 1.0rem + 0.3vw, 1.25rem);
  --t-second:   clamp(0.9375rem, 0.9rem + 0.25vw, 1.125rem);
  --t-caption:  clamp(0.8125rem, 0.79rem + 0.15vw, 0.9375rem);
  --t-kicker:   clamp(0.75rem, 0.73rem + 0.12vw, 0.875rem);

  /* Structure */
  --r-card:    18px;
  --r-control: 14px;
  --pad-screen: clamp(1.375rem, 0.9rem + 2vw, 3rem);
  --gap:        clamp(0.875rem, 0.7rem + 0.6vw, 1.25rem);
  --section-gap: clamp(4rem, 3rem + 5vw, 7.5rem);
  --measure:   68ch;
  --wide:      1180px;

  /* SF Rounded on Apple devices — the app uses design: .rounded for every
     display face. `ui-rounded` resolves to it natively; everything else
     falls back down the stack. No webfont, no external request. */
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #161412;
    --surface:     #211E1A;
    --surface-2:   #2B2721;
    --accent:      #9B72F0;
    --button-text: #FFFFFF;

    --ink:      #F5F1EA;
    --ink-2:    #A69C90;
    --hairline: rgba(245, 241, 234, 0.11);

    --red-fill:     #3A1F1C;  --red-ink:     #F07568;
    --green-fill:   #18321F;  --green-ink:   #62C782;
    --blue-fill:    #1A2340;  --blue-ink:    #6E8FEE;
    --yellow-fill:  #3A3016;  --yellow-ink:  #F5CE3A;
    --purple-fill:  #2A1C42;  --purple-ink:  #A57BF2;
    --orange-fill:  #3A2617;  --orange-ink:  #F0913F;
    --sky-fill:     #0F2E33;  --sky-ink:     #4FC3D4;
    --magenta-fill: #3A1729;  --magenta-ink: #EE5C93;
  }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.02em; }

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

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

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: var(--pad-screen); }
.narrow { max-width: 46rem; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--button-text);
  padding: 0.75rem 1.25rem; border-radius: var(--r-control); z-index: 200;
}
.skip:focus { left: 1rem; top: 1rem; }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: var(--wide); margin-inline: auto;
  padding: 0.75rem var(--pad-screen);
  display: flex; align-items: center; gap: 1.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.15rem; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--ink-2); text-decoration: none;
  font-size: var(--t-caption); font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }

@media (max-width: 44rem) {
  .nav-links li:not(.nav-keep) { display: none; }
  .nav-links { margin-left: auto; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--t-second);
  padding: 0.8rem 1.4rem;
  border-radius: var(--r-control);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.btn-primary { background: var(--accent); color: var(--button-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, black); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
.btn-secondary:hover { background: var(--surface-2); }
.btn svg { flex: none; }

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

.section { padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }

.eyebrow {
  font-size: var(--t-kicker); font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 0.75rem;
}

.section h2 { font-size: var(--t-screen); font-weight: 800; line-height: 1.08; }
.section h2 + .lede { margin-top: 1rem; }

.lede { font-size: var(--t-second); color: var(--ink-2); max-width: 42rem; }

.head { margin-bottom: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

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

.hero { padding-top: clamp(3.5rem, 2.5rem + 5vw, 6.5rem); padding-bottom: clamp(2.5rem, 2rem + 3vw, 4rem); }

.hero-kicker {
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  font-size: var(--t-kicker); font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 1.25rem;
}
.hero-kicker b {
  font-size: 1.15rem; letter-spacing: 0.06em;
  font-weight: 500; color: var(--accent); text-transform: none;
}

.hero h1 {
  font-size: var(--t-hero); font-weight: 800;
  line-height: 1.02; letter-spacing: -0.035em;
  max-width: 18ch;
}

.hero p {
  margin-top: 1.25rem;
  font-size: var(--t-body); color: var(--ink-2);
  max-width: 40rem;
}

.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-note { margin-top: 1rem; font-size: var(--t-caption); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Tile grid — the signature
   --------------------------------------------------------------------------
   This is the app's home screen, rebuilt in CSS. Same twelve surfaces, same
   tint order, same fill/ink split, same "icon, title, subtitle" structure.
   Showing the whole app at once is the argument: the scope is the point.
   -------------------------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--gap);
}

.tile {
  background: var(--tile-fill, var(--surface));
  border-radius: var(--r-card);
  padding: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem);
  min-height: clamp(8.25rem, 7rem + 4vw, 10rem);
  display: flex; flex-direction: column;
}

.tile svg {
  width: clamp(2rem, 1.7rem + 1.4vw, 2.75rem);
  height: clamp(2rem, 1.7rem + 1.4vw, 2.75rem);
  color: var(--tile-ink, var(--accent));
  margin-bottom: auto;
}

.tile h3 {
  font-size: var(--t-second); font-weight: 700;
  margin-top: 1.25rem; letter-spacing: -0.015em;
}

.tile p { font-size: var(--t-caption); color: var(--ink-2); margin-top: 0.15rem; }

/* ⚠️ Tint icons carry no meaning on their own — every tile prints its title
   directly beneath in full-contrast ink. That pairing is why the yellow ink
   is allowed to stay the logo's yellow rather than being dulled to clear 3:1.
   The same exemption does NOT extend to any mark whose length or position is
   the value; there aren't any on this site, and if one is added it needs the
   darker value. See the dataInk note in PanelTint.swift. */

.t-red     { --tile-fill: var(--red-fill);     --tile-ink: var(--red-ink); }
.t-green   { --tile-fill: var(--green-fill);   --tile-ink: var(--green-ink); }
.t-blue    { --tile-fill: var(--blue-fill);    --tile-ink: var(--blue-ink); }
.t-yellow  { --tile-fill: var(--yellow-fill);  --tile-ink: var(--yellow-ink); }
.t-purple  { --tile-fill: var(--purple-fill);  --tile-ink: var(--purple-ink); }
.t-orange  { --tile-fill: var(--orange-fill);  --tile-ink: var(--orange-ink); }
.t-sky     { --tile-fill: var(--sky-fill);     --tile-ink: var(--sky-ink); }
.t-magenta { --tile-fill: var(--magenta-fill); --tile-ink: var(--magenta-ink); }

/* --------------------------------------------------------------------------
   Modality cards
   -------------------------------------------------------------------------- */

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: var(--gap); }

.mode {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  border: 1px solid var(--hairline);
}
.mode .badge {
  display: inline-block;
  font-size: var(--t-kicker); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tile-ink); background: var(--tile-fill);
  padding: 0.3rem 0.7rem; border-radius: 100px;
  margin-bottom: 1rem;
}
.mode h3 { font-size: var(--t-sheet); font-weight: 700; }
.mode p { font-size: var(--t-caption); color: var(--ink-2); margin-top: 0.5rem; }
.mode ul { list-style: none; margin-top: 1rem; display: grid; gap: 0.45rem; }
.mode li { font-size: var(--t-caption); color: var(--ink-2); padding-left: 1.1rem; position: relative; }
.mode li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--tile-ink);
}

/* --------------------------------------------------------------------------
   Constraints — the "won't do" list
   -------------------------------------------------------------------------- */

.constraints { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0; }

.constraint { padding: clamp(1.4rem, 1.2rem + 0.8vw, 2rem) 0; border-top: 1px solid var(--hairline); }
.constraint:first-child { border-top: 0; }

@media (min-width: 48rem) {
  .constraints { column-gap: clamp(2rem, 1rem + 3vw, 4rem); }
  .constraint { border-top: 1px solid var(--hairline); }
  .constraint:first-child { border-top: 1px solid var(--hairline); }
}

.constraint h3 { font-size: var(--t-second); font-weight: 700; margin-bottom: 0.5rem; }
.constraint p { font-size: var(--t-caption); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Panel (generic surface block)
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: clamp(1.5rem, 1.2rem + 1.4vw, 2.5rem);
}
.panel h2 { font-size: var(--t-sheet); font-weight: 700; }
.panel p { font-size: var(--t-second); color: var(--ink-2); margin-top: 0.75rem; }
.panel .btn { margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   Prose — privacy, terms
   -------------------------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h1 { font-size: var(--t-screen); font-weight: 800; line-height: 1.1; }
.prose .updated { font-size: var(--t-caption); color: var(--ink-2); margin-top: 0.65rem; }
.prose > .intro { margin-top: 1.75rem; font-size: var(--t-body); }
.prose h2 {
  font-size: var(--t-sheet); font-weight: 700;
  margin-top: 2.75rem; margin-bottom: 0.85rem;
  padding-top: 1.75rem; border-top: 1px solid var(--hairline);
  line-height: 1.2;
}
.prose h3 { font-size: var(--t-second); font-weight: 700; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 1rem; color: var(--ink-2); font-size: var(--t-second); }
.prose > .intro, .prose p strong { color: var(--ink); }
.prose ul { list-style: none; margin-bottom: 1rem; display: grid; gap: 0.55rem; }
.prose li {
  color: var(--ink-2); font-size: var(--t-second);
  padding-left: 1.35rem; position: relative;
}
.prose li::before {
  content: ""; position: absolute; left: 0.25rem; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-control);
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
}
.callout p { margin: 0; color: var(--ink); font-size: var(--t-second); }
.callout p + p { margin-top: 0.65rem; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq { max-width: var(--measure); }
.faq details {
  border-top: 1px solid var(--hairline);
  padding: 1.15rem 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary {
  font-family: var(--font-display);
  font-size: var(--t-second); font-weight: 600;
  cursor: pointer; list-style: none;
  display: flex; align-items: flex-start; gap: 0.85rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; flex: none;
  font-weight: 500; color: var(--ink-2);
  font-size: 1.35em; line-height: 1; transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { margin-top: 0.85rem; color: var(--ink-2); font-size: var(--t-second); }
.faq details > p:last-child { margin-bottom: 0; }
.faq details > ul { margin-top: 0.85rem; }

.faq-group { margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.faq-group > h2 { font-size: var(--t-sheet); font-weight: 700; margin-bottom: 0.5rem; }

/* --------------------------------------------------------------------------
   Platform row
   -------------------------------------------------------------------------- */

.platforms { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.platform {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 100px; padding: 0.55rem 1.1rem;
  font-size: var(--t-caption); font-weight: 600;
}
.platform svg { width: 1.05rem; height: 1.05rem; color: var(--ink-2); }

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

.foot { border-top: 1px solid var(--hairline); margin-top: var(--section-gap); }
.foot-inner {
  max-width: var(--wide); margin-inline: auto;
  padding: 2.5rem var(--pad-screen);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
}
.foot p { font-size: var(--t-caption); color: var(--ink-2); }
.foot nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.foot nav a { font-size: var(--t-caption); color: var(--ink-2); text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 40rem) { .foot nav { margin-left: 0; } }