/*
 * Knit Halo: components
 * Needs tokens.css first. Every class starts with "kh-" so it can sit next to any other CSS.
 */

/* Base */
.kh { margin: 0; background: var(--kh-fog); color: var(--kh-ink); font-family: var(--kh-sans); font-size: var(--kh-text-body); font-weight: 400; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
.kh *, .kh *::before, .kh *::after { box-sizing: border-box; }
:where(.kh) a { color: inherit; }
.kh-container { width: min(100% - var(--kh-gutter) * 2, var(--kh-container)); margin-inline: auto; }
.kh-narrow { width: min(100% - var(--kh-gutter) * 2, var(--kh-narrow)); margin-inline: auto; }
.kh-center { text-align: center; }
.kh-center .kh-lead { margin-inline: auto; }

/* Sections: fog by default, paper for a lifted band, ink for the one dark band */
.kh-section { padding-block: var(--kh-section); }
.kh-section--paper { background: var(--kh-paper); }
.kh-section--ink { background: var(--kh-ink); color: var(--kh-fog); }
.kh-section--ink .kh-lead, .kh-section--ink .kh-fade-word { color: var(--kh-stone); }
.kh-rule { height: 1px; margin: 0; border: 0; background: var(--kh-mist); }

/* Type: one grotesk, regular weight. The signature is the two-tone line */
.kh-hero-title, .kh-h2, .kh-h3 { margin: 0; font-weight: 400; color: inherit; }
.kh-hero-title { font-size: var(--kh-text-hero); letter-spacing: var(--kh-tracking-hero); line-height: 1; }
.kh-h2 { font-size: var(--kh-text-h2); letter-spacing: var(--kh-tracking-h2); line-height: 1.06; }
.kh-h3 { font-size: var(--kh-text-h3); letter-spacing: -.015em; line-height: 1.25; font-weight: 500; }
.kh-fade-word { color: var(--kh-stone); }
.kh-lead { max-width: 560px; margin: 22px 0 0; color: var(--kh-graphite); font-size: var(--kh-text-lead); line-height: 1.55; font-weight: 300; }
.kh-label { display: inline-block; color: var(--kh-graphite); font-size: var(--kh-text-label); font-weight: 500; letter-spacing: var(--kh-tracking-label); text-transform: uppercase; }
.kh-label--stone { color: var(--kh-stone); }
.kh-mono { font-family: var(--kh-mono); font-size: 12px; letter-spacing: .02em; }

/* Nav: logo left, tracked uppercase links centered, one quiet action right */
.kh-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding-block: 22px; }
.kh-nav__logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500; letter-spacing: -.02em; text-decoration: none; }
.kh-nav__links { display: flex; gap: 44px; }
.kh-nav__links a { color: var(--kh-graphite); font-size: var(--kh-text-label); font-weight: 500; letter-spacing: var(--kh-tracking-label); text-transform: uppercase; text-decoration: none; transition: color .3s var(--kh-ease); }
.kh-nav__links a:hover, .kh-nav__links a[aria-current] { color: var(--kh-ink); }
.kh-nav__end { justify-self: end; }
.kh-nav__end a { font-size: var(--kh-text-label); font-weight: 500; letter-spacing: var(--kh-tracking-label); text-transform: uppercase; text-decoration: none; }
.kh-mark { width: 22px; height: 14px; border: 1.5px solid currentColor; border-radius: 50%; }

/* Buttons: charcoal pills for the main action, quiet text pills for the rest */
.kh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 26px; border: 0; border-radius: var(--kh-radius-pill); font: 400 16px/1 var(--kh-sans); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .3s var(--kh-ease), color .3s var(--kh-ease); }
.kh-btn--primary { background: var(--kh-ink); color: var(--kh-paper); }
.kh-btn--primary:hover { background: var(--kh-knit-char); }
.kh-btn--soft { background: var(--kh-fog-2); color: var(--kh-ink); }
.kh-btn--soft:hover { background: var(--kh-mist); }
.kh-btn--light { background: var(--kh-paper); color: var(--kh-ink); }
.kh-btn--sm { padding: 10px 18px; font-size: 14px; }
.kh-btn--block { width: 100%; }
.kh-price-tag { display: inline-flex; align-items: center; gap: 18px; }
.kh-price-tag span { color: var(--kh-graphite); font-size: 15px; white-space: nowrap; }
.kh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }
.kh-center .kh-actions { justify-content: center; }

/* Pebble: the drawn product. A knit-ribbed oval with a glowing halo ring */
.kh-pebble { position: relative; overflow: hidden; width: var(--kh-pebble-w, 260px); aspect-ratio: 4 / 5; border-radius: 50% 50% 46% 46% / 54% 54% 46% 46%; background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .09) 0 2px, rgba(0, 0, 0, .05) 2px 4px),
    radial-gradient(120% 90% at 30% 22%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%),
    radial-gradient(100% 100% at 70% 90%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 60%),
    var(--kh-pebble-tone, var(--kh-knit-oat));
  box-shadow: var(--kh-shadow-object); }
.kh-pebble--slate { --kh-pebble-tone: var(--kh-knit-slate); }
.kh-pebble--oat { --kh-pebble-tone: var(--kh-knit-oat); }
.kh-pebble--char { --kh-pebble-tone: var(--kh-knit-char); }
.kh-pebble__halo { position: absolute; top: 18%; left: 50%; width: 54%; aspect-ratio: 5 / 6; transform: translateX(-50%); border: 3px solid var(--kh-halo); border-radius: 50%; box-shadow: 0 0 18px var(--kh-halo-glow), inset 0 0 14px var(--kh-halo-glow); animation: kh-breathe 5s var(--kh-ease) infinite alternate; }
.kh-pebble__seam { position: absolute; inset: 0 auto 0 62%; width: 1px; background: rgba(0, 0, 0, .1); }
@keyframes kh-breathe { from { opacity: .7; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kh-pebble__halo { animation: none; } }

/* Stage: objects on fog, dissolving into the page at the bottom */
.kh-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(12px, 3vw, 40px); overflow: hidden; padding-top: 24px; }
.kh-stage::after { content: ""; position: absolute; inset: 55% 0 0; background: var(--kh-fade); pointer-events: none; }

/* Cards: paper on fog, no borders, soft depth */
.kh-card { padding: 32px; border-radius: var(--kh-radius); background: var(--kh-paper); box-shadow: var(--kh-shadow); }
.kh-card p { margin: 10px 0 0; color: var(--kh-graphite); }
.kh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kh-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* Spec list: label left, mono value right, mist rules between */
.kh-specs { margin: 0; padding: 0; list-style: none; }
.kh-specs li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: var(--kh-border); }
.kh-specs li span:last-child { font-family: var(--kh-mono); font-size: 13px; color: var(--kh-graphite); text-align: right; }

/* Badge and live dot */
.kh-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--kh-radius-pill); background: var(--kh-fog-2); color: var(--kh-graphite); font-size: var(--kh-text-label); font-weight: 500; letter-spacing: var(--kh-tracking-label); text-transform: uppercase; white-space: nowrap; }
.kh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--kh-halo); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 0 8px var(--kh-halo-glow); }

/* Forms: fog-2 fields, no borders until focus */
.kh-field { display: grid; gap: 8px; margin-bottom: 18px; }
.kh-field label { color: var(--kh-graphite); font-size: var(--kh-text-label); font-weight: 500; letter-spacing: var(--kh-tracking-label); text-transform: uppercase; }
.kh-input, .kh-select { width: 100%; padding: 15px 18px; border: 1px solid transparent; border-radius: var(--kh-radius-sm); background: var(--kh-fog-2); color: var(--kh-ink); font: 400 16px var(--kh-sans); outline: none; transition: border-color .3s var(--kh-ease), background .3s var(--kh-ease); }
.kh-input::placeholder { color: var(--kh-stone); }
.kh-input:focus, .kh-select:focus { border-color: var(--kh-ink); background: var(--kh-paper); }
.kh-check { display: flex; gap: 12px; align-items: flex-start; color: var(--kh-graphite); font-size: var(--kh-text-small); }
.kh-check input { margin-top: 4px; accent-color: var(--kh-ink); }
.kh-swatches { display: flex; gap: 10px; }
.kh-swatch { width: 36px; height: 36px; border: 2px solid transparent; border-radius: 50%; background: var(--kh-pebble-tone); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); cursor: pointer; }
.kh-swatch[aria-pressed="true"] { border-color: var(--kh-ink); box-shadow: inset 0 0 0 3px var(--kh-paper); }

/* Pricing: paper plans, the featured one is ink */
.kh-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.kh-plan { display: flex; flex-direction: column; padding: 36px 32px; border-radius: var(--kh-radius); background: var(--kh-paper); box-shadow: var(--kh-shadow); }
.kh-plan--featured { background: var(--kh-ink); color: var(--kh-fog); }
.kh-plan--featured .kh-plan__note, .kh-plan--featured .kh-plan__list li { color: var(--kh-stone); border-color: rgba(255, 255, 255, .1); }
.kh-plan__price { margin: 28px 0 4px; font-size: 56px; font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.kh-plan__note { color: var(--kh-graphite); font-size: var(--kh-text-small); }
.kh-plan__list { flex: 1; margin: 28px 0 32px; padding: 0; list-style: none; }
.kh-plan__list li { padding: 12px 0; border-top: var(--kh-border); color: var(--kh-graphite); font-size: 15px; }

/* FAQ */
.kh-faq details { padding: 22px 0; border-bottom: var(--kh-border); }
.kh-faq summary { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; cursor: pointer; list-style: none; }
.kh-faq summary::after { content: "+"; color: var(--kh-stone); }
.kh-faq details[open] summary::after { content: "-"; }
.kh-faq p { margin: 12px 0 0; color: var(--kh-graphite); }

/* Article */
.kh-article { font-size: 18px; line-height: 1.75; }
.kh-article p { margin: 0 0 24px; color: var(--kh-graphite); }
.kh-article h2 { margin: 56px 0 18px; font-size: 30px; font-weight: 400; letter-spacing: -.025em; line-height: 1.15; color: var(--kh-ink); }
.kh-article blockquote { margin: 48px 0; padding: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 300; letter-spacing: -.025em; line-height: 1.25; color: var(--kh-ink); }
.kh-article blockquote span { color: var(--kh-stone); }
.kh-article figure { margin: 48px 0; }
.kh-article figcaption { margin-top: 14px; color: var(--kh-stone); font-size: var(--kh-text-small); }
.kh-byline { display: flex; align-items: center; gap: 14px; margin-top: 32px; color: var(--kh-graphite); font-size: var(--kh-text-small); }
.kh-avatar { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--kh-paper), var(--kh-knit-oat)); }

/* Footer */
.kh-footer { padding-block: 64px 40px; border-top: var(--kh-border); }
.kh-footer__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.kh-footer h4 { margin: 0 0 16px; }
.kh-footer ul { margin: 0; padding: 0; list-style: none; }
.kh-footer li { margin-bottom: 10px; }
.kh-footer li a { color: var(--kh-graphite); font-size: var(--kh-text-small); text-decoration: none; }
.kh-footer li a:hover { color: var(--kh-ink); }
.kh-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; color: var(--kh-stone); font-size: 13px; }

/* Phone */
@media (max-width: 860px) {
  :root { --kh-gutter: 20px; }
  .kh-nav { grid-template-columns: 1fr auto; }
  .kh-nav__links { display: none; }
  .kh-grid, .kh-grid--2, .kh-plans, .kh-footer__grid { grid-template-columns: 1fr; }
  .kh-card, .kh-plan { padding: 28px 24px; }
}

/* Rhythm: a label or badge sits 20px above the heading it introduces */
.kh-label + .kh-hero-title, .kh-label + .kh-h2, .kh-label + .kh-h3, .kh-badge + .kh-h3 { margin-top: 20px; }
