/* ============================================================================
   HOMEPAGE - light wireframe port.
   Forced light surface; light/dark toggle removed (the inline theme script
   on index.html sets data-theme="light" unconditionally).
   All DOM classes/IDs the demo JS depends on are preserved:
     #incident, #incidentLabel, #incidentTime, #tabs, #fname, #editor,
     #runCheck, #chInput, #msgs, #chChannel, #chAlert, #cta, #typing,
     #heroMicroLead
     .tab[.active], .tdot, .ed-line[data-line], .ed-ln, .ed-code,
     .e-kw, .e-str, .e-num, .e-cmt, .e-fn, .e-prop,
     .tq-tab[data-role], .pg-activity-grid[data-pattern]
   ============================================================================ */

/* Page-level overrides - lock the homepage to the wireframe light palette
   regardless of the global theme tokens. Mirrors wireframes/homepage-light-v1.html. */
.homepage-body {
  --bg:           #FFFFFF;
  --bg-tint:      #F6F8FB;
  --bg-soft:      #FAFBFD;
  --bg-card:      #FFFFFF;
  --bg-warm:      #FFF7ED;
  --border:       #E5E8EE;
  --border-mid:   #CFD4DC;
  --text:         #0B0D12;
  --text-mid:     #4B5563;
  --text-low:     #6B7280;
  --text-dim:     #9CA3AF;
  --problem:      #E11D48;
  --problem-bg:   #FFE4E6;
  --syn-kw:       #E11D48;
  --syn-str:      #2563EB;
  --syn-num:      #2563EB;
  --syn-cmt:      #9CA3AF;
  --syn-fn:       #1D4ED8;
  --syn-prop:     #4B5563;

  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ============================================================================
   NAV
   ============================================================================ */
.homepage-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.homepage-nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
.homepage-nav .nav-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  gap: 0;
}
.homepage-nav .nav-logo .dot {
  color: var(--brand);
  font-weight: 800;
  margin-left: 1px;
}
.homepage-nav .nav-actions {
  display: flex; gap: 10px; align-items: center;
}
.homepage-nav .btn-ghost {
  padding: 8px 14px;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-md);
  text-decoration: none;
}
.homepage-nav .btn-ghost:hover { color: var(--text); background: var(--bg-tint); }
.homepage-nav .btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh-cta);
  transition: transform 150ms, box-shadow 150ms, background 150ms;
}
.homepage-nav .btn-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* ============================================================================
   HERO - radial gradient + headline + sub + pointer + demo + CTA
   ============================================================================ */
.hero {
  position: relative;
  padding: 56px 0 40px;
  overflow: hidden;
  max-width: none;
  margin: 0;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 540px;
  background: radial-gradient(ellipse at center, var(--brand-tint), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-headline {
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
  max-width: 900px;
  margin: 0 auto 22px;
  padding: 0 32px;
}
.hero-headline em,
.hero-headline strong { font-style: normal; font-weight: 800; color: var(--brand); }
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-mid);
  max-width: 640px;
  margin: 0 auto 18px;
  padding: 0 32px;
}
.hero-sub b { color: var(--text); font-weight: 600; }
.hero-pointer {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.02em;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-pointer-arrow {
  flex: none;
  animation: hintBob 2.6s ease-in-out infinite;
}
@keyframes hintBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) { .hero-pointer { animation: none; } }

/* ============================================================================
   DEMO - light IDE mockup
   ============================================================================ */
.hero-demo {
  margin: 32px auto 0;
  max-width: 1000px;
  padding: 0 32px;
  position: relative;
}
.hero-demo .ws {
  /* The parent .hero is text-align: center so the headline + sub center.
     Reset inside the demo window so editor lines and chat messages don't
     inherit that and float-center inside their cells. */
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 2px 4px rgba(11,13,18,0.04),
    0 12px 28px rgba(11,13,18,0.10),
    0 36px 80px rgba(11,13,18,0.14);
  color: var(--text);
}
.hero-demo .ws-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border-mid);
}
.hero-demo .ws-bar-l { display: flex; align-items: center; gap: 8px; }
.hero-demo .dot { width: 11px; height: 11px; border-radius: 50%; }
.hero-demo .dot.r { background: #FF6058; }
.hero-demo .dot.y { background: #FDBC2E; }
.hero-demo .dot.g { background: #28C940; }
.hero-demo .ws-bar-name {
  margin-left: 6px;
  font-size: 12.5px;
  color: #4B5562;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.hero-demo .incident {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;   /* fixed-width digits so the timer doesn't shift */
}
.hero-demo .incident-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #FF6058;   /* match the red window-title dot */
}
.hero-demo .incident-sep { opacity: 0.6; }
.hero-demo .incident.resolved { color: #16a34a; }
.hero-demo .incident.resolved .incident-dot { background: #16a34a; animation: none; }
@keyframes incidentPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  70%      { box-shadow: 0 0 0 6px transparent; }
}

/* Role tab strip */
.hero-demo .ws-tabs {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-mid);
  padding: 0 10px;
  overflow-x: auto;
}
.hero-demo .tab-row { display: flex; }
/* Mobile-only incident line (replaces the chat on small screens); hidden on desktop. */
.demo-incident { display: none; }
/* Mobile-only: two-line pointer, the outside pill strip, and the fail result line.
   All hidden on desktop (which keeps the in-demo underline tabs + chat). */
.hero-pointer-mobile, .demo-result { display: none; }
/* Role pills live OUTSIDE the demo window (above it) on every screen - far
   clearer that they're a clickable selector than the in-window tab strip. */
.hero-demo .ws-tabs { display: none; }
.demo-tabs-mobile {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin: 16px 0 18px; padding: 0 16px;
}
.demo-pill {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms;
}
.demo-pill.active { background: var(--role); border-color: var(--role); color: #fff; }
/* Slightly larger pills on desktop. */
@media (min-width: 901px) {
  .demo-pill { font-size: 14.5px; padding: 9px 18px; }
}
.hero-demo .tab {
  appearance: none; background: none; border: none; cursor: pointer;
  color: var(--text-mid);
  font-size: 15px; font-weight: 500;
  font-family: inherit;
  padding: 11px 16px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex; align-items: center; gap: 7px;
  transition: color 120ms, background 120ms, border-color 120ms;
}
.hero-demo .tab .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--role); opacity: 0.85; }
.hero-demo .tab.active { color: var(--text); border-bottom-color: var(--role); font-weight: 600; background: var(--bg); }
.hero-demo .tab.active .tdot { opacity: 1; }
.hero-demo .tab:hover { color: var(--text); background: var(--bg); border-bottom-color: var(--role); }

/* 2-column body */
.hero-demo .ws-body {
  display: grid;
  grid-template-columns: 46% 54%;
  grid-template-rows: 392px;
}

/* Editor */
.hero-demo .ed { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.hero-demo .ed-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-mid);
  font-size: 12px; color: var(--text-mid);
  background: var(--bg-tint);
}
.hero-demo .ed-head .fname { color: var(--text); font-family: var(--f-mono); font-weight: 600; }
.hero-demo .ed-code-wrap {
  flex: 1;
  overflow: auto;
  padding: 12px 0;
  font-family: var(--f-mono);
  font-size: 13.5px;
  line-height: 1.75;
  background: var(--bg);
}
.hero-demo #editor { outline: none; }
.hero-demo .ed-line { display: grid; grid-template-columns: 32px 1fr; gap: 6px; padding: 0 8px; }
.hero-demo .ed-ln { color: var(--text-dim); text-align: right; padding-right: 10px; border-right: 1px solid var(--border); user-select: none; }
.hero-demo .ed-code { color: var(--text); white-space: pre; padding-left: 12px; }
/* Blinking caret on the line to fix - signals the editor is editable. */
@keyframes edCaretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.hero-demo .ed-line.cursor .ed-code::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--text);
  vertical-align: text-bottom;
  animation: edCaretBlink 1.1s step-end infinite;
}
.hero-demo .ed-line.solved { background: rgba(34,197,94,0.10); }
.hero-demo .ed-line.solved .ed-code { color: #15803d; }
/* Light syntax */
.hero-demo .e-kw { color: var(--syn-kw); font-weight: 600; }
.hero-demo .e-str { color: var(--syn-str); }
.hero-demo .e-num { color: var(--syn-num); }
.hero-demo .e-cmt { color: var(--syn-cmt); font-style: italic; }
.hero-demo .e-fn { color: var(--syn-fn); font-weight: 600; }
.hero-demo .e-prop { color: var(--syn-prop); }

.hero-demo .ed-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border-mid);
  background: var(--bg-tint);
}
.hero-demo .run-check {
  width: 100%; padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sh-cta);
  transition: background 150ms, transform 150ms;
}
.hero-demo .run-check:hover { background: var(--brand-deep); transform: translateY(-1px); }
.hero-demo .run-check.passed { background: #16a34a; cursor: default; animation: none; }
.hero-demo .run-check.ready { animation: heroDeployReady 1.6s ease-in-out infinite; }
.hero-demo .run-check.signup-cta { background: #16a34a; }
.hero-demo .run-check.signup-cta:hover { background: #15803d; }

/* Full-demo CTA overlay - shown on solve and after repeated failed attempts.
   Covers the entire demo and routes the next action to signup. */
.hero-demo { position: relative; }
.hero-demo-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  border-radius: inherit;
}
.hero-demo-overlay.show { opacity: 1; pointer-events: auto; }
.hero-demo-overlay-inner { text-align: center; max-width: 440px; padding: 28px; }
.hero-demo-overlay-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
}
.hero-demo-overlay-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-mid);
  margin-bottom: 22px;
}
.hero-demo-overlay-cta {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.hero-demo-overlay-cta:hover { background: var(--brand-deep); transform: translateY(-1px); }
.hero-demo-overlay-micro { margin-top: 14px; font-size: 12.5px; color: var(--text-mid); }
@keyframes heroDeployReady {
  0%, 100% { box-shadow: 0 6px 18px rgba(249,115,22,0.30), inset 0 1px 0 rgba(255,255,255,0.20); }
  50%      { box-shadow: 0 6px 24px rgba(249,115,22,0.60), inset 0 1px 0 rgba(255,255,255,0.20); }
}

/* Chat */
.hero-demo .ch { display: flex; flex-direction: column; min-height: 0; background: var(--bg-soft); border-left: 1px solid var(--border); }
.hero-demo .ch-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-mid);
  font-size: 12px;
  background: var(--bg-tint);
}
.hero-demo .ch-channel { color: var(--text); font-family: var(--f-mono); font-weight: 600; }
.hero-demo .ch-alert {
  color: var(--brand);
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--brand-tint);
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.hero-demo .ch-msgs {
  flex: 1;
  padding: 14px;
  overflow: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.hero-demo .ch-msg { display: flex; gap: 10px; }
.hero-demo .ch-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--wf-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
  flex-shrink: 0;
}
.hero-demo .ch-msg.user .ch-avatar { background: var(--brand); }
.hero-demo .ch-msg-body { flex: 1; min-width: 0; }
.hero-demo .ch-msg-name { font-size: 12.5px; font-weight: 700; color: var(--text); }
.hero-demo .ch-msg-name .meta { color: var(--text-low); font-weight: 400; font-size: 11px; margin-left: 6px; }
.hero-demo .ch-msg-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
  margin-top: 3px;
}
.hero-demo .ch-msg-text code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--wf-accent-deep);
}
.hero-demo .ch-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border-mid);
  background: var(--bg-tint);
}
.hero-demo .ch-input {
  display: flex; gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
}
.hero-demo .ch-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 13.5px;
  padding: 0 6px;
}
.hero-demo .ch-input input::placeholder { color: var(--text-dim); }
.hero-demo .ch-send {
  width: 30px; height: 30px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: var(--sh-cta);
  cursor: pointer;
}
.hero-demo .ch-send:hover { background: var(--brand-deep); }

/* Typing indicator (inserted by JS) */
.hero-demo #typing { font-size: 12px; color: var(--text-low); padding: 4px 0; }

/* ============================================================================
   LIVE CHAT MESSAGES - .msg / .msg-av / .msg-body / .msg-meta / .msg-text
   These are the classes the demo JS actually outputs (see bubble() and
   avatarHtml() in homepage.js). Map them onto the wireframe chat look.
   ============================================================================ */
.hero-demo .msg {
  display: flex; gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.hero-demo .msg:last-child { margin-bottom: 0; }

/* Avatar - 30px circle. The senior avatar is an <img> (cartoon SVG); we
   render it inside a 30px circular mask so the face crops down rather than
   blowing up the whole chat. Initial-letter avatars use the same dimensions. */
.hero-demo .msg-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--wf-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.hero-demo .msg.me .msg-av { background: var(--brand); }
.hero-demo .msg.win .msg-av { background: #16a34a; }
/* When the avatar is an <img>, the JS puts BOTH .msg-av and .msg-av-img on
   the same element (no wrapping div), so .msg-av-img has to set its own size
   - otherwise width:100% of the .msg-av rule wouldn't apply to the img and
   defaults to the image's natural dimensions. */
.hero-demo .msg-av-img {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--wf-accent);
  object-fit: cover;
  object-position: center top;
  display: block;
  flex-shrink: 0;
}
.hero-demo .msg.me .msg-av-img { background: var(--brand); }
.hero-demo .msg.win .msg-av-img { background: #16a34a; }

.hero-demo .msg-body { flex: 1; min-width: 0; }
.hero-demo .msg-meta { font-size: 12.5px; line-height: 1.2; }
.hero-demo .msg-name { font-weight: 700; color: var(--text); }
.hero-demo .msg-role { color: var(--text-low); font-weight: 400; font-size: 11px; margin-left: 6px; }
.hero-demo .msg-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
  margin-top: 3px;
}
.hero-demo .msg-text code,
.hero-demo .msg-text .code-snip {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--wf-accent-deep);
  margin: 0 2px;
  vertical-align: baseline;
}
.hero-demo .msg-text.typing {
  color: var(--text-low);
  font-style: italic;
  font-size: 12.5px;
}

/* Input row uses .ch-input wrapper around #chInput, brand send button */
.hero-demo .ch-input.has-text .ch-send { box-shadow: 0 8px 24px var(--brand-glow); }

/* ============================================================================
   HERO CTA (below demo)
   ============================================================================ */
/* Wireframe has no CTA below the demo - it jumps straight to the ticket
   queue. Keep the elements in the DOM (the JS success-state flips #cta to
   .hero-cta-success on solve and updates #heroMicroLead), but hide them
   visually so the page matches the wireframe. */
.hero-cta-wrap { display: none; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 16px;
  padding: 16px 30px; border-radius: var(--r-md); text-decoration: none;
  box-shadow: var(--sh-cta);
  transition: background 150ms, box-shadow 150ms, transform 150ms;
}
.hero-cta:hover { background: var(--brand-deep); transform: translateY(-1px); box-shadow: 0 14px 32px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,0.25); color: #fff; }
.hero-cta-xl { font-size: 19px; padding: 18px 36px; }
.hero-cta-success { background: #16a34a; box-shadow: 0 6px 18px rgba(34,197,94,0.30); }
.hero-cta-success:hover { background: #15803d; }
.hero-micro { margin-top: 0.875rem; font-size: 14px; color: var(--text-mid); line-height: 1.55; }
.hero-micro-faint { color: var(--text-low); font-size: 13px; }

/* ============================================================================
   SECTION SHELL
   ============================================================================ */
.homepage-container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.section-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 14px;
}
.section-headline {
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--text);
  max-width: 720px;
  margin: 0 auto 14px;
}
.section-sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-mid);
  max-width: 620px;
  margin: 0 auto;
}

/* ============================================================================
   TICKET QUEUE
   ============================================================================ */
.ticket-queue {
  padding: 80px 0;
  background: var(--bg-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tq-inner { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.tq-head { text-align: center; margin-bottom: 36px; }

.tq-tabs {
  display: flex; gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tq-tab {
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 150ms;
  font-family: inherit;
}
.tq-tab:hover { color: var(--text); border-color: var(--role); }
.tq-tab.active {
  background: var(--role);
  border-color: var(--role);
  color: #fff;
}

/* Ticket-table subgrid - all rows share the parent grid's column tracks */
.tq-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-card);
  display: grid;
  /* Fixed column widths so role-switches don't reshape the table.
     With max-content, each role's longest title / longest stack-tag string
     defined the column width, so DevOps -> Backend -> Security visibly
     jumped sideways. Lock title + stack to values sized for the longest
     content across the whole catalog; longer entries ellipsize. */
  grid-template-columns:
    minmax(0, 1fr)  /* title - flexes to fill the row, ellipsis on overflow */
    6rem     /* role pill */
    5rem     /* level pill */
    16rem;   /* stack tags - fixed, mono shrinks gracefully */
  column-gap: 28px;
}
.tq-grid {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  padding: 14px 22px;
}
.tq-cols {
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-low);
}
.tq-cols .h-role,
.tq-cols .h-level { text-align: center; }
/* #tq-rows wraps the JS-rendered rows. display:contents makes its children
   direct grid children of .tq-table so the subgrid tracks apply to them. */
#tq-rows { display: contents; }
.tq-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
  text-decoration: none;
  color: inherit;
}
.tq-row:last-child { border-bottom: none; }
.tq-row:hover { background: var(--bg-soft); }
.tq-row:hover .tq-arrow { color: var(--brand); transform: translateX(2px); }
.tq-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tq-role {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--role);
  background: color-mix(in srgb, var(--role) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--role) 25%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  justify-self: center;
}
.tq-level {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  justify-self: center;
}
.tq-level.junior,
.tq-level.pp-junior { background: #DBEAFE; color: #1D4ED8; }
.tq-level.mid,
.tq-level.pp-mid    { background: #FED7AA; color: #9A3412; }
.tq-level.senior,
.tq-level.pp-senior { background: #FFE4E6; color: var(--problem); }
.tq-tags {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-low);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tq-arrow { color: var(--text-dim); font-size: 18px; transition: color 120ms, transform 120ms; justify-self: end; }
/* Legacy fallback in case JS renders the older "tq-id + tq-meta" markup */
.tq-id { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-low); font-weight: 700; }
.tq-empty { padding: 40px; text-align: center; color: var(--text-low); font-size: 14px; grid-column: 1 / -1; }

.tq-foot { text-align: center; margin-top: 28px; }
.tq-browse-all {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh-cta);
  transition: background 150ms, transform 150ms;
}
.tq-browse-all:hover { background: var(--brand-deep); transform: translateY(-1px); color: #fff; }
.tq-browse-all span { font-size: 1.125rem; }

/* ============================================================================
   TECH STRIP - the same stack you'll touch on day one
   ============================================================================ */
.tech-strip { padding: 56px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.tech-strip-inner { max-width: 1180px; margin: 0 auto; padding: 0 32px; text-align: center; }
.tech-strip-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: 22px;
}
.tech-strip-items {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 10px;
}
.tech-item {
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 6px 12px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mid);
}

/* ============================================================================
   PORTFOLIO GALLERY
   ============================================================================ */
.portfolio-gallery { padding: 80px 0; }
.pg-inner { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.pg-head { text-align: center; margin-bottom: 36px; }
.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-card);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 200ms, box-shadow 200ms, border-color 200ms;
  color: inherit;
  text-decoration: none;
}
.pg-card:hover { transform: translateY(-3px); box-shadow: var(--sh-card-hi); border-color: var(--border-mid); }
.pg-card:hover .pg-cta-row { color: var(--brand); }
.pg-card-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
}
.pg-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 17px;
}
.pg-card:nth-child(2) .pg-avatar { background: var(--wf-accent); }
.pg-card:nth-child(3) .pg-avatar { background: #6B7280; }
.pg-name { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.pg-url-line { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-low); margin-top: 2px; }
.pg-role-pill {
  align-self: start;
  display: inline-flex; align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--role);
  background: color-mix(in srgb, var(--role) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--role) 25%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
/* Compact stat line + GitHub-style activity heatmap on each card. */
.pg-stats {
  display: flex; gap: 22px;
  padding: 12px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.pg-stats > div { display: flex; flex-direction: column; }
.pg-stats b { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.2; }
.pg-stats span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-low); margin-top: 2px; }

.pg-activity { display: flex; flex-direction: column; gap: 6px; }
.pg-activity-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-low); font-weight: 700;
}
.pg-activity-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-auto-rows: 9px;
  gap: 3px;
}
.pg-cell {
  width: 100%; height: 9px; border-radius: 2px;
  background: #EBEDF0;            /* GitHub light empty-cell grey */
}
.pg-cell.l1 { background: rgba(34,197,94,0.30); }
.pg-cell.l2 { background: rgba(34,197,94,0.50); }
.pg-cell.l3 { background: rgba(34,197,94,0.72); }
.pg-cell.l4 { background: rgba(34,197,94,0.95); }

.pg-cta-arrow { transition: transform 150ms; display: inline-block; }
.pg-card:hover .pg-cta-arrow { transform: translateX(3px); }

.pg-recent { display: flex; flex-direction: column; gap: 6px; }
.pg-recent-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.4;
}
.pg-tid {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.pg-cta-row {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  transition: color 150ms;
}
/* Wireframe portfolio gallery has no extra "Start your portfolio" CTA
   under the cards - the CTA banner that follows is the closer. Hide. */
.pg-cta-block { display: none; }

/* "Mix DevOps, Backend, and Security fixes..." range line sits between the
   cards and the closer, making range explicit before the section ends. */
.pg-range-line {
  margin: 28px auto 0;
  max-width: 720px;
  text-align: center;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.55;
  padding: 0 32px;
}

/* ============================================================================
   EXAMPLE-PORTFOLIO LIGHTBOX - opens over the dimmed homepage when a gallery
   card is clicked. No navigation, no fetch; content rendered by homepage.js.
   ============================================================================ */
.pf-modal {
  position: fixed; inset: 0;
  z-index: 1000;               /* above the sticky nav (z-index 40) */
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.pf-modal.open { display: flex; }
.pf-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 13, 18, 0.55);
  backdrop-filter: blur(2px);
}
.pf-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);   /* dvh accounts for mobile browser chrome */
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(11, 13, 18, 0.35);
  overflow: hidden;
  animation: pf-pop 160ms ease-out;
}
@keyframes pf-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pf-modal-x {
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--bg-tint);
  font-size: 24px; line-height: 1;
  color: var(--text-mid);
  cursor: pointer; border-radius: 999px;
  transition: color 150ms, background 150ms;
}
.pf-modal-x:hover { color: var(--text); background: var(--bg-inset); }
/* Body renders the real /u portfolio markup (portfolio.css classes). */
.pf-modal-body { padding: 28px 26px 12px; overflow-y: auto; }
.pf-modal-body .portfolio-section { margin-bottom: 1.5rem; }
.pf-modal-body .portfolio-section:last-child { margin-bottom: 0; }
.pf-modal-body .portfolio-header { padding-bottom: 1.25rem; margin-bottom: 1.5rem; }

/* Sticky footer CTA */
.pf-modal-foot {
  border-top: 1px solid var(--border);
  padding: 16px 26px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: var(--bg-card);
}
.pf-modal-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: var(--r-md);
  text-decoration: none;
  transition: background 150ms, transform 150ms;
}
.pf-modal-cta:hover { background: var(--brand-deep); transform: translateY(-1px); }
.pf-modal-note { font-size: 12px; color: var(--text-low); text-align: center; }
/* Phones: near-full-screen sheet, bigger close target, tighter body padding. */
@media (max-width: 640px) {
  .pf-modal { padding: 10px; }
  .pf-modal-dialog { max-height: calc(100dvh - 20px); }
  .pf-modal-x { width: 38px; height: 38px; font-size: 26px; top: 8px; right: 8px; }
  .pf-modal-body { padding: 22px 18px 10px; }
}

/* Minimal three-dot section break - sits between the "AI killed" callout
   and the ticket queue. Brand-orange dots, center dot fully opaque, outer
   two slightly dimmed for a soft typographic rhythm. */
.section-break {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 0;
  background: var(--bg);
}
.section-break span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.5;
}
.section-break span:nth-child(2) { opacity: 1; transform: translateY(0); }

/* ============================================================================
   CALLOUT SECTIONS - between hero/queue ("AI killed") and between portfolio/
   quotes ("Checked, not self-reported"). Single column, centered, light or
   warm-orange wash variants.
   ============================================================================ */
.callout-section { padding: 72px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.callout-warm { background: var(--bg-warm); }
.callout-tint { background: var(--bg-tint); }
.callout-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.callout-inner .section-eyebrow { margin-bottom: 16px; }
.callout-headline {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
}
.callout-headline em { font-style: normal; color: var(--brand); }
.callout-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-mid);
  max-width: 640px;
  margin: 0 auto;
}

/* Featured variant - used by the "AI killed the side-project portfolio."
   line so it lands harder: bigger headline, more breathing room, a soft
   brand-tint glow behind the section, and orange emphasis on the verb. */
.callout-feature { padding: 104px 0; }
.callout-feature::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; height: 360px;
  background: radial-gradient(ellipse at center, var(--brand-tint), transparent 65%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.callout-feature .callout-headline {
  font-size: 52px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.callout-feature .callout-body { font-size: 18px; }

@media (max-width: 900px) {
  .callout-headline { font-size: 28px; }
  .callout-feature { padding: 72px 0; }
  .callout-feature .callout-headline { font-size: 36px; }
}
.hero-cta-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 14px 28px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--r-md);
  font-size: 17px; font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh-cta);
  transition: background 150ms, box-shadow 150ms, transform 150ms;
}
.hero-cta-btn:hover { background: var(--brand-deep); box-shadow: 0 0 24px var(--brand-glow); transform: translateY(-2px); color: #fff; }
.hero-microtext { font-size: 13px; color: var(--text-low); }

/* ============================================================================
   QUOTES
   ============================================================================ */
.quotes-section { padding: 80px 0; background: var(--bg-tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.quotes-inner { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 36px;
}
.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 22px;
  box-shadow: var(--sh-card);
}
.quote-stars { color: var(--brand); font-size: 13px; letter-spacing: 0.1em; margin-bottom: 10px; }
.quote-text { font-size: 15px; line-height: 1.55; color: var(--text); margin-bottom: 16px; }
.quote-author { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.quote-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.quote-card:nth-child(2) .quote-avatar { background: var(--wf-accent); }
.quote-card:nth-child(3) .quote-avatar { background: #6B7280; }
.quote-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.quote-title { font-size: 12px; color: var(--text-low); }

/* ============================================================================
   FAQ
   ============================================================================ */
.faq-section { padding: 80px 0; }
.faq-inner { max-width: 820px; margin: 0 auto; padding: 0 32px; }
.faq-list { margin-top: 36px; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
}
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-icon { font-size: 20px; color: var(--brand); font-weight: 800; transition: transform 200ms; }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-a {
  padding: 0 22px 18px;
  font-size: 14.5px;
  color: var(--text-mid);
  line-height: 1.6;
}
.faq-a code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}

/* ============================================================================
   CTA BANNER - warm orange wash
   ============================================================================ */
.cta-banner {
  background: var(--bg-warm);
  padding: 96px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-banner-inner { max-width: 720px; margin: 0 auto; padding: 0 32px; }
.cta-banner-headline {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}
.cta-banner-sub {
  font-size: 17px;
  color: var(--text-mid);
  max-width: 540px;
  margin: 0 auto 28px;
}
.cta-banner-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 30px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh-cta);
  transition: background 150ms, box-shadow 150ms, transform 150ms;
}
.cta-banner-btn:hover { background: var(--brand-deep); box-shadow: 0 14px 32px var(--brand-glow); transform: translateY(-1px); color: #fff; }
.cta-banner-note { display: block; margin-top: 14px; font-size: 13px; color: var(--text-low); }

/* ============================================================================
   FOOTER override on homepage - keep shared 4-col footer but recolor
   ============================================================================ */
.site-footer {
  background: var(--bg-tint);
  border-top: 1px solid var(--border);
  margin-top: 0;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .hero-headline { font-size: 36px; padding: 0 20px; }
  .hero-sub { padding: 0 20px; }
  .section-headline { font-size: 30px; }
  .cta-banner-headline { font-size: 32px; }

  /* Header: drop the big "Get started" button (the hero/demo CTAs cover signup);
     keep the compact "Sign in" link, no wrap. */
  .homepage-nav .btn-primary { display: none; }
  .homepage-nav .btn-ghost { white-space: nowrap; }

  /* Hero pointer: swap the arrowed one-liner for the two-line mobile version. */
  .hero-pointer { display: none; }
  .hero-pointer-mobile {
    display: block;
    font-size: 15px; font-weight: 600;
    color: var(--brand); line-height: 1.4;
    margin: 4px 0 0;
  }

  /* Demo: simplified - no chat, no title. (Pills already outside, see base.) */
  .hero-demo .ws-bar-name { display: none; }   /* drop "Cloud Workspace" title */
  .hero-demo .ch { display: none; }            /* hide the chat panel */
  .hero-demo .ws-body { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hero-demo .ed { border-right: none; border-bottom: none; }

  /* Keep every scenario inside the card - long lines WRAP instead of pushing the
     demo (and the Save & Deploy button) off screen. No left/right scroll. */
  .hero-demo { padding: 0 16px; }
  .hero-demo .ws, .hero-demo .ws-body, .hero-demo .ed { min-width: 0; }
  /* 16px prevents iOS Safari from auto-zooming when you tap into the editor.
     Tighter line-height keeps the taller text compact. */
  .hero-demo .ed-code-wrap { overflow-x: hidden; font-size: 16px; line-height: 1.5; }
  .hero-demo .ed-line { grid-template-columns: 36px minmax(0, 1fr); }
  .hero-demo .ed-ln { white-space: nowrap; }
  .hero-demo .ed-code { white-space: pre-wrap; overflow-wrap: break-word; }

  /* Overlay sized for mobile (covers the demo). */
  .hero-demo-overlay-inner { max-width: 100%; padding: 20px; }
  .hero-demo-overlay-title { font-size: 21px; margin-bottom: 8px; }
  .hero-demo-overlay-sub { font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
  .hero-demo-overlay-cta { font-size: 15px; padding: 11px 22px; }
  .hero-demo-overlay-micro { margin-top: 10px; font-size: 11.5px; }

  /* Save & Deploy result line (mobile has no chat to carry the feedback). */
  .demo-result.show {
    display: block;
    margin-top: 10px;
    font-size: 13px; line-height: 1.4;
    color: var(--problem);
  }
  .demo-incident {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-mid);
    background: var(--bg-tint);
  }
  .demo-incident b { color: var(--text); font-weight: 700; }

  .pg-grid, .quotes-grid { grid-template-columns: 1fr; }

  /* Ticket queue: card layout instead of a dead one-column table. Title wraps to
     its own row; level pill + stack flow below it. Role pill dropped (the active
     tab already says the role); the table header row is removed. */
  .tq-table { display: block; }
  .tq-cols { display: none; }
  .tq-row {
    display: flex; flex-wrap: wrap; align-items: center;
    column-gap: 10px; row-gap: 7px;
    padding: 14px 18px;
  }
  .tq-row .tq-title {
    flex: 0 0 100%;
    white-space: normal; overflow: visible;
    font-size: 15px; line-height: 1.35;
  }
  .tq-row .tq-role { display: none; }

  /* Mobile section trims (mobile-only; desktop keeps the full sections). */
  .tech-strip { display: none; }                              /* remove the logo strip */
  .pg-grid .pg-card:nth-child(n+2) { display: none; }         /* portfolio: 1 example */
  .quotes-grid .quote-card:nth-child(n+3) { display: none; }  /* testimonials: 2 */
  .faq-list .faq-item:nth-child(n+5) { display: none; }       /* FAQ: top 4 */
}

/* Phones - tighten the hero headline another step so the full line
   ("Finally, real production experience that gets you hired.") stays
   compact instead of running 4+ lines. */
@media (max-width: 480px) {
  .hero-headline { font-size: 30px; }
}
