/*
 * Shelfie marketing site. Colours are the app's tokens
 * (client/src/assets/css/tokens.css), so the site and the product match.
 */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }

:root {
  --bg: #0A1626;
  --surface: #111F33;
  --surface-2: #18293F;
  --border: #243852;
  --border-soft: rgba(143, 163, 188, 0.25);
  --text: #E8EEF7;
  --text-muted: #8FA3BC;
  --accent: #4D9FFF;
  --accent-strong: #76B5FF;
  --accent-soft: rgba(77, 159, 255, 0.16);
  --on-accent: #06101D;
  --ok: #3DD68C;
  --ok-soft: rgba(61, 214, 140, 0.15);
  --warn: #FFB454;
  --warn-soft: rgba(255, 180, 84, 0.15);
  --danger: #FF6B6B;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --gutter: 16px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 17px; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.88em; }
a { color: var(--accent-strong); }

:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

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

/* ---- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---- header ------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 22, 38, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand span { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--text-muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--text); }

.menu-toggle {
  display: none; background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); width: 42px; height: 42px; align-items: center; justify-content: center;
  cursor: pointer;
}

@media (max-width: 767px) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--border); }
  .site-nav .btn { margin-top: 14px; }
}

/* ---- hero --------------------------------------------------------------- */

.hero { padding: 64px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 96px 0 104px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 64px; }
}

.hero h1 { font-size: clamp(38px, 6.2vw, 64px); letter-spacing: -0.035em; max-width: 13ch; }
.lede { margin-top: 22px; font-size: 19px; color: var(--text-muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 20px; font-size: 14px; color: var(--text-muted); }

.hero-panel { margin: 0; }
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  font-size: 15px;
}
.hero-panel figcaption { margin-top: 14px; font-size: 14px; color: var(--text-muted); }

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-ref { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.panel-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.status { position: relative; display: inline-grid; flex-shrink: 0; }
.st {
  grid-area: 1 / 1; justify-self: end;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  opacity: 0; transition: opacity 240ms ease;
}
.st-expected { background: var(--surface-2); color: var(--text-muted); opacity: 1; }
.st-receiving { background: var(--warn-soft); color: var(--warn); }
.st-complete { background: var(--ok-soft); color: var(--ok); }
.hero-panel.is-receiving .st-expected { opacity: 0; }
.hero-panel.is-receiving .st-receiving { opacity: 1; }
.hero-panel.is-complete .st-receiving { opacity: 0; }
.hero-panel.is-complete .st-complete { opacity: 1; }

.panel-line {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline;
  margin-top: 18px; padding: 12px 14px;
  background: var(--surface-2); border-radius: var(--radius-md);
}
.sku { font-family: var(--mono); font-size: 13px; color: var(--accent-strong); }
.pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty { font-variant-numeric: tabular-nums; font-weight: 600; }

/* The quantity before/after swap shared by the order line and the portal tile. */
.q-after { display: none; }
.hero-panel.is-complete .panel-line .q-before,
.hero-panel.show-portal .fx-portal .q-before { display: none; }
.hero-panel.is-complete .panel-line .q-after,
.hero-panel.show-portal .fx-portal .q-after { display: inline; }

.scan-flash {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 9px 12px;
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 13.5px;
  transition: border-color 240ms ease, color 240ms ease, background-color 240ms ease;
}
.hero-panel.is-receiving .scan-flash { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.hero-panel.is-complete .scan-flash { border-color: var(--border); background: transparent; color: var(--text-muted); }

.effects { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.fx {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border);
  opacity: 0.28;
  transform: translateY(4px);
  transition: opacity 320ms ease, transform 320ms ease, border-color 320ms ease;
}
.fx-label { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.fx-value { text-align: right; font-size: 14px; }
.fx-value b { font-weight: 700; }
.plus, .ok { color: var(--ok); }
.hero-panel.show-ledger .fx-ledger,
.hero-panel.show-portal .fx-portal,
.hero-panel.show-bill .fx-bill,
.hero-panel.show-hook .fx-hook { opacity: 1; transform: none; border-color: var(--border-soft); }

@media (max-width: 420px) {
  .fx { flex-direction: column; gap: 2px; }
  .fx-value { text-align: left; }
}

/* ---- sections ----------------------------------------------------------- */

.glance, .feature, .trust, .get-started { padding: 72px 0; border-top: 1px solid var(--border); }
@media (min-width: 960px) {
  .glance, .feature, .trust, .get-started { padding: 104px 0; }
}
.section-lede { margin-top: 12px; color: var(--text-muted); max-width: 40em; }

.flow {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: 1px;
  background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  counter-reset: step;
}
@media (min-width: 600px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .flow { grid-template-columns: repeat(4, 1fr); } }
.flow li { counter-increment: step; background: var(--surface); padding: 22px 22px 24px; }
.flow li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-bottom: 14px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.flow p { margin-top: 6px; color: var(--text-muted); font-size: 15px; line-height: 1.5; }

.feature-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) {
  .feature-grid { grid-template-columns: 5fr 7fr; gap: 72px; }
  .feature.flip .feature-copy { order: 2; }
  .feature.flip .feature-grid { grid-template-columns: 7fr 5fr; }
}
.kicker { color: var(--accent-strong); font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.feature-copy h2 { max-width: 16ch; }
.feature-copy > p:not(.kicker) { margin-top: 18px; color: var(--text-muted); }
.feature-copy > p:last-child { margin-top: 24px; }

.ticks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--ok);
}

.feature-media img {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.feature-media.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 520px; margin-inline: auto; }
.feature-media.phones img { border-radius: 26px; }
.feature-media.phones img:nth-child(2) { margin-top: 48px; }
.feature-media.stack { display: grid; gap: 16px; }
.feature-media.dev { display: grid; gap: 20px; }
.feature-media.dev img { max-width: 440px; width: 100%; justify-self: center; }

.code {
  margin: 0; padding: 18px 20px;
  background: #07101C; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  font: 13px/1.6 var(--mono);
  overflow-x: auto;
}
.code .k { color: var(--accent-strong); }
.code .s { color: var(--ok); }
.code .c { color: var(--text-muted); }

.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.trust-list {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: 28px 40px;
}
@media (min-width: 700px) { .trust-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .trust-list { grid-template-columns: repeat(3, 1fr); } }
.trust-list li { border-top: 2px solid var(--accent); padding-top: 16px; }
.trust-list p { margin-top: 8px; color: var(--text-muted); font-size: 15px; line-height: 1.55; }

/* ---- get started -------------------------------------------------------- */

.trial-block {
  margin-top: 32px; padding: 24px; display: flex; flex-wrap: wrap; gap: 16px 24px;
  align-items: center; justify-content: space-between;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-lg);
}
.trial-block[hidden] { display: none; }

.forms { display: grid; gap: 24px; margin-top: 40px; align-items: start; }
@media (min-width: 960px) { .forms { grid-template-columns: 3fr 2fr; gap: 32px; } }

.lead-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px;
}
.lead-form.quiet { background: transparent; }
.lead-form h3 { font-size: 22px; }
.form-lede { margin: 8px 0 22px; color: var(--text-muted); font-size: 15px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
label { font-size: 14px; font-weight: 500; color: var(--text); }
.opt { color: var(--text-muted); font-weight: 400; }

input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 16px/1.4 var(--font);
}
textarea { resize: vertical; min-height: 92px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.lead-form.tried input:invalid { border-color: var(--danger); }

.lead-form .btn { margin-top: 4px; width: 100%; }
@media (min-width: 520px) { .lead-form .btn { width: auto; } }

.form-status { margin-top: 14px; font-size: 15px; min-height: 1.5em; }
.form-status.error { color: var(--danger); }
.form-status.done { color: var(--ok); }
.lead-form.sent .field, .lead-form.sent .field-row, .lead-form.sent .btn { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-row nav a { color: var(--text-muted); text-decoration: none; }
.footer-row nav a:hover { color: var(--text); }
.copy { color: var(--text-muted); margin-left: auto; }

/* ---- privacy page ------------------------------------------------------- */

.doc { padding: 64px 0 96px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc h2 { font-size: 22px; margin-top: 40px; }
.doc p, .doc li { color: var(--text-muted); margin-top: 12px; }
.doc ul { padding-left: 20px; }

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