/* TradeTag — job-site skin. Token system + components adapted from
   ParetoOptimal/PITCHFIGHT_AI (glass cards, chip cards, mic button)
   and ParetoOptimal/small-talk (data-theme token pattern). */

:root {
  --bg-deep: #07080a;
  --bg-panel: rgba(16, 19, 24, 0.82);
  --text-main: #f5f0e6;
  --text-muted: #9aa3b5;
  --accent-gold: #f4d35e;   /* safety yellow */
  --accent-red: #e63946;    /* hazard */
  --accent-cyan: #4ecdc4;   /* info */
  --border-soft: rgba(244, 211, 94, 0.16);
  --glow-gold: rgba(244, 211, 94, 0.42);
  --glow-red: rgba(230, 57, 70, 0.35);
  --bg: var(--bg-deep); --text: var(--text-main); --muted: var(--text-muted);
  --red: var(--accent-red); --gold: var(--accent-gold); --border: var(--border-soft);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --app-vh: 100svh;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-hud: "Rajdhani", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: var(--app-vh, 100svh);
  min-height: var(--app-vh, 100dvh);
  -webkit-font-smoothing: antialiased;
}

.hud-font { font-family: var(--font-hud); letter-spacing: 0.08em; }

/* ambient glow — lifted verbatim, re-tinted */
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(244, 211, 94, 0.10), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(78, 205, 196, 0.07), transparent 30%);
}

#topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem clamp(0.9rem, 3vw, 1.4rem);
  background: rgba(7, 8, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
#topbar .brand { font-weight: 700; font-size: 1.05rem; color: var(--gold); }
.house-label { font-size: 0.85rem; color: var(--muted); max-width: 60%; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app {
  position: relative; z-index: 1;
  width: min(680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: clamp(0.9rem, 2vw, 1.5rem) clamp(0.4rem, 2vw, 1rem) 3rem;
}

/* screens router */
.screen { display: none; }
.screen.active { display: block; animation: screen-in 0.22s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* glass card */
.glass {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.center-card { text-align: center; margin-top: 12vh; }

/* type */
h1 { font-family: var(--font-hud); font-size: clamp(1.9rem, 6.5vw, 2.8rem); line-height: 1.12; margin: 0.4rem 0 0.8rem; }
h2 { font-family: var(--font-hud); font-size: clamp(1.25rem, 4.5vw, 1.6rem); margin: 1.1rem 0 0.6rem; }
.accent { color: var(--gold); }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; color: var(--gold);
  text-transform: uppercase; }
.lede { color: var(--muted); font-size: 1.02rem; }
.hint { color: var(--muted); font-size: 0.9rem; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

/* buttons — lifted */
.btn {
  border: none; border-radius: 12px; padding: 0.95rem 1.25rem;
  font-weight: 700; font-size: 1rem; cursor: pointer; min-height: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #1a1608;
  background: linear-gradient(135deg, var(--gold), #ffe27a);
  box-shadow: 0 0 18px rgba(244, 211, 94, 0.35);
}
.btn-secondary { color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-wide { width: 100%; margin-top: 1rem; }
.btn-log { font-size: 1.15rem; padding: 1.15rem; }
.btn-back { padding: 0.4rem 0.2rem; min-height: 0; margin-bottom: 0.2rem; }

/* hero */
.hero { margin-top: 6vh; }
.hero .hint { margin-top: 0.9rem; text-align: center; }

/* brief card */
.brief-card { border-color: rgba(244, 211, 94, 0.35); }
.brief-body { margin-top: 0.6rem; font-size: 1.02rem; }
.brief-body .brief-line { margin: 0.45rem 0; padding-left: 0.2rem; }
.brief-body .brief-hazard {
  color: #ffd9dc;
  background: rgba(230, 57, 70, 0.12);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-weight: 600;
}

/* history */
.history-head { margin: 1.6rem 0 0.6rem; color: var(--muted); font-size: 0.85rem;
  letter-spacing: 0.15em; text-transform: uppercase; }
.entry-card { margin-bottom: 0.7rem; padding: 0.9rem 1rem; }
.entry-top { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.entry-trade { font-size: 1.15rem; }
.entry-summary { font-weight: 600; flex: 1 1 100%; margin-top: 0.2rem; }
.entry-date { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.entry-author { color: var(--accent-cyan); font-size: 0.85rem; }
.entry-details { margin-top: 0.55rem; font-size: 0.92rem; color: var(--muted); }
.entry-details dt { color: var(--text); font-weight: 600; margin-top: 0.5rem; }
.entry-details dd { margin: 0.1rem 0 0; }
.entry-hazard { color: #ffb3b9; font-weight: 600; }
.entry-card summary { cursor: pointer; color: var(--accent-cyan); font-size: 0.85rem; margin-top: 0.4rem; }
.entry-photos { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.entry-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); }

/* chip cards — persona-card lifted */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
.chip-card {
  text-align: center; padding: 0.9rem 0.85rem; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.22);
  color: var(--text); cursor: pointer; font-size: 1rem; font-weight: 600;
  font-family: inherit; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.chip-card:hover, .chip-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(244, 211, 94, 0.18);
  transform: translateY(-2px);
}
.chip-card.selected { background: rgba(244, 211, 94, 0.10); }
.chip-icon { font-size: 1.3rem; }

/* forms — lifted */
input, textarea, select {
  width: 100%; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25); color: var(--text);
  padding: 0.75rem 0.8rem; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(244, 211, 94, 0.4); border-color: transparent; }
select option { background: #14161b; color: var(--text); }
.startup-form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.startup-form label { display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--muted); }
.hazard-label { color: #ffb3b9 !important; }
.confirm-card { margin-top: 0.6rem; }

.author-card { margin-top: 1.2rem; padding: 0.9rem 1rem; }
.author-summary { display: flex; align-items: center; gap: 0.6rem; justify-content: space-between; }

/* mic button — lifted verbatim, re-tinted to gold */
.voice-stage { text-align: center; margin-top: 1rem; }
.voice-mic-btn {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  border: 2px solid rgba(244, 211, 94, 0.5);
  background: radial-gradient(circle at 30% 30%, rgba(244, 211, 94, 0.25), rgba(10, 9, 4, 0.9));
  color: var(--gold); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 24px rgba(244, 211, 94, 0.2);
  transition: transform 0.15s, box-shadow 0.2s;
  margin: 1.4rem auto 0.8rem;
}
.voice-mic-btn:hover { transform: scale(1.04); box-shadow: 0 0 32px rgba(244, 211, 94, 0.35); }
.voice-mic-btn.recording {
  border-color: #f87171; color: #f87171;
  box-shadow: 0 0 28px rgba(248, 113, 113, 0.45);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-mic-btn .mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; }
.voice-mic-btn.recording .mic-ring { border-color: rgba(248, 113, 113, 0.35); animation: voice-ring 1.2s ease-out infinite; }
@keyframes voice-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes voice-ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.35); opacity: 0; } }
.voice-timer { font-size: 1.4rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums;
  font-family: var(--font-hud); }
.voice-status { color: var(--muted); margin-top: 0.2rem; min-height: 1.4em; }

.type-instead { margin-top: 1.6rem; text-align: left; }
.type-instead summary { color: var(--accent-cyan); cursor: pointer; text-align: center; }
.type-instead textarea { margin-top: 0.7rem; }

/* photos */
.photo-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.photo-strip img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); }

/* done */
.done-check {
  width: 84px; height: 84px; margin: 0 auto 0.8rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.6rem; color: #103b1c;
  background: linear-gradient(135deg, #7ee08a, #b9f0be);
  box-shadow: 0 0 28px rgba(126, 224, 138, 0.4);
}

/* busy overlay + spinner */
.busy-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(4, 5, 8, 0.7);
  backdrop-filter: blur(4px); display: grid; place-items: center; }
/* The hidden attribute only works via the UA stylesheet, which any author
   `display:` rule silently overrides — this reset makes hidden always win.
   (Without it the busy overlay was permanently visible from page load.) */
[hidden] { display: none !important; }
.busy-overlay .center-card { margin-top: 0; min-width: 240px; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 0.7rem; border-radius: 50%;
  border: 3px solid rgba(244, 211, 94, 0.2); border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* brand logo (white badge treatment for the dark theme) */
.brand-logo {
  width: 26px; height: 26px; border-radius: 7px; background: #fff; padding: 2px;
  vertical-align: -7px; margin-right: 7px; display: inline-block;
}
.hero-logo {
  width: 84px; height: 84px; border-radius: 20px; background: #fff; padding: 6px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 0 26px rgba(244, 211, 94, 0.12);
  margin-bottom: 0.9rem; display: block;
}

/* landing sections */
.land-sec { margin-top: 1.6rem; }
.land-sec h2 { margin: 0.15rem 0 0.8rem; }

.tech-items { display: grid; gap: 0.85rem; }
.tech-item { display: flex; gap: 0.6rem; align-items: flex-start; }
.tech-item > span { font-size: 1.15rem; line-height: 1.35; }
.tech-item b { display: block; font-size: 0.95rem; }
.tech-item small { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.diff-card { padding: 1.1rem 1.2rem; }

/* animated 20s demo: 4 frames x 5s */
.demo-card { padding: 1.1rem 1.2rem 1rem; }
.demo-phone {
  position: relative; margin-top: 0.8rem; height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px;
  background: rgba(0, 0, 0, 0.35); overflow: hidden;
}
.demo-frame {
  position: absolute; inset: 0; padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; justify-content: center; gap: 0.45rem;
  opacity: 0; animation: demo-cycle 20s infinite;
}
.df-1 { animation-delay: 0s; }
.df-2 { animation-delay: 5s; }
.df-3 { animation-delay: 10s; }
.df-4 { animation-delay: 15s; }
@keyframes demo-cycle {
  0% { opacity: 0; } 3% { opacity: 1; } 24% { opacity: 1; } 27% { opacity: 0; }
  100% { opacity: 0; }
}
.demo-big { font-size: 2.2rem; line-height: 1; }
.demo-title { font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; font-size: 1.1rem; }
.demo-sub { color: var(--muted); font-size: 0.88rem; margin: 0; }
.demo-line { font-size: 0.85rem; color: var(--text); }
.demo-hazard { color: #ffb3b9; }
.demo-pulse { animation: demo-pulse 1.2s ease-in-out infinite; }
@keyframes demo-pulse { 50% { transform: scale(1.12); } }
.demo-done { color: #9be29b; }
.demo-dots { display: flex; gap: 0.4rem; justify-content: center; margin-top: 0.7rem; }
.demo-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(244, 211, 94, 0.25);
  animation: demo-dot 20s infinite;
}
.demo-dots i:nth-child(1) { animation-delay: 0s; }
.demo-dots i:nth-child(2) { animation-delay: 5s; }
.demo-dots i:nth-child(3) { animation-delay: 10s; }
.demo-dots i:nth-child(4) { animation-delay: 15s; }
@keyframes demo-dot {
  0% { background: rgba(244, 211, 94, 0.25); } 3% { background: var(--gold); }
  24% { background: var(--gold); } 27% { background: rgba(244, 211, 94, 0.25); }
  100% { background: rgba(244, 211, 94, 0.25); }
}
@media (prefers-reduced-motion: reduce) {
  .demo-frame { opacity: 1; position: static; padding: 0.6rem 0; animation: none; }
  .demo-phone { height: auto; }
}

/* how it works */
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.how-step { padding: 0.9rem 1rem; }
.how-step .k {
  font-family: var(--display); font-weight: 700; color: var(--gold);
  font-size: 1.3rem; display: block;
}
.how-step b { display: block; margin: 0.15rem 0 0.2rem; }
.how-step small { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }

/* use cases */
.uc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.uc-card { padding: 0.9rem 1rem; }
.uc-card > span { font-size: 1.3rem; }
.uc-card b { display: block; margin: 0.25rem 0 0.2rem; }
.uc-card small { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
@media (max-width: 380px) { .how-grid, .uc-grid { grid-template-columns: 1fr; } }

/* pilot CTA */
.cta-card { padding: 1.2rem 1.2rem 1.3rem; text-align: center; }
.cta-card h2 { margin-bottom: 0.4rem; }
.cta-card .btn { margin-top: 0.9rem; }

/* FAQ */
.faq { display: grid; gap: 0.55rem; }
.faq details {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px; padding: 0.75rem 0.95rem;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.faq p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0.55rem 0 0; }

/* house geolocation */
.house-loc { margin: 0.7rem 0 1rem; font-size: 0.9rem; color: var(--muted); }
.house-loc a { color: var(--gold); text-decoration: none; }
.house-loc a:hover { text-decoration: underline; }
.loc-map { margin-top: 0.45rem; }
.loc-map summary { cursor: pointer; font-size: 0.85rem; }
.loc-map iframe { width: 100%; height: 220px; border: 0; border-radius: 12px; margin-top: 0.5rem; }
.loc-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.loc-row .hint { margin: 0; }

.error-banner {
  color: #ffd9dc; background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.4); border-radius: 10px;
  padding: 0.6rem 0.8rem; margin-top: 0.8rem; font-size: 0.92rem;
}

@media (max-width: 480px) {
  .chip-grid { grid-template-columns: 1fr 1fr; }
  body { font-size: 15px; }
}

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