/* Kelvin website. No frameworks; one small script copies the install
   command. Nested corners share a centre: an inner radius is always the outer
   radius minus the inset between them. */

/* The repository switch (data-source on <html>): only the current mode's
   elements show. */
html[data-source="closed"] [data-when="open"],
html[data-source="open"] [data-when="closed"] { display: none !important; }

:root {
  --bg: #fbfbfd;
  --bg-band: #f2f2f5;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --card: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-text: #ffffff;
  --green: #28a745;
  --orange: #e8790c;
  --blue: #0a7aff;
  --purple: #8a4fe8;
  --yellow: #c99700;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.18);
  --radius-card: 28px;
  --pad-card: 28px;
  --radius-shot-scene: 28px;
  --radius-terminal: 12px;
  --terminal-bg: #ffffff;
  --terminal-bar: linear-gradient(#f6f6f6, #ebebeb);
  --terminal-edge: rgba(0, 0, 0, 0.14);
  --terminal-text: #1d1d1f;
  --terminal-dim: #8e8e93;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-band: #0c0d10;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --card: #131417;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #2997ff;
    --green: #34c759;
    --orange: #ff9f0a;
    --blue: #409cff;
    --purple: #bf5af2;
    --yellow: #ffd60a;
    --shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --terminal-bg: #1e1e1e;
    --terminal-bar: linear-gradient(#3a3a3c, #2e2e30);
    --terminal-edge: rgba(255, 255, 255, 0.14);
    --terminal-text: #f5f5f7;
    --terminal-dim: #8e8e93;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--card);
  border-radius: 10px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 52px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.nav nav { display: flex; gap: 24px; margin-left: auto; }
.nav nav a { color: var(--text-2); font-size: 14px; }
.nav nav a:hover { color: var(--text); text-decoration: none; }

/* Buttons are pills. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.button:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
button.button { font-family: inherit; cursor: pointer; }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.button.compact { min-height: 30px; padding: 0 14px; font-size: 14px; }
.glyph { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 22px 40px;
  text-align: center;
}
.hero-icon {
  /* Drawn by macOS with its own margin and shadow, so a little larger. */
  width: 152px;
  height: 152px;
  margin: 0 auto 10px;
}
h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.lead {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.17;
  font-weight: 600;
  letter-spacing: 0.004em;
  color: var(--text);
}
.intro {
  max-width: 620px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.42;
  text-wrap: pretty;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}
.fine { margin: 14px 0 0; color: var(--text-2); font-size: 14px; }
.requirements { margin-top: 4px; }

/* The install command, in a Terminal window drawn like macOS's own. The whole
   window is the button. */
.terminal {
  display: block;
  width: min(560px, 100%);
  margin: 26px auto 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--terminal-text);
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-edge);
  border-radius: var(--radius-terminal);
  box-shadow: 0 22px 50px -24px rgba(0, 0, 0, 0.45), 0 2px 8px -4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  cursor: pointer;
  /* A button: clicking copies, it never selects the command. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.terminal:hover { transform: translateY(-1px); box-shadow: 0 26px 56px -24px rgba(0, 0, 0, 0.5), 0 2px 8px -4px rgba(0, 0, 0, 0.2); }
.terminal:active { transform: translateY(0); }
.terminal:focus-visible { outline-offset: 4px; border-radius: var(--radius-terminal); }
.terminal-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px 0 12px;
  background: var(--terminal-bar);
  border-bottom: 1px solid var(--terminal-edge);
}
.lights { display: flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--terminal-dim);
  font-size: 13px;
  font-weight: 600;
}
.terminal-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.terminal-copy svg { height: 13px; width: auto; fill: currentColor; flex: none; }
.terminal-copy .cue-done { display: none; height: 11px; }
.terminal:hover .terminal-copy { background: color-mix(in srgb, var(--accent) 17%, transparent); }
.terminal[data-state="copied"] .terminal-copy { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.terminal[data-state="copied"] .cue-copy { display: none; }
.terminal[data-state="copied"] .cue-done { display: block; }
.terminal-body {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 18px 18px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 15px;
  line-height: 1.4;
  /* One line, as in Terminal; on a narrow screen it scrolls sideways. */
  overflow-x: auto;
  scrollbar-width: none;
}
.prompt { color: var(--terminal-dim); flex: none; }
.terminal code { font: inherit; white-space: nowrap; }
.caret {
  flex: none;
  width: 8px;
  height: 17px;
  align-self: center;
  background: var(--terminal-text);
  opacity: 0.55;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }
/* Real captures: the window on a Mac desktop, so the image carries its own
   shadow and only needs rounding. */
.hero-shot {
  width: min(488px, 100%);
  margin: 56px auto 0;
}
.hero-shot img, .shot img {
  width: 100%;
  border-radius: var(--radius-shot-scene);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.45);
}

/* Sections */
section { padding: 96px 22px; }
.narrow { max-width: 700px; margin: 0 auto; text-align: center; }
h2 {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.003em;
  text-wrap: balance;
}
.narrow p { margin: 16px 0 0; color: var(--text-2); font-size: 19px; line-height: 1.42; text-wrap: pretty; }
h3 { margin: 14px 0 0; font-size: 19px; line-height: 1.26; font-weight: 600; }

/* Menu bar band */
.band { background: var(--bg-band); }
.notch {
  list-style: none;
  margin: 44px auto 0;
  padding: 18px 26px 16px;
  max-width: 760px;
  background: #000;
  border-radius: 999px;
  display: flex;
  justify-content: space-around;
  gap: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.notch li { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.notch img { height: 30px; width: auto; }
.notch span { color: #a1a1a6; font-size: 12px; white-space: nowrap; }

/* Features: six tiles, three of them showing the real thing. */
.bento {
  max-width: var(--max);
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}
.tile {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
}
.tile h3 { margin-top: 14px; }
.tile-text h3 { margin-top: 0; font-size: 24px; letter-spacing: -0.005em; }
.tile p { margin: 8px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.47; }
.tile-limit { grid-column: span 4; justify-content: space-between; gap: 34px; }
.tile-heat { gap: 22px; justify-content: space-between; }
.tile-flow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 36px;
}
.flow-shot img { width: 100%; }

/* A charge bar like the popover's: charged to 64% with the limit at 80%. */
.charge-bar {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
.charge-fill {
  position: absolute;
  inset: 0 36% 0 0;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 78%, #fff), var(--green));
}
.charge-limit {
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: calc(80% - 2px);
  width: 4px;
  border-radius: 2px;
  background: var(--text);
}
.charge-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.charge-label { margin-left: 52%; color: var(--text); font-weight: 600; }

.heat { display: flex; align-items: center; gap: 12px; }
.heat-flame { height: 46px; width: auto; flex: none; fill: var(--orange); }
.heat-value { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.heat-value small { font-size: 28px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.icon {
  /* SF Symbols, traced to paths. */
  height: 28px;
  width: auto;
  align-self: flex-start;
  fill: currentColor;
}
.green { color: var(--green); }
.orange { color: var(--orange); }
.blue { color: var(--blue); }
.purple { color: var(--purple); }
.yellow { color: var(--yellow); }

.showcase { background: var(--bg-band); }
.shot { max-width: var(--max); margin: 40px auto 0; }
.shot + .shot { margin-top: 28px; }

/* Lightweight */
.stats {
  max-width: 860px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  text-align: center;
}
.stats div {
  padding: 26px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.stats dt { color: var(--text-2); font-size: 14px; }
.stats dd {
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.footnote {
  max-width: 620px;
  margin: 22px auto 0;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

/* How it works */
.steps {
  list-style: none;
  counter-reset: step;
  max-width: var(--max);
  margin: 44px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.steps li {
  counter-increment: step;
  padding: var(--pad-card);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
}
.steps p { margin: 8px 0 0; color: var(--text-2); font-size: 16px; }

/* Privacy */
.privacy { padding-top: 24px; }
.privacy-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px var(--pad-card);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.privacy-card .icon { display: block; height: 44px; margin: 0 auto 14px; }
.privacy-card p { max-width: 560px; margin: 16px auto 0; color: var(--text-2); font-size: 18px; }

/* FAQ */
.faq-list { max-width: 760px; margin: 40px auto 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 36px 20px 0;
  position: relative;
  font-size: 19px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 24px;
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0 0 22px; color: var(--text-2); font-size: 17px; }
/* The list ends with its last answer: no rule or gap below it. */
.faq details:last-child { border-bottom: 0; }
.faq details:last-child p { margin-bottom: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 22px 40px; }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-2);
  font-size: 14px;
}
.footer p { margin: 0; }
.footer .brand { font-size: 15px; }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile, .tile-heat { grid-column: span 1; }
  .tile-limit, .tile-flow { grid-column: 1 / -1; }
  .tile-flow { grid-template-columns: 1fr; gap: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav nav { display: none; }
  .nav .button { margin-left: auto; }
  .hero { padding-top: 56px; }
  section { padding: 64px 18px; }
  .steps { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .tile, .tile-heat, .tile-limit, .tile-flow { grid-column: 1 / -1; }
  .terminal-body { font-size: 13px; padding: 14px 14px 16px; gap: 8px; }
  .terminal-title { display: none; }
  .notch { border-radius: 30px; flex-wrap: wrap; justify-content: center; row-gap: 16px; padding: 18px 16px; }
  .notch li { width: 40%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  :root { --radius-card: 24px; --pad-card: 22px; --radius-shot-scene: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .caret { animation: none; }
}
