/* Kiri's website, in Honey (docs/DESIGN.md): warm paper, plum-brown ink, one
   amber accent, glass for chrome. Tokens are KiriKit Honey.swift's. */

@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url(fonts/Nunito-400.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url(fonts/Nunito-600.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(fonts/Nunito-700.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(fonts/Nunito-800.woff2) format("woff2"); }

:root {
  --canvas: #F5EEE1;
  --surface: #FFFCF6;
  --surface-2: #F2E8D6;
  --line: #E8DAC3;
  --fg: #3B2A2F;
  --fg-muted: #76615A;
  --accent: #E09A2D;
  --accent-fg: #2A1A08;
  --accent-ink: #995A05;
  --accent-soft: #FBE7C2;
  --focus: #B8700E;
  --glass: rgba(255, 252, 246, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --shadow: 91, 58, 26;
  --comb: rgba(224, 154, 45, 0.16);
  --syn-keyword: #9B2C6E;
  --syn-string: #4E7A1F;
  --syn-comment: #7C6A5F;
  --term: #251F18;
  --term-fg: #F6ECE0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #16120E;
    --surface: #251F18;
    --surface-2: #30281F;
    --line: #3A3027;
    --fg: #F6ECE0;
    --fg-muted: #B5A492;
    --accent: #F2A93B;
    --accent-ink: #F5B656;
    --accent-soft: #47331A;
    --focus: #F2A93B;
    --glass: rgba(48, 40, 31, 0.6);
    --glass-edge: rgba(255, 236, 210, 0.12);
    --shadow: 0, 0, 0;
    --comb: rgba(242, 169, 59, 0.09);
    --syn-keyword: #F08BC0;
    --syn-string: #A8D58A;
    --syn-comment: #A08E7E;
    --term: #0E0B08;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: Nunito, ui-rounded, -apple-system, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(80rem 50rem at 0% 0%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 60%),
    radial-gradient(60rem 40rem at 100% 30rem, color-mix(in srgb, var(--accent-soft) 60%, transparent), transparent 70%),
    var(--canvas);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }
img { max-width: 100%; height: auto; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0; }

/* Glass, as Kiri's chrome: frosted surface, bright top edge, warm shadow. */
.glass, .nav, .btn-glass, .card, .theme {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 1px 0 var(--glass-edge) inset, 0 8px 24px rgba(var(--shadow), 0.10);
}

/* Navigation */
.nav {
  position: sticky; top: 12px; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  width: min(1160px, calc(100% - 32px));
  margin: 12px auto 0; padding: 8px 8px 8px 14px;
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 800; font-size: 1.3rem; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--fg-muted); text-decoration: none; font-weight: 700; font-size: 0.98rem; }
.nav nav a:hover { color: var(--fg); }
@media (max-width: 720px) { .nav nav { display: none; } .nav .btn-small { margin-left: auto; } }

/* Buttons: the amber pill and the glass pill. */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font: 800 1.05rem/1 Nunito, system-ui, sans-serif;
  text-decoration: none; color: var(--accent-fg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white), var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent) 70%, black);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 12px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:active { transform: scale(0.96); }
.btn-glass { color: var(--fg); background: var(--glass); border-color: var(--glass-edge); box-shadow: 0 1px 0 var(--glass-edge) inset, 0 8px 24px rgba(var(--shadow), 0.10); }
.btn-glass:hover { box-shadow: 0 1px 0 var(--glass-edge) inset, 0 12px 26px rgba(var(--shadow), 0.14); }
.btn-small { padding: 10px 18px; font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover, .btn:active { transform: none; transition: none; } }

/* Honeycomb patches, faded at their edges. */
.comb {
  position: absolute; pointer-events: none; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38.1' height='66' viewBox='0 0 38.1 66'%3E%3Cpath d='M0-20 17.3-10V10L0 20-17.3 10V-10ZM38.1-20 55.4-10V10L38.1 20 20.8 10V-10ZM19.05 13 36.4 23V43L19.05 53 1.7 43V23ZM0 46 17.3 56V76L0 86-17.3 76V56ZM38.1 46 55.4 56V76L38.1 86 20.8 76V56Z' fill='none' stroke='%23E09A2D' stroke-opacity='.22' stroke-width='1.4'/%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(closest-side, #000 15%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 15%, transparent 100%);
}
@media (prefers-color-scheme: dark) { .comb { opacity: 0.5; } }

/* Hero */
.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 56px;
  width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 80px 0 72px;
}
.hero-bg { position: absolute; z-index: -1; top: -100px; bottom: 0; left: calc(50% - 50vw); width: 100vw; overflow: hidden; pointer-events: none; }
.hero-bg .comb { z-index: auto; }
.comb-a { left: -120px; top: -60px; width: 640px; height: 560px; }
.comb-b { right: -200px; bottom: -120px; width: 760px; height: 620px; }
.hero-icon { width: 112px; height: 112px; margin-left: -8px; filter: drop-shadow(0 10px 18px rgba(150, 90, 10, 0.28)); }
.hero h1 { margin-top: 20px; }
.lead { margin-top: 20px; font-size: 1.22rem; font-weight: 600; color: var(--fg-muted); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.cta.center { justify-content: center; }
.fine { margin-top: 14px; font-size: 0.92rem; font-weight: 600; color: var(--fg-muted); }
.hero-shot { margin: 0; }
.hero-shot img, .shot, .theme-shot img {
  display: block; width: 100%;
  filter: drop-shadow(0 2px 3px rgba(var(--shadow), 0.16)) drop-shadow(0 22px 40px rgba(var(--shadow), 0.2)) drop-shadow(0 50px 80px rgba(var(--shadow), 0.14));
}
.hero-shot img { transform: perspective(2000px) rotateY(-6deg) rotateX(2deg); transform-origin: left center; }
@media (prefers-reduced-motion: reduce) { .hero-shot img { transform: none; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 40px; text-align: center; }
  .hero-icon { margin: 0 auto; }
  .lead { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .hero-shot img { transform: none; }
}

/* Sections */
.section { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0; }
.section > h2, .section-lead { text-align: center; }
.section-lead { margin: 14px auto 0; max-width: 40rem; font-size: 1.15rem; font-weight: 600; color: var(--fg-muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 44px; }
.card { border-radius: 20px; padding: 24px; }
.card p { margin-top: 8px; color: var(--fg-muted); font-size: 1rem; font-weight: 600; line-height: 1.5; }
.glyph {
  width: 44px; height: 44px; border-radius: 14px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.glyph svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.row + .row { margin-top: 96px; }
.row.reverse .row-text { order: 2; }
.row-text p { margin-top: 16px; font-size: 1.1rem; font-weight: 600; color: var(--fg-muted); }
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; gap: 28px; }
  .row.reverse .row-text { order: 0; }
  .row + .row { margin-top: 64px; }
}

/* Themes */
.themes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.theme {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 14px 10px; border-radius: 20px; cursor: pointer;
  font: 700 0.95rem Nunito, system-ui, sans-serif; color: var(--fg);
  transition: transform 140ms ease-out, background-color 140ms ease-out;
}
.theme img { width: 64px; height: 64px; }
.theme:hover { transform: translateY(-2px); }
.theme[aria-checked="true"] { background: color-mix(in srgb, var(--accent-soft) 80%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
@media (prefers-reduced-motion: reduce) { .theme, .theme:hover { transform: none; transition: none; } }
.theme-blurb { text-align: center; margin-top: 18px; font-weight: 700; color: var(--fg-muted); min-height: 1.6em; }
.theme-shot { margin: 32px auto 0; max-width: 1000px; }
.theme-shot img { transition: opacity 240ms ease; }
.theme-shot img.fading { opacity: 0; }

/* Terminal */
.term {
  margin: 0; border-radius: 20px; padding: 18px 24px 24px;
  background: var(--term); color: var(--term-fg);
  font: 15px/1.75 ui-monospace, "SF Mono", Menlo, monospace;
  overflow-x: auto;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 22px 50px rgba(var(--shadow), 0.25);
}
.term code { background: none; padding: 0; font-size: inherit; }
.term .dots { display: flex; gap: 8px; margin-bottom: 14px; }
.term .dots i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.term .dots i:nth-child(2) { background: #FEBC2E; }
.term .dots i:nth-child(3) { background: #28C840; }
.term .c { color: #A08E7E; }
.term .p { color: #F2A93B; }

/* Get Kiri */
.get { text-align: center; padding-bottom: 96px; }
.get img { filter: drop-shadow(0 10px 18px rgba(150, 90, 10, 0.28)); }
.get h2 { margin-top: 16px; }
.get .cta { margin-top: 28px; }

.footer { text-align: center; padding: 32px 16px 48px; border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 0.95rem; font-weight: 600; }
.footer p + p { margin-top: 6px; }

/* Privacy: the section on the front page and privacy.html. */
.privacy { padding-top: 24px; }
.center-link { text-align: center; margin-top: 18px; font-weight: 800; }

.prose { width: min(780px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 88px; }
.prose h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.prose h2 { font-size: 1.6rem; margin-top: 52px; scroll-margin-top: 96px; }
.prose p, .prose ul, .prose table, .prose .term { margin-top: 14px; }
.prose p, .prose li, .prose td { font-weight: 600; }
.prose .lead { max-width: none; }
.prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--accent); }
.prose .term { font-size: 14px; line-height: 1.7; padding: 16px 20px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 32px; }
.summary .card { padding: 20px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 800; background: var(--surface-2); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { width: 40%; color: var(--fg); }
.prose td:last-child { color: var(--fg-muted); }
