/* Hefesto site design system: tokens, layout, components.
   Motion lives in motion.css; behaviour in /js/main.js. */

@font-face { font-family: "Grotesk"; src: url(../fonts/AkzidenzGrotesk-Regular.otf) format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url(../fonts/AkzidenzGrotesk-Medium.otf) format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url(../fonts/AkzidenzGrotesk-Bold.otf) format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #050505;
  --bg-2: #0e0e0f;
  --bg-3: #161618;
  --ember: #f26b38;
  --ember-hot: #ff8a57;
  --ember-deep: #a65e29;
  --ember-line: rgba(242, 107, 56, .55);
  --text: #e6e9ef;
  --muted: #a9b4b6;
  --steel: #c2cecf;
  --ember-ink: var(--ember);            /* orange used as TEXT (darker in the light theme for AA) */
  --line: var(--line);         /* hairlines, card borders */
  --line-strong: var(--line-strong);  /* inputs, ghost buttons */
  --scrim: var(--scrim);              /* fades over parallax images */
  --window-bg: linear-gradient(180deg, rgba(22,22,24,.92), rgba(10,10,11,.92));
  --menu-bg: rgba(5, 5, 5, .97);
  --nav-scrolled: rgba(5, 5, 5, .72);
  --shadow: rgba(0,0,0,.9);
  --error: #ff9b7a;
  --error-line: #ff7a55;
  --radius: 2px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --nav-h: 72px;
  --font: "Grotesk", "Helvetica Neue", Arial, sans-serif;
  --step--1: clamp(.85rem, .82rem + .15vw, .95rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + .5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --step-4: clamp(2.6rem, 1.4rem + 5.2vw, 5.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.04; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -.01em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
::selection { background: var(--ember); color: #000; }

.skip-link { position: absolute; left: 12px; top: 12px; transform: translateY(-200%); z-index: 100; padding: 10px 16px; background: var(--ember); color: #000; font-weight: 700; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--ember-ink); font-size: var(--step--1); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--steel); max-width: 38ch; }
.accent { color: var(--ember-ink); }

/* ---------- Navigation ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); display: flex; align-items: center; border-bottom: 1px solid transparent; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; }
.nav__brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .9rem; }
.nav__brand img { width: 36px; height: 36px; }
.nav__links { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nav__link { position: relative; display: inline-block; padding: 8px 12px; color: var(--steel); font-size: .95rem; }
.nav__link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--ember); transform: scaleX(0); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"]::after { box-shadow: 0 0 12px var(--ember); }
.nav__cta { margin-left: 10px; }
.nav__toggle { display: none; position: relative; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid var(--ember-line); cursor: pointer; }
.nav__toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); }
.nav__toggle span:nth-child(1) { top: 15px; }
.nav__toggle span:nth-child(2) { top: 21px; }
.nav__toggle span:nth-child(3) { top: 27px; }

@media (max-width: 899px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed; inset: var(--nav-h) 0 0; z-index: 49;
    display: flex; flex-direction: column; justify-content: center; gap: 28px;
    padding: 0 var(--gutter) 15vh; background: var(--menu-bg);
    visibility: hidden; opacity: 0;
  }
  .nav__menu.is-open { visibility: visible; opacity: 1; }
  .nav__links { flex-direction: column; gap: 4px; }
  .nav__link { font-size: var(--step-2); font-weight: 700; padding: 6px 0; }
  .nav__link::after { left: 0; right: auto; width: 48px; }
  .nav__cta { margin: 0; align-self: flex-start; }
}
@media (min-width: 900px) { .nav__menu { display: flex; align-items: center; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px;
  border: 1px solid var(--ember); border-radius: var(--radius);
  background: transparent; color: var(--text);
  font-weight: 700; font-size: .98rem; letter-spacing: .02em; line-height: 1;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ember); transform: scaleX(0); transform-origin: left; }
.btn:hover, .btn:focus-visible { color: #0a0a0a; }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn__arrow { width: 18px; height: 18px; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--primary { background: var(--ember); color: #0a0a0a; }
.btn--primary::before { background: linear-gradient(100deg, var(--ember-hot), #ffd2a1 55%, var(--ember-hot)); }
.btn--primary:hover { box-shadow: 0 0 0 1px var(--ember-hot), 0 10px 40px -8px rgba(255, 138, 87, .65); }
.btn--ghost { border-color: var(--line-strong); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* ---------- Sections ---------- */
main { display: block; }
.section { position: relative; padding: clamp(72px, 11vw, 140px) 0; overflow: hidden; }
.section--tight { padding: clamp(56px, 7vw, 96px) 0; }
.section__head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section__head p { margin-top: 18px; }
.split { display: grid; gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 6fr; } }
.split p { font-size: var(--step-1); line-height: 1.55; }
.marker { display: block; width: 64px; height: 4px; margin-top: 28px; background: var(--ember); }

/* Background layer used for parallax images */
.bg-layer { position: absolute; inset: -18% 0; z-index: -1; background-size: cover; background-position: center; pointer-events: none; }
.bg-layer--pattern { inset: auto 0 -10% 0; height: 70%; background-size: 1200px auto; background-repeat: repeat-x; background-position: center bottom; opacity: .35; }
.bg-layer--fade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, var(--scrim) 30%, var(--scrim) 70%, var(--bg) 100%); }

/* ---------- Hero (home) ---------- */
.hero, .page-hero { position: relative; isolation: isolate; }
.hero > .container, .page-hero > .container { position: relative; z-index: 1; }
.hero__fire { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.hero { min-height: min(100svh, 920px); display: flex; align-items: center; padding: calc(var(--nav-h) + 32px) 0 72px; }
.hero__grid { display: grid; gap: 40px; align-items: center; width: 100%; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { max-width: 12ch; }
.hero__lead { margin-top: 26px; }
.forge { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 620px; margin-inline: auto; }
.forge__glow { position: absolute; inset: 18% 12% 6%; z-index: -1; background: radial-gradient(closest-side, rgba(242,107,56,.38), rgba(242,107,56,0) 70%); filter: blur(8px); }
.forge-poster, .forge-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.forge-poster { object-fit: contain; }
.forge-canvas { cursor: grab; touch-action: pan-y; }
.forge.is-grabbing .forge-canvas { cursor: grabbing; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; }
.scroll-cue__line { width: 1px; height: 42px; background: linear-gradient(var(--ember), transparent); }
@media (max-width: 899px) { .scroll-cue { display: none; } .forge { max-width: 420px; } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: calc(var(--nav-h) + clamp(40px, 8vw, 96px)) 0 clamp(56px, 7vw, 96px); }
.page-hero + .section--tight { padding-top: clamp(8px, 2vw, 24px); }

/* ---------- Window cards ---------- */
.windows { display: grid; gap: clamp(18px, 2.4vw, 28px); }
@media (min-width: 768px) {
  .windows--3 { grid-template-columns: repeat(3, 1fr); }
  .windows--hero { grid-template-columns: repeat(12, 1fr); grid-auto-rows: auto; }
  .windows--hero > :nth-child(1) { grid-column: 1 / span 7; }
  /* staggered "desktop of windows": columns overlap, rows don't, so cards never cover each other */
  .windows--hero > :nth-child(2) { grid-column: 6 / span 7; }
  .windows--hero > :nth-child(3) { grid-column: 2 / span 10; }
}
.window {
  position: relative; display: flex; flex-direction: column;
  background: var(--window-bg);
  border: 1px solid var(--ember-line); border-radius: var(--radius);
  box-shadow: 0 20px 60px -30px var(--shadow);
  transform-style: preserve-3d;
}
.window[hidden] { display: none; }
.window__bar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--ember-line); }
.window__title { flex: 1; color: var(--muted); font-size: .8rem; letter-spacing: .08em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.window__min, .window__close {
  display: grid; place-items: center; width: 32px; height: 28px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ember-ink); font-size: 1rem; line-height: 1; cursor: pointer;
}
.window__min:hover, .window__close:hover { border-color: var(--ember-line); background: rgba(242,107,56,.12); }
.window__close:hover { background: var(--ember); color: #000; }
.window__body { padding: clamp(22px, 3vw, 40px); overflow: hidden; }
.window__body > :last-child { margin-bottom: 0; }
.window__body h1 { font-size: var(--step-4); }
.window__body h2 { font-size: var(--step-2); display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.window__body h2 img { width: 44px; height: auto; }
.window__media { padding: 0; min-height: 260px; background-size: cover; background-position: center; }
.window.is-minimized .window__bar { border-bottom-color: transparent; }
.window:hover .window__bar { background: linear-gradient(90deg, rgba(242,107,56,.14), transparent 70%); }

/* ---------- Service cards (tilt) ---------- */
.cards { display: grid; gap: clamp(18px, 2.4vw, 28px); perspective: 1200px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px; height: 100%;
  padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(160deg, var(--bg-3), var(--bg-2));
  border: 1px solid rgba(242,107,56,.28); border-radius: var(--radius);
  transform-style: preserve-3d; will-change: transform;
}
.card__icon { width: 56px; height: 56px; color: var(--ember); transform: translateZ(40px); }
.card h3 { transform: translateZ(30px); }
.card p { transform: translateZ(18px); margin: 0; }
.card__link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ember-ink); font-weight: 700; transform: translateZ(24px); }
.card__glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255,138,87,.22), transparent 55%); opacity: 0; }
.card:hover { border-color: var(--ember); }
.card:hover .card__glare { opacity: 1; }

/* ---------- Process timeline: a mold channel filled with molten metal ---------- */
.process { --fill: 0; --rail-x: 20px; position: relative; display: grid; gap: 28px; margin: 0; padding: 0 0 0 56px; list-style: none; }
.process__rail, .process__fill, .process__spill, .process__spill-fill { position: absolute; width: 8px; border-radius: 4px; }
.process__rail, .process__spill { background: #0b0705; box-shadow: inset 0 0 0 1px rgba(242,107,56,.16), inset 0 3px 8px #000, 0 0 0 3px rgba(0,0,0,.5); }
.process__rail { left: calc(var(--rail-x) - 4px); top: 8px; bottom: 8px; }
/* molten metal: white-hot at the pour front, cooling to deep red behind it */
.molten {
  background:
    repeating-linear-gradient(180deg, rgba(255,240,200,.0) 0 14px, rgba(255,240,200,.28) 18px, rgba(255,240,200,0) 26px),
    linear-gradient(180deg, #6e1604 0%, #b52f08 35%, #f0561a 70%, #ffae4a 90%, #fff3d0 100%);
  box-shadow: 0 0 8px #ff5a14, 0 0 22px rgba(255,90,20,.55), 0 0 48px rgba(255,90,20,.25);
}
.process__fill { left: calc(var(--rail-x) - 4px); top: 8px; height: calc(var(--fill) * (100% - 16px)); }
.process__head {
  position: absolute; left: var(--rail-x); top: calc(8px + var(--fill) * (100% - 16px)); z-index: 2;
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fffbe9 0 20%, #ffd27a 38%, rgba(255,120,30,.75) 58%, rgba(255,80,20,0) 72%);
  opacity: 0;
}
.process.is-flowing .process__head { opacity: 1; }
.step { position: relative; display: grid; gap: 6px; padding: 22px 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
/* number badge = mold cavity; .step__metal floods it from the bottom */
.step__num {
  position: absolute; left: -56px; top: 18px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden;
  border: 2px solid rgba(242,107,56,.28); border-radius: 50%; background: #0b0705; color: var(--muted); font-weight: 700;
  box-shadow: inset 0 3px 8px #000;
}
.step__metal { position: absolute; inset: 0; border-radius: 50%; transform: scaleY(0); transform-origin: bottom;
  background: radial-gradient(circle at 50% 40%, #fff3d0 0 18%, #ffb24f 42%, #f0561a 72%, #9c2606 100%); }
.step__n { position: relative; }
.step.is-lit { border-color: rgba(242,107,56,.45); }
.step__num.is-molten { border-color: #ff8a3d; color: #1a0802; box-shadow: 0 0 0 5px rgba(242,107,56,.14), 0 0 22px #ff6a1f; }
.step__num.is-molten .step__metal { transform: scaleY(1); }
.step h3 { display: flex; align-items: center; gap: 12px; }
.step__icon { width: 28px; height: 28px; flex: none; color: var(--ember); }
.step p { margin: 0; }
@media (min-width: 900px) {
  .process { grid-template-columns: 1fr 1fr; column-gap: 28px; padding-left: 0; --rail-x: 50%; }
  /* every number sits centred on the rail: half the column gap + half the badge */
  .step__num { left: auto; right: -34px; }
  .step:nth-child(odd of .step) { grid-column: 1; }
  .step:nth-child(even of .step) { grid-column: 2; margin-top: 64px; }
  .step:nth-child(even of .step) .step__num { right: auto; left: -34px; }
}
/* the pour keeps going below the list, down to the next section */
.process__spill { --spill: 0; z-index: 1; pointer-events: none; }
.process__spill-fill { left: 0; top: 0; height: calc(var(--spill) * 100%); }
/* hot seam where the stream lands: spreads sideways along a groove, flashes, then cools */
.heat-seam { --seam-x: 50%; position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: 4px; pointer-events: none; }
.heat-seam::before { content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: var(--seam-x) 50%;
  background: linear-gradient(90deg, transparent, #b52f08 12%, #f0561a 30%, #fff3d0 50%, #f0561a 70%, #b52f08 88%, transparent);
  box-shadow: 0 0 12px #ff5a14, 0 0 30px rgba(255,90,20,.5); }
.heat-seam::after { content: ""; position: absolute; left: calc(var(--seam-x) - 280px); top: -40px; width: 560px; height: 260px; opacity: 0;
  background: radial-gradient(ellipse at 50% 15%, rgba(255,140,50,.45), rgba(255,90,20,.12) 40%, transparent 70%); }
.is-heated > .heat-seam::before { transform: scaleX(1); }
.is-heated > .heat-seam::after { opacity: .35; }

/* ---------- Forge divider (hammer + anvil) ---------- */
.forge-divider { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: min(100%, 560px); height: 340px; margin: 0 auto; padding-bottom: 40px; color: var(--ember); cursor: pointer; }
.forge-divider__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.forge-divider__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.forge-divider.is-live > .forge-divider__poster { opacity: 0; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 16ch; margin: 0 auto; }
.cta-band .btn-row { justify-content: center; }

/* Next page teaser */
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 40px; border-top: 1px solid var(--line); }
.next__label { display: block; color: var(--muted); font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }

/* ---------- Contact ---------- */
.contact { display: grid; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 900px) { .contact { grid-template-columns: 5fr 6fr; } }
.contact-info { display: grid; gap: 14px; margin: 32px 0 0; padding: 0; list-style: none; }
.contact-info li { display: flex; align-items: center; gap: 14px; }
.contact-info svg { width: 20px; height: 20px; color: var(--ember); flex: none; }
.copy-btn { margin-left: auto; padding: 6px 10px; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: .8rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--ember); color: var(--text); }
.contact-photo { position: relative; margin-top: 40px; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--ember-line); }
.contact-photo img { width: 100%; height: 118%; object-fit: cover; }

.contact-form { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; align-content: start; }
.field { position: relative; grid-column: span 2; }
.field--half { grid-column: span 1; }
@media (max-width: 520px) { .field--half { grid-column: span 2; } }
.field input, .field textarea {
  width: 100%; padding: 26px 0 10px; background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  color: var(--text); font: inherit; outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field label { position: absolute; left: 0; top: 24px; color: var(--muted); pointer-events: none; transform-origin: left top; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-20px) scale(.78); color: var(--ember-ink); }
.field__line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--ember), var(--ember-hot)); transform: scaleX(0); transform-origin: left; }
.field input:focus ~ .field__line, .field textarea:focus ~ .field__line { transform: scaleX(1); }
.field__error { display: block; min-height: 1.2em; margin-top: 6px; color: var(--error); font-size: .82rem; }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: var(--error-line); }
.field.is-valid input, .field.is-valid textarea { border-bottom-color: rgba(242,107,56,.7); }
.form-legend { grid-column: span 2; margin: 0; color: var(--muted); font-size: .85rem; }
.form-actions { grid-column: span 2; display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.form-status { color: var(--muted); font-size: .9rem; }
.btn__spinner, .btn__check { display: none; width: 18px; height: 18px; }
.contact-form[data-state="sending"] .btn__spinner { display: block; }
.contact-form[data-state="sending"] .btn__label-text { opacity: .7; }
.contact-form[data-state="sent"] > :not(.contact-sent) { visibility: hidden; }
.contact-sent {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  padding: 32px; background: var(--bg-2); border: 1px solid var(--ember); border-radius: var(--radius);
}
.contact-form[data-state="sent"] .contact-sent, .contact-sent.is-static { display: flex; }
.contact-sent.is-static { position: relative; margin-bottom: 24px; }
.contact-sent h2 { font-size: var(--step-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; translate: -50% 0;
  display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 18px;
  background: var(--bg-3); border: 1px solid var(--ember-line); border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px #000;
}
.toast button { padding: 8px 14px; background: var(--ember); border: 0; border-radius: var(--radius); color: #000; font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer__band { padding: 14px 0; background: linear-gradient(90deg, var(--ember-deep), #7c4320); }
.footer__band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer__band p { margin: 0; color: #fff; font-weight: 500; }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.social a:hover { background: rgba(0,0,0,.25); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; }
.footer__grid { display: grid; gap: 32px; padding-block: 56px 40px; } /* block only: keep the container's side gutters */
@media (min-width: 768px) { .footer__grid { grid-template-columns: 2fr 1fr 1.4fr; } }
.footer__brand img { width: 44px; margin-bottom: 14px; }
.footer__brand p { max-width: 28ch; }
.footer h2 { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.footer a { color: var(--steel); }
.footer a:hover { color: var(--ember-ink); }
.footer__legal { padding-block: 20px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer__legal p { margin: 0; }
.footer__founder a { color: var(--ember-ink); }
.contact-form:has(.contact-sent.is-static) > :not(.contact-sent) { display: none; }
.form-error { grid-column: span 2; margin: 0; padding: 12px 16px; border: 1px solid var(--error-line); color: var(--error); }

/* ---------- Hero 3D tiles (CSS 3D slabs, aligned to the stage corners) ---------- */
.forge { --tile: clamp(58px, 15%, 96px); --inset: 2%; }
.forge__tile { position: absolute; z-index: 2; width: var(--tile); height: var(--tile); }
.forge__tile--tl { top: var(--inset); left: var(--inset); }
.forge__tile--tr { top: var(--inset); right: var(--inset); }
.forge__tile--bl { bottom: var(--inset); left: var(--inset); }
.forge__tile--br { bottom: var(--inset); right: var(--inset); }
.tile3d { --d: 14px; --rx: 0deg; --ry: 0deg; --hx: 0deg; --hy: 0deg; width: 100%; height: 100%; perspective: 520px; cursor: default; }
.forge__tile--tl .tile3d { --rx: -14deg; --ry: 22deg; }
.forge__tile--tr .tile3d { --rx: -14deg; --ry: -22deg; }
.forge__tile--bl .tile3d { --rx: 14deg; --ry: 22deg; }
.forge__tile--br .tile3d { --rx: 14deg; --ry: -22deg; }
.tile3d__body { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0.01px); }
.tile3d__face {
  position: absolute; inset: 0; display: grid; place-items: center;
  transform: translateZ(calc(var(--d) / 2));
  background: radial-gradient(circle at 50% 30%, #2a140a, #0f0906 70%);
  border: 3px solid #d07a45; color: #e89766;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 600;
  box-shadow: inset 0 0 18px rgba(242, 107, 56, .18);
}
.tile3d__side { position: absolute; display: block; background: linear-gradient(180deg, #a4552a, #5b2c14); }
.tile3d__side--t { left: 0; top: calc(var(--d) / -2); width: 100%; height: var(--d); transform: rotateX(90deg); background: linear-gradient(90deg, #c06b3a, #8a4520); }
.tile3d__side--b { left: 0; top: calc(100% - var(--d) / 2); width: 100%; height: var(--d); transform: rotateX(-90deg); background: linear-gradient(90deg, #6b3317, #3d1b0b); }
.tile3d__side--l { top: 0; left: calc(var(--d) / -2); width: var(--d); height: 100%; transform: rotateY(-90deg); }
.tile3d__side--r { top: 0; left: calc(100% - var(--d) / 2); width: var(--d); height: 100%; transform: rotateY(90deg); background: linear-gradient(180deg, #7a3b1a, #4a220e); }
.tile3d__bits { font-size: clamp(9px, 1.1vw, 14px); line-height: 1.15; text-align: center; letter-spacing: .06em; }
.tile3d__jar, .tile3d__scroll, .tile3d__cursor { width: 62%; height: 62%; overflow: visible; }
.tile3d__jar .jar-liquid { transform: translateY(16px); color: #ff7a2f; }
.tile3d__jar .jar-ember { opacity: 0; }
.tile3d__jar { transform-box: view-box; transform-origin: 24px 43px; }
.tile3d__scroll .scroll-sheet { transform-box: fill-box; transform-origin: center; transform: scaleX(.3); }
.tile3d__scroll .scroll-roll--l { transform: translateX(8px); }
.tile3d__scroll .scroll-roll--r { transform: translateX(-8px); }
.tile3d__scroll .scroll-line { stroke-dasharray: 16; stroke-dashoffset: 16; stroke-width: 1.6; }
.tile3d__cursor .click-ring { opacity: 0; transform-origin: 17px 13px; }
.tile3d.is-hot .tile3d__face { border-color: #ffb27e; color: #ffd2a8; background: radial-gradient(circle at 50% 30%, #4a1e0a, #160b05 70%); box-shadow: inset 0 0 26px rgba(255, 138, 87, .45), 0 0 34px rgba(242, 107, 56, .55); }

.forge__hint { position: absolute; left: 50%; bottom: -6px; z-index: 2; translate: -50% 0; margin: 0; color: var(--muted); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; opacity: 0; pointer-events: none; }
.forge.is-live .forge__hint { opacity: 1; }
.forge.was-touched .forge__hint { opacity: 0; }

/* ---------- Contact page ---------- */
/* 3D Hefesto mark on the contact hero (still render until the live scene is ready) */
.page-hero__mark { --s: clamp(260px, 30vw, 460px); position: absolute; right: 4%; top: 50%; z-index: 1; width: var(--s); height: var(--s); margin-top: calc(var(--s) / -2 + var(--nav-h) / 2); }
.mark3d-poster, .mark3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark3d-poster { object-fit: contain; }
.mark3d-canvas { cursor: grab; touch-action: pan-y; }
.page-hero__mark.is-grabbing .mark3d-canvas { cursor: grabbing; }
@media (max-width: 1099px) { .page-hero__mark { opacity: .22; pointer-events: none; right: -8%; } }
.btn--whatsapp svg { width: 18px; height: 18px; }
.contact { align-items: start; }
.contact__aside { display: grid; gap: clamp(28px, 4vw, 44px); }
.contact__title { font-size: var(--step-1); margin-bottom: 8px; }
.window--static .window__bar { padding-right: 14px; }
.window__dots { display: flex; gap: 6px; }
.window__dots i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ember-line); }
.window__dots i:first-child { background: var(--ember); border-color: var(--ember); }
.contact-info { margin-top: 20px; }
.next-steps { position: relative; display: grid; gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; }
.next-steps::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--ember), rgba(242,107,56,.1)); }
.next-steps li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; }
.next-steps__num { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ember); color: var(--ember-ink); font-weight: 700; }
.next-steps h3 { font-size: 1.05rem; margin: 6px 0 4px; }
.next-steps p { margin: 0; font-size: .95rem; }
.contact-form { padding: 0; }
.chips { grid-column: span 2; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; padding: 0; border: 0; }
.chips legend { width: 100%; margin-bottom: 12px; color: var(--steel); font-weight: 500; }
.chip__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--steel); font-size: .92rem; cursor: pointer; user-select: none; }
.chip:hover { border-color: var(--ember); color: var(--text); }
.chip__input:checked + .chip { background: var(--ember); border-color: var(--ember); color: #0a0a0a; font-weight: 700; box-shadow: 0 0 22px -4px rgba(242,107,56,.7); }
.chip__input:focus-visible + .chip { outline: 2px solid var(--ember); outline-offset: 3px; }
.field__meta { display: flex; justify-content: space-between; gap: 12px; }
.field__counter { margin-top: 6px; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.field__counter.is-near { color: var(--ember-ink); }
.forge-progress { grid-column: span 2; display: none; height: 4px; overflow: hidden; background: rgba(242,107,56,.15); border-radius: 2px; }
.forge-progress span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, #a0300c, var(--ember), #ffd9a8, var(--ember), #a0300c); box-shadow: 0 0 16px var(--ember); }
.contact-form[data-state="sending"] .forge-progress { display: block; }
@media (min-width: 1100px) { .page-hero--contact h1 { max-width: 11ch; } .page-hero--contact .lead { max-width: 34ch; } }

/* ---------- Engineering practices ---------- */
.practices { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .practices { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .practices { grid-template-columns: repeat(3, 1fr); } }
.practice { position: relative; padding: 20px 22px 20px 26px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.practice::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--ember-hot), var(--ember-deep)); }
.practice h3 { font-size: 1.05rem; margin-bottom: 6px; }
.practice p { margin: 0; font-size: .94rem; }
.practice:hover { border-color: rgba(242,107,56,.5); }

/* ---------- Plans ---------- */
.plans { display: grid; gap: clamp(18px, 2.4vw, 28px); align-items: stretch; }
@media (min-width: 960px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: clamp(24px, 3vw, 34px); background: linear-gradient(170deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); }
.plan h3 { font-size: var(--step-2); }
.plan__tag { margin: 0; color: var(--ember-ink); font-weight: 700; letter-spacing: .04em; }
.plan__desc { margin: 0 0 8px; }
.plan__features { display: grid; gap: 10px; margin: 6px 0 24px; padding: 0; list-style: none; }
.plan__features li { position: relative; padding-left: 26px; color: var(--steel); font-size: .95rem; line-height: 1.45; }
.plan__features li::before { content: ""; position: absolute; left: 0; top: .3em; width: 14px; height: 8px; border-left: 2px solid var(--ember); border-bottom: 2px solid var(--ember); transform: rotate(-45deg); }
.plan .btn { margin-top: auto; align-self: flex-start; }
.plan--featured { border-color: var(--ember); box-shadow: 0 0 0 1px rgba(242,107,56,.4), 0 30px 80px -40px rgba(242,107,56,.6); }
.plan__badge { position: absolute; top: -12px; right: 20px; padding: 4px 12px; background: var(--ember); color: #0a0a0a; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; }
.bg-layer--particles { opacity: 1; }
/* only fade the edges into the page; the middle stays clear so the embers read */
.bg-layer--particles::after { background: linear-gradient(180deg, var(--bg) 0%, transparent 16%, transparent 84%, var(--bg) 100%); }
.bg-layer--particles canvas { position: absolute; inset: 0; }

/* ---------- Loader frame (home) ---------- */
.page-loader { display: none; }
.is-loading .page-loader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #333333; }
.is-loading .page-loader img { width: auto; height: auto; max-width: 100vw; max-height: 100vh; }
.is-loaded .page-loader { opacity: 0; pointer-events: none; }

/* ---------- Responsive guards ---------- */
.hero, .page-hero { overflow-x: clip; }
@media (max-width: 767px) { .forge__hint { display: none; } }
@media (max-width: 1099px) { .page-hero__mark { right: 0; } }
/* an open menu must escape the scrolled bar's backdrop-filter (it would trap position: fixed) */
.nav.menu-open, .nav.is-scrolled.menu-open { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); transition: none; }

/* ---------- Engineering by agent area (three fronts, progressive disclosure) ---------- */
.agent-front { margin-top: clamp(40px, 5vw, 64px); }
.agent-front:first-of-type { margin-top: 0; }
.agent-front > h3 { display: flex; align-items: center; gap: 14px; font-size: var(--step-2); }
.agent-front > h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ember-line), transparent); }
.agent-front__lead { margin: 8px 0 20px; max-width: 60ch; }
.agent-areas { display: grid; gap: clamp(14px, 1.6vw, 20px); margin: 0; padding: 0; list-style: none; align-items: start; }
@media (min-width: 760px) { .agent-areas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .agent-areas--3 { grid-template-columns: repeat(3, 1fr); } .agent-areas--4 { grid-template-columns: repeat(4, 1fr); } }
.agent-area { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: clamp(18px, 2vw, 24px); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.agent-area::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--ember-hot), var(--ember-deep)); }
.agent-area__head { display: flex; align-items: center; gap: 12px; }
.agent-area__icon { width: 40px; height: 40px; flex: none; padding: 8px; border: 1px solid var(--ember-line); border-radius: 50%; color: var(--ember-ink); }
.agent-area__kicker { margin: 0; color: var(--muted); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.agent-area h4 { margin: 0; font-size: var(--step-1); line-height: 1.15; }
.agent-area__role { margin: 0; font-size: .95rem; }
.agent-area__specialists { margin: 0; color: var(--steel); font-size: .85rem; }
.agent-area__specialists span { color: var(--ember-ink); font-weight: 700; }
.agent-area__rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.agent-area .practice { padding: 10px 12px 10px 14px; background: transparent; }
.agent-area .practice h5 { margin: 0 0 4px; font-size: .98rem; line-height: 1.25; color: var(--text); }
.agent-area .practice p { font-size: .88rem; line-height: 1.5; }
.agent-area__more { margin-top: 2px; }
.agent-area__more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; color: var(--ember-ink); font-weight: 700; font-size: .92rem; cursor: pointer; list-style: none; }
.agent-area__more > summary::-webkit-details-marker { display: none; }
.agent-area__more > summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ember-line); border-radius: 50%; font-size: .9rem; line-height: 1; }
.agent-area__more[open] > summary::before { content: "−"; }
.agent-area__more > summary:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.agent-area__count { color: var(--muted); font-weight: 500; }
.agent-area__more[open] > summary .agent-area__count { display: none; }
.agent-area__more > .agent-area__rules { margin-top: 6px; }
.eng-loop-wrap { margin-top: clamp(40px, 5vw, 64px); padding: clamp(22px, 3vw, 36px); border: 1px solid var(--ember-line); border-radius: var(--radius); background: var(--bg-2); }
.eng-loop__title { font-size: var(--step-1); margin-bottom: 8px; }
.eng-loop__lead { max-width: 70ch; }
.eng-loop { counter-reset: loop; display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .eng-loop { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .eng-loop { grid-template-columns: repeat(4, 1fr); } }
.eng-loop li { counter-increment: loop; position: relative; padding: 14px 14px 14px 46px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--steel); font-size: .92rem; line-height: 1.4; }
.eng-loop li::before { content: counter(loop); position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ember); color: #0a0a0a; font-size: .8rem; font-weight: 700; }
.eng-loop li:last-child { border-color: var(--ember-line); }
.eng-loop li:last-child::before { content: "↺"; }
.eng-loop strong { color: var(--text); }
.eng-refs { margin: 20px 0 0; font-size: .85rem; color: var(--muted); }

/* ---------- Connect your tools (MCP) ---------- */
.connect-trust { display: grid; gap: 12px; margin: 0 0 clamp(28px, 4vw, 44px); padding: 0; list-style: none; }
@media (min-width: 900px) { .connect-trust { grid-template-columns: repeat(3, 1fr); } }
.connect-trust li { padding: 14px 16px 14px 18px; border-left: 3px solid var(--ember); background: var(--bg-2); color: var(--steel); font-size: .95rem; line-height: 1.5; }
.connect-trust strong { display: block; color: var(--text); }
.connector-groups { display: grid; gap: clamp(14px, 1.6vw, 20px); }
@media (min-width: 760px) { .connector-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .connector-groups { grid-template-columns: repeat(3, 1fr); } }
.connector-group { padding: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.connector-group h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 1rem; }
.connector-group h3 svg { width: 22px; height: 22px; flex: none; color: var(--ember-ink); }
.connector-group ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.connector { display: grid; gap: 2px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.connector:hover, .connector:focus-visible { border-color: var(--ember); transform: translateY(-2px); }
.connector__name { color: var(--text); font-weight: 700; }
.connector__desc { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.connect-note { margin: 18px 0 0; color: var(--muted); font-size: .85rem; }
.chips--tools { margin-top: 6px; }
.chips__hint { width: 100%; margin: -4px 0 10px; color: var(--muted); font-size: .85rem; }

/* ---------- First briefing (agentic onboarding, Phase 1) ---------- */
.briefing-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.briefing-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: .9rem; }
.briefing-steps li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-3); color: var(--text); font-weight: 700; font-size: .8rem; }
.briefing-steps li[aria-current] { border-color: var(--ember); color: var(--text); }
.briefing-steps li[aria-current] span { background: var(--ember); color: #0a0a0a; }
.briefing { display: grid; gap: 20px; max-width: 860px; }
.briefing-card { padding: clamp(22px, 3vw, 36px); background: var(--bg-2); border: 1px solid var(--ember-line); border-radius: var(--radius); }
.briefing-card[hidden] { display: none; }
.briefing-card h2 { font-size: var(--step-2); margin-bottom: 10px; }
.signin { display: grid; gap: 12px; margin-top: 20px; max-width: 420px; }
.signin__btn { justify-content: flex-start; }
.signin__btn[hidden] { display: none; }
.briefing-who { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: end; }
.briefing-who .field { grid-column: span 1; }
.briefing-who input[readonly] { color: var(--steel); border-bottom-style: dashed; }
.briefing-who__switch { grid-column: span 2; margin: 6px 0 0; font-size: .85rem; }
@media (max-width: 520px) { .briefing-who { grid-template-columns: 1fr; } .briefing-who .field, .briefing-who__switch { grid-column: span 1; } }
.consent { grid-column: span 2; display: flex; align-items: flex-start; gap: 10px; color: var(--steel); font-size: .92rem; line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ember); flex: none; }
.consent.is-invalid, .field.is-invalid label { color: var(--error); }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: var(--step-1); margin: 36px 0 12px; }
.legal ul { margin: 0 0 1em; padding-left: 1.2em; color: var(--muted); }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--ember-ink); text-decoration: underline; }
.legal__updated { color: var(--muted); font-size: .9rem; }
.consent a { color: var(--ember-ink); text-decoration: underline; }

/* ---------- Agent chat (sales area) ---------- */
.agent { display: grid; grid-template-rows: auto 1fr auto auto; gap: 12px; padding: clamp(18px, 2.4vw, 28px); background: var(--bg-2); border: 1px solid var(--ember-line); border-radius: var(--radius); min-height: 420px; }
.agent[hidden] { display: none; }
.agent__head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.agent__head strong { display: block; color: var(--text); }
.agent__head small { color: var(--muted); font-size: .85rem; }
.agent__avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--ember); color: #0a0a0a; font-weight: 700; }
.agent__log { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 4px 0; list-style: none; max-height: 60vh; overflow-y: auto; }
.agent-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-msg--assistant { align-self: flex-start; background: var(--bg-3); color: var(--text); border-bottom-left-radius: 4px; }
.agent-msg--user { align-self: flex-end; background: var(--ember); color: #0a0a0a; border-bottom-right-radius: 4px; }
.agent-msg.is-typing { color: var(--muted); font-style: italic; }
.agent-card { align-self: stretch; padding: 14px 16px; border: 1px solid var(--ember-line); border-left: 3px solid var(--ember); border-radius: var(--radius); background: var(--bg); }
.agent-card strong { display: block; margin-bottom: 6px; color: var(--text); }
.agent-card ul { margin: 0 0 12px; padding-left: 1.2em; color: var(--steel); }
.agent-card p { margin: 0; }
.agent-card .btn { margin-top: 12px; }
.agent-card code { display: block; margin-top: 8px; padding: 6px 8px; overflow-x: auto; border-radius: 6px; background: var(--surface, rgba(127,127,127,.08)); color: var(--steel); font-size: .85em; white-space: pre-wrap; word-break: break-word; }
.agent-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-card__outcome { margin-top: 8px !important; color: var(--steel); font-size: .9em; }
/* Phase 2: the visitor's tools (connect / disconnect) */
.agent__tools { padding: 14px 20px; border-bottom: 1px solid var(--ember-line); }
.agent__tools h3 { margin: 0 0 4px; font-size: 1rem; }
.agent__tools p { margin: 0 0 10px; color: var(--steel); font-size: .9em; }
.agent__tools-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.agent-tool { display: flex; align-items: center; min-height: 40px; border: 1px solid var(--ember-line); border-radius: 999px; background: var(--bg-2); transition: border-color .2s; }
.agent-tool__connect { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; background: none; border: 0; border-radius: 999px; color: var(--text); font: inherit; font-size: .95em; cursor: pointer; }
.agent-tool__connect:hover:not(:disabled) { color: var(--ember-hot); }
.agent-tool:has(.agent-tool__connect:hover:not(:disabled)) { border-color: var(--ember); background: var(--bg-3); }
.agent-tool__connect:focus-visible, .agent-tool__x:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.agent-tool__action { color: var(--ember-ink); font-weight: 600; font-size: .85em; }
.agent-tool__action::before { content: "+ "; }
.agent-tool__dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); flex: none; }
.agent-tool[data-status="connecting"] { border-style: dashed; border-color: var(--ember-line); }
.agent-tool[data-status="connecting"] .agent-tool__connect { cursor: progress; }
.agent-tool[data-status="connecting"] .agent-tool__action::before { content: ""; }
.agent-tool[data-status="connecting"] .agent-tool__dot { border-color: var(--ember); border-top-color: transparent; animation: agent-spin 1s linear infinite; }
.agent-tool[data-status="connected"] { gap: 8px; padding-left: 14px; border-color: rgba(84, 196, 128, .55); }
.agent-tool[data-status="connected"] .agent-tool__dot { background: #54c480; border-color: #54c480; box-shadow: 0 0 0 3px rgba(84, 196, 128, .18); }
.agent-tool__state { color: var(--muted); font-size: .85em; }
.agent-tool__x { display: grid; place-items: center; width: 32px; height: 32px; margin-right: 4px; background: none; border: 0; border-radius: 50%; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.agent-tool__x:hover { color: var(--text); background: var(--bg-3); }
.briefing-connect { grid-column: 1 / -1; margin: -4px 0 8px; padding: 14px 16px; border: 1px dashed var(--ember-line); border-radius: var(--radius); background: var(--bg-2); }
.briefing-connect__lead { margin: 0 0 10px; color: var(--steel); font-size: .92em; }
.briefing-connect__lead strong { color: var(--text); }
.briefing-assisted { margin: 10px 0 0; color: var(--muted); font-size: .88em; }
.agent__tools-msg { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--ember-line); color: var(--steel); font-size: .9em; }
.agent__tools-msg[data-tone="ok"] { border-left-color: #54c480; }
.agent__tools-msg[data-tone="warn"] { border-left-color: var(--error-line); }
@keyframes agent-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .agent-tool[data-status="connecting"] .agent-tool__dot { animation: none; } }
.agent__input { display: flex; gap: 10px; align-items: flex-end; }
.agent__input textarea { flex: 1; min-height: 48px; padding: 12px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font: inherit; resize: vertical; }
.agent__input textarea:focus { outline: 2px solid var(--ember); outline-offset: 1px; }
.agent__note { margin: 0; color: var(--muted); font-size: .8rem; }

/* briefing: invalid fields are visible (not only a recolored label) */
.briefing-card .field.is-invalid input, .briefing-card .field.is-invalid textarea { border-bottom-color: var(--error-line); border-bottom-width: 2px; }
.consent .field__error { display: block; margin-top: 4px; }
.consent.is-invalid input { outline: 2px solid var(--error-line); outline-offset: 2px; }
