/*
 * One Shot — "Terminal" design system
 * ------------------------------------
 * Warm-dark, IDE-native, precise. One accent (Spark amber); depth from surface
 * layering + hairline borders, not gradients or heavy shadows. IBM Plex Sans for
 * UI/prose, IBM Plex Mono for labels/keys/terminals only.
 *
 * This is the single source of truth for the look of both the marketing site and
 * the app buyers build — change tokens here and everything follows. Source of the
 * values: design/One Shot Design System.dc.html.
 *
 * With Propshaft, `stylesheet_link_tag :app` bundles every file in this directory.
 */

/* ---------------------------------------------------------------- Tokens --- */
:root {
  /* Surfaces (warm near-black, layered by lightness) */
  --ink:        oklch(0.185 0.008 70);   /* page background */
  --surface:    oklch(0.215 0.009 72);   /* alternating sections */
  --card:       oklch(0.175 0.008 70);   /* cards */
  --well:       oklch(0.145 0.008 70);   /* code wells, inputs, nested */

  /* Lines */
  --border:        oklch(0.30 0.012 70);
  --border-soft:   oklch(0.28 0.012 70);
  --border-input:  oklch(0.34 0.012 70);

  /* Accent — "Spark" (amber/orange): CTAs, labels, focus, links */
  --spark:        oklch(0.76 0.15 62);
  --spark-hover:  oklch(0.82 0.15 62);
  --spark-border: oklch(0.34 0.03 62);

  /* Status */
  --ok:          oklch(0.70 0.12 150);   /* success / test-green / paid */
  --warn:        oklch(0.80 0.14 75);    /* honest-caveat text */
  --warn-tint:   oklch(0.20 0.05 62);    /* caveat surface */
  --warn-border: oklch(0.40 0.09 62);

  /* Text */
  --bone:        oklch(0.93 0.006 85);   /* body copy */
  --bone-bright: oklch(0.96 0.006 85);   /* headings */
  --muted:       oklch(0.72 0.01 80);    /* secondary */
  --muted-2:     oklch(0.60 0.01 80);    /* tertiary / captions */

  /* Terminal window traffic lights */
  --tl-red:    oklch(0.6 0.13 25);
  --tl-yellow: oklch(0.78 0.12 85);
  --tl-green:  oklch(0.7 0.12 150);

  /* Type */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --container: 1200px;
  --measure: 640px;
  --section-y: 88px;
  --section-x: 40px;

  /* Radii */
  --r-card: 12px;
  --r-btn: 9px;
  --r-input: 9px;
  --r-pill: 999px;
  --r-chip: 8px;
}

/* ------------------------------------------------------------------ Base --- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--spark); color: var(--ink); }

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

img, svg { max-width: 100%; display: block; }

/* ------------------------------------------------------------ Typography --- */
h1, h2, h3, h4 {
  color: var(--bone-bright);
  font-weight: 600;
  margin: 0 0 0.5em;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

h1 { font-size: clamp(40px, 6vw, 66px); line-height: 1.0; letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 4vw, 40px); }
h3 { font-size: 20px; letter-spacing: -0.02em; }
h4 { font-size: 16px; letter-spacing: normal; }

p { margin: 0 0 1em; max-width: var(--measure); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--spark);
  margin: 0 0 16px;
}

.lede { font-size: 19px; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }

/* ------------------------------------------------------------- Layout ------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--section-x);
}

.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section--well { background: var(--well); }
.section--bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.grid { display: grid; gap: 24px; }
@media (min-width: 860px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--hero { grid-template-columns: 1.12fr 0.88fr; align-items: center; gap: 48px; }
}

/* ------------------------------------------------------------- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}

.btn--primary { background: var(--spark); color: var(--ink); }
.btn--primary:hover { background: var(--spark-hover); color: var(--ink); }

.btn--secondary { background: transparent; color: var(--bone); border-color: var(--border-input); }
.btn--secondary:hover { border-color: var(--spark); color: var(--bone-bright); }

.btn--ghost {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 0;
  color: oklch(0.84 0.008 80);
  background: transparent;
}
.btn--ghost:hover { color: var(--bone-bright); }
.btn--block { width: 100%; justify-content: center; }
.btn--sm { padding: 9px 16px; font-size: 14px; }

/* Social sign-in buttons — branded per Google & Apple guidelines (4-color "G" on a light
   button, Apple mark on a black button). Fill colors are brand-mandated, not theme tokens. */
.provider-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.provider-btns form.button_to { margin: 0; width: 100%; }
.provider-btn { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; padding: 13px; border-radius: var(--r-btn); border: 1px solid var(--border-input); background: #fff; color: #1f1f1f; font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit; transition: filter 120ms ease; }
.provider-btn:hover { filter: brightness(0.96); }
.provider-btn--apple { border-color: #000; background: #000; color: #fff; }
.provider-btn--apple:hover { filter: brightness(1.4); }
.provider-btn__logo { flex: 0 0 auto; display: block; }
.provider-caption { text-align: center; color: var(--muted-2); font-size: 13px; margin: 4px 0 0; }

/* Pills & chips */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--spark);
  border: 1px solid var(--spark-border);
  border-radius: var(--r-pill);
  padding: 7px 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  padding: 5px 10px;
}

/* --------------------------------------------------------------- Forms ----- */
label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="number"], input[type="password"],
textarea, select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--bone);
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 12px 15px;
  outline: none;
  transition: border-color 120ms ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--spark); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }

.field { margin-bottom: 16px; }
.field-hint { font-size: 13px; color: var(--muted-2); margin-top: 6px; }
.field-error { font-size: 13px; color: var(--warn); margin-top: 6px; }

/* --------------------------------------------------------------- Cards ----- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
}
.card__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--spark);
  margin-bottom: 10px;
}
.card__title { font-size: 16px; color: var(--bone-bright); margin: 0 0 8px; }
.card__body { font-size: 13.5px; color: var(--muted); margin: 0; }

/* Green-check list */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 600; }

/* ---------------------------------------------------------- Code well ------ */
.well-block {
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.well-block__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-size: 12px;
}
.well-block__dots { display: inline-flex; gap: 6px; margin-right: 6px; }
.well-block__dots i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.well-block__dots i:nth-child(1) { background: var(--tl-red); }
.well-block__dots i:nth-child(2) { background: var(--tl-yellow); }
.well-block__dots i:nth-child(3) { background: var(--tl-green); }
.well-block__body { padding: 16px; line-height: 1.7; white-space: pre-wrap; }
.well-block__body .cmd::before { content: "$ "; color: var(--spark); }
.well-block__body .ok { color: var(--ok); }
.well-block__body .dim { color: var(--muted-2); }

/* ------------------------------------------------------ Warning callout ---- */
.callout {
  background: var(--warn-tint);
  border: 1px solid var(--warn-border);
  border-radius: 11px;
  padding: 18px 20px;
  color: var(--warn);
  font-size: 14px;
}
.callout__label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* --------------------------------------------------------------- Nav -------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--ink) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.nav__links { display: none; gap: 28px; }
.nav__links a { color: var(--muted); font-size: 14px; }
.nav__links a:hover { color: var(--bone-bright); }
@media (min-width: 860px) { .nav__links { display: flex; } }

/* Logo: `> oneshot_` with a static Spark cursor */
.logo { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--bone-bright); }
.logo .prompt, .logo .cursor { color: var(--spark); }

/* Account menu (signed-in app chrome). Inline dropdown on desktop; hamburger sheet on mobile. */
.account { position: relative; display: inline-flex; }
.account__trigger {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--r-btn);
  color: var(--bone); font-family: var(--font-mono); font-size: 13px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.account__trigger:hover { color: var(--bone-bright); border-color: var(--border-input); }
.account__label { display: none; }
.account__caret { width: 14px; height: 14px; display: none; transition: transform 0.15s; }
.account__trigger[aria-expanded="true"] .account__caret { transform: rotate(180deg); }
.account__burger { width: 22px; height: 22px; }
@media (min-width: 860px) {
  .account__label, .account__caret { display: inline-flex; }
  .account__burger { display: none; }
}

.account__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 232px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: 0 12px 32px oklch(0 0 0 / 0.4);
}
.account__menu[hidden] { display: none; }
.account__email {
  padding: 8px 10px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted-2);
  border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis;
}
.account__menu form { margin: 0; }
.account__item {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: var(--r-chip);
  background: transparent; color: var(--bone); font-family: inherit; font-size: 14px; cursor: pointer;
}
.account__item:hover { background: var(--well); color: var(--bone-bright); }

body.nav-locked { overflow: hidden; }
/* Mobile: the menu drops to a full-width sheet under the bar. */
@media (max-width: 859px) {
  .account { position: static; }
  .account__menu {
    left: 0; right: 0; top: 100%; min-width: 0; border-radius: 0;
    border-left: 0; border-right: 0; box-shadow: 0 16px 32px oklch(0 0 0 / 0.5);
  }
}

/* -------------------------------------------------------------- Footer ----- */
.footer { border-top: 1px solid var(--border); padding-block: 48px; color: var(--muted-2); font-size: 13px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; margin: 16px 0; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--bone-bright); }

/* ------------------------------------------------------------- Flash ------- */
.flash { border-radius: var(--r-input); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; border: 1px solid var(--border); }
.flash--notice { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 40%, var(--border)); }
.flash--alert { color: var(--warn); border-color: var(--warn-border); background: var(--warn-tint); }

/* --------------------------------------------------------- Utilities ------- */
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trust-bar { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.narrow { max-width: 720px; margin-inline: auto; }
.auth-card { max-width: 440px; margin: 64px auto; }

/* ------------------------------------------------------------- Mobile ------ */
@media (max-width: 640px) {
  :root { --section-x: 20px; --section-y: 56px; }
  body { font-size: 16px; }
  h1 { font-size: clamp(34px, 11vw, 52px); }
  .lede { font-size: 17px; }
  .nav__inner { height: 56px; }
  .auth-card { margin: 32px auto; }
  /* Never let a wide element (code wells, terminal mocks) force horizontal page scroll. */
  .well-block__body { overflow-x: auto; }
  .btn { padding: 12px 18px; }
}
