/* Bruno Nardi — single-page story. New sections layered on site.css + tokens.
   Scoped under .st- so nothing here disturbs the existing pages. */

/* ============================================================ HERO ===== */
.st-hero { position: relative; z-index: 1; overflow: hidden; }
.st-hero__inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(86px, 13vh, 150px) var(--gutter) clamp(70px, 11vh, 120px);
}
.st-hero__spot {
  position: absolute; top: -160px; left: 50%; transform: translateX(-50%);
  width: min(880px, 120vw); height: 640px; pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 62%);
}
.st-hero__kicker { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.st-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(42px, 6vw, 82px); line-height: 1.03; letter-spacing: -0.035em;
  margin: 26px 0 0; color: var(--text); max-width: 16ch; text-wrap: balance;
}
.st-hero__dek {
  max-width: 600px; margin: 28px auto 0;
  font-family: var(--font-accent); font-style: italic;
  font-size: clamp(18px, 2vw, 22px); line-height: 1.55; color: var(--text-muted);
}
.st-dek-blue  { color: #6E92C4; font-style: italic; }
[data-theme="light"] .st-dek-blue { color: var(--blue-600); }
.st-dek-amber { color: var(--accent); font-style: italic; }
[data-theme="light"] .st-hero__dek { color: var(--text); }
.st-hero__eq { display: flex; align-items: flex-end; gap: 4px; height: 28px; margin-top: 44px; }
.st-hero__eq span {
  width: 5px; border-radius: 2px; background: var(--accent); transform-origin: bottom;
  animation: bd-eqa 1.1s var(--ease-in-out) infinite;
}
@media (prefers-reduced-motion: reduce) { .st-hero__eq span { animation: none; transform: scaleY(0.6); } }
/* scroll cue */
.st-scrollcue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 52px; color: var(--text-subtle); text-decoration: none;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease-out);
}
.st-scrollcue:hover { color: var(--accent); }
.st-scrollcue svg { animation: st-bob 2s var(--ease-in-out) infinite; }
@keyframes st-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .st-scrollcue svg { animation: none; } }

/* hero CTA — inline rail into the two live demos */
.st-herocta { margin-top: 44px; display: flex; flex-direction: column; align-items: center; }
.st-herocta__kick {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-subtle); margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 9px;
}
.st-herocta__kick::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.st-rail {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm);
}
.st-rail__link {
  display: flex; align-items: center; gap: 12px; padding: 16px 22px;
  text-decoration: none; color: var(--text); min-width: 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.st-rail__link:hover { background: var(--surface-inset); }
.st-rail__link + .st-rail__link { border-left: 1px solid var(--border); }
.st-rail__ico {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-inset); color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.st-rail__link:hover .st-rail__ico { color: var(--accent); }
.st-rail__txt { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.st-rail__lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-subtle);
}
.st-rail__name {
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  letter-spacing: -0.01em; line-height: 1;
}
.st-rail__go { color: var(--text-subtle); transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.st-rail__link:hover .st-rail__go { color: var(--accent); transform: translate(2px, -2px); }
.st-herocta__more {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--text-subtle); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.st-herocta__more:hover { color: var(--text-muted); }
@media (max-width: 560px) {
  .st-rail { flex-direction: column; width: 100%; max-width: 340px; }
  .st-rail__link { padding: 15px 18px; }
  .st-rail__link + .st-rail__link { border-left: none; border-top: 1px solid var(--border); }
  .st-rail__go { margin-left: auto; }
}

/* ====================================================== EXPERIENCE ===== */
/* expandable role card sits on top of the existing .bd-role + .tl timeline */
.st-role { transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.st-role.is-open { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.st-role.is-open.bd-role--accent { border-top-color: var(--accent); }

/* clickable header row */
.st-role__bar {
  display: flex; align-items: center; gap: 16px; width: 100%;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
}
.st-role__toggle {
  margin-left: auto; flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-md);
  display: grid; place-items: center; color: var(--text-subtle);
  border: 1px solid var(--border); background: var(--surface-sunken);
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.st-role__bar:hover .st-role__toggle { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.st-role.is-open .st-role__toggle { transform: rotate(180deg); color: var(--accent); }
.st-role__when { text-align: right; flex-shrink: 0; }
/* Mobile: the role header bar is too narrow for a fixed, no-wrap date column —
   it was forcing every card wider than the viewport (cards clipped at the edge,
   reading as "no padding"). Let the bar wrap the date onto its own line. */
@media (max-width: 560px) {
  .st-role .st-role__bar { flex-wrap: wrap; }
  .st-role .bd-role__id { min-width: 0; }
  .st-role .bd-role__when {
    order: 1; flex-basis: 100%; text-align: left;
    margin-top: 12px; padding-left: 68px;
  }
  .st-role .bd-role__period, .st-role .bd-role__loc { white-space: normal; }
}

/* always-visible summary */
.st-role__summary { font-family: var(--font-body); font-size: 15.5px; line-height: 1.6; color: var(--text-muted); margin: 16px 0 0; }

/* the expanding detail region (grid-rows animation = smooth height) */
.st-role__detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow, .36s) var(--ease-out); }
.st-role.is-open .st-role__detail { grid-template-rows: 1fr; }
.st-role__detailclip { overflow: hidden; min-height: 0; }
.st-role__detailinner { padding-top: 18px; }
.st-role__hl { display: flex; flex-direction: column; gap: 9px; margin: 0 0 16px; padding: 0; list-style: none; }
.st-role__hl li { display: flex; gap: 10px; font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--text); }
.st-role__hl svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }
/* tags always visible under the summary */
.st-role__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.st-role__tag { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-inset); border: 1px solid var(--border); color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .st-role__detail { transition: none; } }

/* ---- Mobile spacing polish (story page) ------------------------------- */
@media (max-width: 600px) {
  .st-role.bd-role { padding: 20px 18px; }
  .tl__row { min-width: 0; }
  .st-hero__inner { padding: clamp(70px, 11vh, 110px) var(--gutter) 56px; }
  .edu-card { padding: 20px; gap: 14px; }
  .edu-flow { padding-left: 22px; }
  .edu-flow > *::before { left: -19px; }
  .bd-ai { padding: 24px 20px; }
}
/* keep the Dev Demo schematic from tipping past the viewport on small phones */
.st-svc, .st-infra { min-width: 0; }
@media (max-width: 360px) {
  .st-svcgrid, .st-infragrid { grid-template-columns: 1fr; }
}

.st-exp-hint { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--text-subtle); display: inline-flex; align-items: center; gap: 8px; }
.st-exp-hint svg { color: var(--accent); }

/* expand/collapse-all control */
.st-expandall {
  appearance: none; cursor: pointer; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.04em; color: var(--text-subtle); background: none; border: none;
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 2px;
  transition: color var(--dur-fast) var(--ease-out);
}
.st-expandall:hover { color: var(--accent); }

/* ===================================================== DEV DEMO ======== */
.st-demo { position: relative; z-index: 1; border-top: 1px solid var(--border); overflow: hidden;
  background: radial-gradient(120% 120% at 88% 0%, var(--accent-soft), transparent 50%), var(--surface-sunken); }
.st-demo__inner { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 60px; align-items: center; }
.st-demo__copy { max-width: 540px; }
.st-demo h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4vw, 50px); line-height: 1.06; letter-spacing: -0.03em; margin: 16px 0 0; color: var(--text); text-wrap: balance; }
.st-demo h2 em { font-family: var(--font-accent); font-style: italic; font-weight: 500; color: var(--accent); }
.st-demo__body { margin-top: 22px; max-width: 500px; }
.st-demo__signin { display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }
.st-demo__signin .ic { color: var(--accent); display: inline-flex; }
.st-demo__cta { margin-top: 30px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* architecture schematic card (reused idea from explorations) */
.st-arch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); overflow: hidden; position: relative; }
.st-arch::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 55% at 86% 6%, var(--accent-soft), transparent 60%); }
.st-arch__bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.st-arch__bar i { width: 10px; height: 10px; border-radius: 50%; }
.st-arch__bar i:nth-child(1) { background: #C46A5A; }
.st-arch__bar i:nth-child(2) { background: #C9A45C; }
.st-arch__bar i:nth-child(3) { background: #5a9a6f; }
.st-arch__file { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }
.st-arch__live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.st-arch__live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: bd-pulse 2.4s var(--ease-out) infinite; }
.st-arch__body { padding: 26px 22px 30px; position: relative; display: flex; flex-direction: column; align-items: center; }
.st-tier { display: flex; justify-content: center; gap: 12px; }
.st-node { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.st-node .ic { color: var(--text-subtle); display: inline-flex; }
.st-node--wide { width: 100%; max-width: 300px; justify-content: center; }
.st-node em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-subtle); margin-left: 4px; padding-left: 8px; border-left: 1px solid var(--border); }
.st-node--accent { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--text); box-shadow: 0 0 0 1px var(--accent-soft); }
.st-node--accent .ic { color: var(--accent); }
.st-wire { width: 1px; height: 18px; background: var(--border-strong); margin: 9px auto; }

/* client-side tags under the web app node */
.st-apptags { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.st-tagchip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-subtle); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 9px; }
.st-tagchip svg { color: var(--accent); }

/* the Container Apps group box */
.st-archgroup { width: 100%; position: relative; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 16px 14px 14px; }
.st-archgroup__lbl { position: absolute; top: -9px; left: 14px; display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); background: var(--surface); padding: 0 7px; }
.st-archgroup__lbl svg { color: var(--text-subtle); }
.st-svcgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-svc { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.st-svc__lead { display: inline-flex; align-items: center; gap: 8px; }
.st-svc .ic { color: var(--text-subtle); display: inline-flex; }
.st-svc__db { color: var(--text-faint); flex-shrink: 0; }
.st-svc--accent { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--text); box-shadow: 0 0 0 1px var(--accent-soft); }
.st-svc--accent .ic { color: var(--accent); }

/* per-group caption */
.st-archnote { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 11px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em; color: var(--text-subtle); }
.st-archnote svg { color: var(--text-faint); }

/* cloud-infrastructure chips */
.st-infragrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-infra { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.st-infra .ic { color: var(--text-subtle); display: inline-flex; flex-shrink: 0; }
.st-infra__txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.st-infra__txt b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text); }
.st-infra__txt i { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-subtle); }
@media (max-width: 860px) {
  .st-demo__inner { grid-template-columns: 1fr; gap: 40px; }
}

/* preferred-technology chip — the default tools, lit with the amber accent */
.bd-chip--pref {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--text);
}

/* ================================================== BOT ARENA / LAB === */
/* Mirrors the Dev Demo finale, flipped: ML schematic on the left, copy on the
   right, on the default field (so it alternates with the sunken Dev Demo). */
.st-lab { position: relative; z-index: 1; border-top: 1px solid var(--border); overflow: hidden;
  background: radial-gradient(120% 120% at 12% 0%, var(--accent-soft), transparent 50%), var(--bg); }
.st-lab__inner { display: grid; grid-template-columns: 0.98fr 1.02fr; gap: 60px; align-items: center; }
.st-lab__copy { max-width: 540px; }
.st-lab__card { align-self: stretch; }
@media (max-width: 860px) {
  .st-lab__inner { grid-template-columns: 1fr; gap: 40px; }
  .st-lab__card { order: 2; }
  .st-lab__copy { order: 1; }
}

/* loop / repeat marker note */
.st-loopnote { color: var(--accent); }
.st-loopnote svg { color: var(--accent); }

/* ELO ladder in the card footer — the heuristic vs the trained policy */
.st-lab__foot { position: relative; display: flex; flex-direction: column; gap: 13px;
  padding: 16px 20px 18px; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.st-elobot { display: grid; grid-template-columns: minmax(0,1fr) 1.15fr auto; align-items: center; gap: 13px; }
.st-elobot__nm { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-elobot__nm em { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-subtle); margin-left: 7px; }
.st-elobar { height: 6px; border-radius: 99px; background: var(--surface-inset); border: 1px solid var(--border); overflow: hidden; }
.st-elobar > span { display: block; height: 100%; border-radius: 99px; background: var(--text-faint); }
.st-elobar--accent > span { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.st-elobot__elo { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); display: inline-flex; align-items: baseline; gap: 5px; }
.st-elobot__elo small { font-family: var(--font-mono); font-weight: 500; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-subtle); }
.st-elobot--top .st-elobot__elo { color: var(--accent); }

/* ==================================================== SECTION FLOW ===== */
.bd-nav__link { white-space: nowrap; }
.st-exp { scroll-margin-top: 84px; }
.st-edu { scroll-margin-top: 84px; }
/* on the single-page story, drop the contact section to the default field so
   the rhythm alternates: experience(bg) · education(sunken) · contact(bg) · demo(sunken).
   (story.css is only linked by the single-page Story.html, so this is safe.) */
.bd-contact { background: transparent; }
