/* ShiftHands auth pages (login, signup) and the 404 page. Dark only, mobile first.
   Brand tokens (--sh-*) and the Figtree face live in fonts.css, which every page loads first.
   No green, no orange, no purple. Amber = "needs you" only; red = errors only. */
:root {
  color-scheme: dark;
  --bg: var(--sh-bg);
  --ground: var(--sh-card);
  --panel: var(--sh-card);
  --panel-2: var(--sh-raised);
  --field: var(--sh-bg);
  --line: var(--sh-line-2);
  --line-soft: var(--sh-line);
  --text: var(--sh-text);
  --muted: var(--sh-text-2);
  --faint: var(--sh-muted);
  --amber: var(--sh-amber);
  --red: var(--sh-red);
  --red-text: var(--sh-red-text);
  --blue: var(--sh-blue);
  --blue-text: var(--sh-blue-text);
  --blue-soft: var(--sh-blue-soft);
  --focus: var(--sh-blue-text);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --font: var(--sh-font);
  --font-display: var(--sh-font);
  --gutter: 20px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.03em; font-weight: 750; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: 600 15px/1 var(--font); letter-spacing: -0.005em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, opacity .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sh-blue); color: #fff; }
.btn-primary:hover { background: var(--sh-blue-hover); }
.btn-primary:active { background: var(--sh-blue-press); }
.btn-ghost { background: var(--sh-raised); color: var(--text); }
.btn-ghost:hover { background: var(--sh-raised-hover); }
.btn-quiet { background: transparent; color: var(--text); }
.btn-quiet:hover { background: var(--panel); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: progress; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(24, 25, 26, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17.5px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; overflow: hidden; flex: none;
  background: var(--sh-raised); box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: none; gap: 4px; }
.nav-links a { color: var(--muted); font-size: 14.5px; padding: 8px 12px; border-radius: 999px; }
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 6px; }
@media (max-width: 359px) { .header-actions .btn-quiet { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 40px 0 56px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 620px; pointer-events: none;
  background:
    radial-gradient(40% 50% at 70% 30%, rgba(24, 119, 242, 0.10), transparent 70%),
    radial-gradient(35% 45% at 20% 10%, rgba(8, 102, 255, 0.06), transparent 70%);
}
.hero-grid { position: relative; display: grid; gap: 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-soft);
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sh-blue-fb); box-shadow: 0 0 0 3px var(--blue-soft); flex: none; }
.hero h1 { font-size: clamp(38px, 10.5vw, 68px); margin: 18px 0 16px; font-weight: 680; letter-spacing: -0.035em; }
.hero h1 .soft { color: var(--sh-blue-fb); }
.lede { color: var(--muted); font-size: 17.5px; max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-ctas .btn { flex: 1 1 auto; }
.hero-note { margin-top: 16px; color: var(--faint); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hero-note svg { flex: none; color: var(--blue-text); }

/* Workspace preview (illustration) */
.preview { position: relative; padding-top: 116px; }
.preview-mascot {
  position: absolute; top: 0; right: 10%; z-index: 2;
  width: 120px; height: 146px; /* 200x244 frame at 0.6 */
}
.window {
  position: relative; z-index: 1;
  background: var(--ground); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; border: 1px solid var(--line-soft);
}
.window-bar { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--sh-raised); display: block; }
.window-bar span { margin-left: 10px; color: var(--faint); font-size: 12.5px; }
.window-body { display: grid; grid-template-columns: 1fr; min-height: 340px; }
.agents { display: none; border-right: 1px solid var(--line-soft); padding: 10px 8px; }
.agent-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.agent-row.active { background: var(--panel-2); }
.agent-row .av { width: 30px; height: 30px; border-radius: 50%; background: var(--sh-raised); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text); flex: none; }
.agent-row b { display: block; font-size: 13.5px; font-weight: 600; }
.agent-row small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.agent-row small .dot { width: 6px; height: 6px; box-shadow: none; }
.dot.amber { background: var(--amber); }
.dot.idle { background: var(--faint); }
.chat { display: flex; flex-direction: column; gap: 12px; padding: 16px; font-size: 14px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.chat-head b { font-size: 14px; }
.chat-head .model { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 10px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; line-height: 1.45; }
.bubble.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble.agent { align-self: flex-start; background: var(--panel); border-bottom-left-radius: 6px; }
.notice { align-self: center; color: var(--faint); font-size: 12.5px; text-align: center; }
.approval { align-self: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.approval p { font-size: 13.5px; }
.approval p b { font-weight: 600; }
.approval .row { display: flex; gap: 8px; margin-top: 10px; }
.approval .pill { flex: 1; text-align: center; border-radius: 999px; padding: 7px 0; font-size: 13px; font-weight: 600; }
.approval .yes { background: var(--blue); color: #fff; }
.approval .no { background: transparent; border: 1px solid var(--line); color: var(--text); }

/* ---------- Sprites ---------- */
/* Horizontal frame strips (24 fps). With background-size N*100%, position p% shifts by p*(N-1) frames,
   so N/(N-1) * 100% lands one frame past the end and steps(N) shows every frame once. */
.sprite { background-repeat: no-repeat; background-position: 0 0; }
.sprite-wave { background-image: url("/site/img/wave-strip.webp"); background-size: 3600% 100%; aspect-ratio: 200 / 244; animation: wave 1.5s steps(36) infinite; }
.sprite-type { background-image: url("/site/img/type-strip.webp"); background-size: 2400% 100%; aspect-ratio: 204 / 218; animation: type 1s steps(24) infinite; }
@keyframes wave { from { background-position: 0 0; } to { background-position: calc(100% * 36 / 35) 0; } }
@keyframes type { from { background-position: 0 0; } to { background-position: calc(100% * 24 / 23) 0; } }
@media (prefers-reduced-motion: reduce) {
  .sprite-wave, .sprite-type { animation: none; background-position: 0 0; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line-soft); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.kicker { color: var(--blue-text); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.section h2 { font-size: clamp(28px, 7vw, 42px); }
.section-head p { color: var(--muted); font-size: 17px; margin-top: 14px; }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.step {
  position: relative; background: var(--ground); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
}
.step-num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-text); font-weight: 700; font-size: 14px; margin-bottom: 16px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15.5px; }

/* Features */
.features { display: grid; gap: 14px; grid-auto-flow: row dense; }
.feature {
  background: var(--ground); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.feature .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-text); margin-bottom: 4px;
}
.feature h3 { font-size: 17.5px; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 15px; }
.feature.wide { gap: 14px; }
.status-row { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.status {
  flex: 1 1 0; min-width: 88px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 8px 10px;
}
.status img { height: 64px; width: auto; }
@media (min-width: 1024px) { .status img { height: 84px; } }
.status span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.status span .dot { width: 6px; height: 6px; box-shadow: none; }

/* Subscriptions */
.byo { display: grid; gap: 28px; align-items: center; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--ground); border: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--text);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sh-blue-fb); opacity: .85; }
.trust {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 22px;
  background: var(--blue-soft); border: 1px solid var(--sh-blue-line); border-radius: var(--radius);
  padding: 16px 18px;
}
.trust svg { flex: none; color: var(--blue-text); margin-top: 2px; }
.trust p { font-size: 15px; color: var(--text); }
.trust p span { color: var(--muted); }
.byo-note { color: var(--faint); font-size: 13.5px; margin-top: 14px; }

/* Pricing */
.pricing-card {
  position: relative; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 22px; display: grid; gap: 18px;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px; align-self: start; justify-self: start;
  padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-text); font-size: 13px; font-weight: 600;
}
.pricing-card h3 { font-size: 24px; }
.pricing-card p { color: var(--muted); }
.pricing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pricing-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 15px; }
.pricing-list svg { flex: none; color: var(--blue-text); margin-top: 3px; }

/* Closing CTA */
.cta-band {
  display: grid; gap: 20px; align-items: center; justify-items: center; text-align: center;
  background: var(--ground); border: 1px solid var(--line-soft); border-radius: 28px;
  padding: 36px 22px 32px;
}
.cta-band .sprite-type { width: 132px; }
.cta-band h2 { font-size: clamp(26px, 6.5vw, 38px); max-width: 18em; }
.cta-band p { color: var(--muted); max-width: 32em; }
.cta-band .hero-ctas { justify-content: center; margin-top: 4px; }

/* Footer */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 14px; }
.footer-grid { display: grid; gap: 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Auth pages ---------- */
.auth-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-top { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 12px var(--gutter) 48px; position: relative; }
.auth-main::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 35% at 50% 20%, rgba(8, 102, 255, 0.12), transparent 70%);
}
.auth-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--ground); border: 1px solid var(--line-soft); border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px 22px 26px;
}
.auth-mascot { width: 76px; height: auto; margin: -8px auto 10px; }
.auth-card h1 { font-size: 28px; font-weight: 800; text-align: center; letter-spacing: -0.035em; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 8px 0 24px; font-size: 15.5px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 13px; color: var(--muted); }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  background: var(--field); color: var(--text); border: 1px solid var(--sh-raised);
  font: 16px var(--font); transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--sh-raised-hover); }
.input:focus { outline: none; border-color: var(--sh-blue-fb); box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.28); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(240, 40, 73, 0.22); }
.input.has-toggle { padding-right: 72px; }
.toggle-pass {
  position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border-radius: 9px;
  background: transparent; border: 0; color: var(--muted); font: 600 13.5px var(--font); cursor: pointer;
}
.toggle-pass:hover { color: var(--text); background: var(--panel-2); }
.field-error { font-size: 13.5px; color: var(--red-text); }
.field-error:empty { display: none; }
.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--sh-red-soft); border: 1px solid rgba(240, 40, 73, 0.45); color: #FFD0D7;
  border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 16px;
}
.form-error[hidden] { display: none; }
.form-error svg { flex: none; color: var(--red-text); margin-top: 2px; }
.form-error a { color: #fff; text-decoration: underline; }
.auth-card .btn-primary { width: 100%; margin-top: 6px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-switch { text-align: center; margin-top: 20px; color: var(--muted); font-size: 15px; }
.auth-fine { text-align: center; margin-top: 18px; color: var(--faint); font-size: 13px; }
.auth-foot { text-align: center; padding: 0 0 28px; color: var(--faint); font-size: 13.5px; }
.auth-foot a { color: var(--muted); }

/* Phones: icon beside the text keeps the stacked cards short. */
@media (max-width: 719px) {
  .step, .feature { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 4px; align-items: start; padding: 18px; }
  .step-num, .feature .icon { grid-row: span 2; margin: 0; }
  .step-num { width: 34px; height: 34px; }
  .step h3 { margin-bottom: 0; }
  .step h3, .feature h3 { font-size: 17px; padding-top: 7px; }
  .step p, .feature p { grid-column: 2; font-size: 15px; }
  .feature .status-row { grid-column: 1 / -1; margin-top: 10px; }
  .feature .status img { height: 56px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 26px; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .hero-ctas .btn { flex: 0 0 auto; }
  .status-row { flex-wrap: nowrap; }
  .auth-card { padding: 34px 32px 30px; }
}
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .feature.wide { grid-column: span 2; }
  .window-body { grid-template-columns: 200px 1fr; }
  .agents { display: block; }
  .pricing-card { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 36px; }
  .pricing-card .badge { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: center; }
  .cta-band { padding: 48px 40px 44px; }
}
@media (min-width: 900px) {
  .nav-links { display: flex; }
}
@media (min-width: 1024px) {
  .hero { padding: 72px 0 96px; }
  .hero-grid { grid-template-columns: 1.02fr 1fr; align-items: center; gap: 56px; }
  .preview-mascot { width: 140px; height: 171px; right: 8%; }
  .preview { padding-top: 138px; }
  .section { padding: 96px 0; }
  .section-head { margin-bottom: 44px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .byo { grid-template-columns: 1fr 1fr; gap: 56px; }
  .cta-band { grid-template-columns: auto 1fr auto; text-align: left; justify-items: start; padding: 40px 48px; gap: 32px; }
  .cta-band .hero-ctas { margin-top: 0; }
}

[hidden] { display: none !important; }
