/* Kith design system: Swiss grid and type, iOS-native controls, Graphite density. Light only. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-wght.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f6f6f7;
  --bg-press: #ececef;
  --ink: #0b0d10;
  --ink-2: #5b616b;
  --ink-3: #8e949c;
  --line: #e6e7ea;
  --line-strong: #0b0d10;
  --brand: #002551;
  --brand-hover: #0a3368;
  --brand-ink: #ffffff;
  --brand-tint: #e9eef5;
  --signal: #ff4f1f;
  --ok: #1f9d63;
  --warn: #c98a16;
  --err: #d93a2b;

  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --fs-micro: 10.5px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-input: 16px;
  --fs-lg: 20px;
  --fs-xl: 28px;
  --fs-2xl: 40px;
  --fs-3xl: 56px;
  --track-display: -0.04em;
  --track-tight: -0.02em;
  --track-micro: 0.12em;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-pill: 999px;
  --row: 34px;
  --control: 44px;
  --hair: 1px solid var(--line);
  --rule: 1px solid var(--line-strong);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-pop: 0 10px 30px rgba(11, 13, 16, .14), 0 0 0 1px rgba(11, 13, 16, .06);
  --shadow-knob: 0 1px 2px rgba(11, 13, 16, .12), 0 0 0 .5px rgba(11, 13, 16, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-md)/1.45 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--brand-tint); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.nw, .num, a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }

/* Type */
.micro { font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--ink-2); margin: 0; text-decoration: none; }
.display { margin: 0; font-size: var(--fs-2xl); font-weight: 750; line-height: .95; letter-spacing: var(--track-display); }
.display.sm { font-size: var(--fs-xl); line-height: 1.05; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--control); padding: 0 var(--s4); border: var(--hair); border-radius: var(--r-md); background: var(--bg); font-size: var(--fs-md); font-weight: 550; text-decoration: none; cursor: pointer; transition: background .15s var(--ease), transform .1s var(--ease); -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:hover { background: var(--bg-subtle); }
.btn:active { transform: scale(.98); background: var(--bg-press); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 30px; padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-sm); gap: 6px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: var(--fs-sm); font-weight: 550; cursor: pointer; background: none; border: 0; padding: 0; }
.text-btn svg { width: 16px; height: 16px; }

/* Segmented control */
.segmented { display: flex; gap: 2px; padding: 3px; margin: 0; border: 0; background: var(--bg-subtle); border-radius: var(--r-md); min-width: 0; }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 7px 6px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s var(--ease), color .15s; }
.segmented input:checked + span { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-knob); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }

/* Grouped list rows: inputs without boxes, separated by hairlines */
.list { border-top: var(--hair); }
.row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: var(--s3); min-height: 48px; border-bottom: var(--hair); }
.row > span:first-child { font-size: var(--fs-sm); color: var(--ink-2); }
.row input, .row select, .row textarea { width: 100%; min-width: 0; border: 0; background: transparent; padding: 12px 0; font-size: var(--fs-input); outline: none; }
.row input::placeholder, .row textarea::placeholder { color: var(--ink-3); }
.row:focus-within { box-shadow: inset 0 -1px 0 var(--brand); }

/* Chips and status */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: var(--hair); border-radius: var(--r-pill); background: var(--bg); font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--bg-subtle); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); } .dot.live { background: var(--signal); animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: var(--hair); border-radius: 5px; font-size: 11px; color: var(--ink-3); background: var(--bg); }

/* Key-value cells (Swiss grid) */
.cells { display: grid; grid-template-columns: 1fr 1fr; margin: var(--s4) 0; border-top: var(--rule); }
.cells > div { padding: 10px 0; border-bottom: var(--hair); min-width: 0; }
.cells > div:nth-child(odd) { padding-right: var(--s3); }
.cells > div:nth-child(even) { padding-left: var(--s3); border-left: var(--hair); }
.cells dt, .cells .k { font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.cells dd, .cells .v { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* Tooltips: human explanations on hover */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 50; width: max-content; max-width: 240px; padding: 6px 9px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font: 450 11.5px/1.35 var(--font); letter-spacing: 0; text-transform: none; white-space: normal; text-align: left; pointer-events: none; box-shadow: var(--shadow-pop); }
  [data-tip-pos="below"]:hover::after { bottom: auto; top: calc(100% + 8px); }
  [data-tip-pos="left"]:hover::after { left: auto; right: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
