/* =====================================================================
   EMMAUS LABS — agents (agents.html)
   Loaded after styles.css, so it reuses the tokens, the navigation, the
   buttons, the small "model" frames and the contact section, and adds the
   page's own scenes: an agent at work in the hero, the loop, the parts,
   the use cases, the deployment shapes, the ladder, and the turn to morning.
   ===================================================================== */

[hidden] { display: none !important; }

/* ---------------- Hero: copy on the left, an agent at work on the right ---------------- */
.hero--agents .hero__content { width: min(100% - 2 * var(--gutter), 1400px); grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 96px); align-items: center; justify-items: stretch; text-align: left; padding: calc(112px + env(safe-area-inset-top)) 0 56px; }
.hero__copy { display: grid; justify-items: start; }
.hero--agents .manifesto__label { margin-bottom: clamp(22px, 3vw, 34px); }
.hero--agents .hero__title { margin-top: 0; font-size: clamp(40px, 5.4vw, 86px); line-height: 1; letter-spacing: -.015em; max-width: 12ch; }
.hero--agents .hero__lede { margin-top: 22px; font-size: clamp(16px, 1.2vw, 18px); max-width: 52ch; }
.hero--agents .hero__actions { justify-content: flex-start; margin-top: 34px; }
body.is-loaded .hero__copy { animation-delay: .35s; }
body.is-loaded .hero__model { animation-delay: .7s; }
.hero__model { display: grid; justify-items: end; gap: 14px; }
.trace { width: min(100%, 620px); aspect-ratio: auto; height: clamp(360px, 46vh, 460px); font-size: 12.5px; }
.trace__log { position: absolute; inset: 32px 0 0; padding: 18px 20px 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; overflow: hidden; }
.trace__line { display: grid; grid-template-columns: 58px 16px minmax(0, 1fr); gap: 0 8px; align-items: baseline; line-height: 1.45; color: var(--ink-2); animation: trace-in .6s var(--ease-out) both; }
@keyframes trace-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.trace__t { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.trace__k { font-family: var(--font-mono); font-size: 12px; color: var(--gold-3); text-align: center; }
.trace__x b { font-weight: 500; color: var(--ink); }
.trace__x em { font-style: normal; color: var(--ink-3); }
.trace__line--in .trace__x { color: var(--ink); }
.trace__line--in .trace__k, .trace__line--ok .trace__k, .trace__line--hand .trace__k { color: var(--gold); }
.trace__line--pol .trace__x { color: var(--ink-3); }
.trace__line--ok .trace__x, .trace__line--hand .trace__x { color: var(--gold-2); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.trace__caret { display: inline-block; width: 1px; height: 12px; background: var(--gold); vertical-align: -2px; margin-left: 3px; animation: m-blink 1s steps(2) infinite; }
.trace__caption { color: var(--ink-3); text-align: right; }

/* ---------------- Section shell ---------------- */
.ag { position: relative; padding: clamp(96px, 12vw, 180px) var(--gutter); }
.ag__inner { width: min(100%, 1400px); margin-inline: auto; }
.ag__head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px clamp(32px, 6vw, 120px); align-items: end; margin-bottom: clamp(48px, 7vw, 96px); }
.ag__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(34px, 4.8vw, 78px); line-height: 1.02; letter-spacing: -.01em; color: var(--ink); margin-top: 28px; text-wrap: balance; }
.ag__lede { color: var(--ink-2); font-size: clamp(16px, 1.25vw, 18px); max-width: 52ch; text-wrap: pretty; }

/* ---------------- 01 What an agent is: the loop, and the difference ---------------- */
.what__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 120px); align-items: center; }
.loop { margin: 0; }
.loop svg { width: min(100%, 520px); height: auto; margin-inline: auto; overflow: visible; }
.loop__ring { fill: none; stroke: var(--line); stroke-width: 1; }
.loop__node circle { fill: var(--bg); stroke: rgba(var(--gold-rgb), .45); stroke-width: 1; transition: fill .4s; }
.loop__node text { font-family: var(--font-display); font-weight: 300; font-size: 17px; fill: var(--ink); text-anchor: middle; }
.loop__cap { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; fill: var(--ink-3); }
.loop__center { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; fill: var(--gold-2); }
.loop__center--sub { font-family: var(--font-body); font-size: 11px; letter-spacing: 0; fill: var(--ink-3); }
.loop__pulse { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), .9)); offset-path: path("M240 70 A170 170 0 1 1 240 410 A170 170 0 1 1 240 70"); offset-distance: 0%; animation: loop-run 7s linear infinite; }
@keyframes loop-run { to { offset-distance: 100%; } }
.loop figcaption { margin-top: 18px; text-align: center; color: var(--ink-3); }
.diff { display: grid; border-top: 1px solid var(--line); }
.diff li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.diff li > .mono { color: var(--ink-3); padding-top: 7px; }
.diff li h3 { grid-column: 2; font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.1; color: var(--ink); }
.diff li p { grid-column: 2; color: var(--ink-2); font-size: 15.5px; max-width: 48ch; }
.diff li.diff__agent { background: linear-gradient(90deg, rgba(var(--gold-rgb), .09), rgba(var(--gold-rgb), 0) 70%); padding-inline: 18px; margin-inline: -18px; border-radius: 8px; }
.diff__agent > .mono { color: var(--gold); }
.diff__agent h3 { color: var(--gold); }

/* ---------------- 02 Anatomy ---------------- */
.parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.parts li { background: var(--bg); padding: 28px 26px 32px; display: grid; align-content: start; gap: 12px; }
.parts li > .mono { color: var(--gold-2); }
.parts li h3 { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2vw, 28px); line-height: 1.1; color: var(--ink); }
.parts li p { color: var(--ink-2); font-size: 15px; }

/* ---------------- 03 Use cases ---------------- */
.cases__group { display: grid; gap: 10px; font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.1; color: var(--ink); margin-bottom: clamp(28px, 4vw, 44px); padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.cases__group .mono { color: var(--gold-2); }
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(24px, 3vw, 48px); margin-bottom: clamp(64px, 8vw, 120px); }
.case { display: grid; align-content: start; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.case > .mono { color: var(--gold-2); }
.case h4 { font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.1; color: var(--ink); }
.case p { color: var(--ink-2); font-size: 15px; }
.case__meta { display: grid; gap: 6px; margin-top: 4px; color: var(--ink-3); text-transform: none; letter-spacing: .03em; font-size: 11.5px; }
.case__meta b { font-weight: 400; color: var(--gold-2); text-transform: uppercase; letter-spacing: .08em; margin-right: 6px; }
.case__out { font-family: var(--font-display); font-weight: 300; font-size: 18px; line-height: 1.3; color: var(--gold); margin-top: 4px; }
.cases__more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; border-top: 1px solid var(--line); padding-top: clamp(28px, 4vw, 44px); }
.cases__more p { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; color: var(--ink); }

/* ---------------- 04 Deployment: three shapes and the ladder ---------------- */
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-bottom: clamp(72px, 9vw, 140px); }
.shape { display: grid; align-content: start; gap: 14px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(160deg, rgba(var(--gold-rgb), .07), rgba(var(--gold-rgb), 0) 60%); }
.shape > .mono { color: var(--gold-2); }
.shape h3 { font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.1; color: var(--ink); }
.shape p { color: var(--ink-2); font-size: 15px; }
.shape .tags { margin-top: 8px; }
.ladder { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 96px); align-items: start; border-top: 1px solid var(--line); padding-top: clamp(40px, 5vw, 72px); }
.ladder__head h3 { font-family: var(--font-display); font-weight: 300; font-size: clamp(28px, 3vw, 44px); line-height: 1.05; color: var(--ink); }
.ladder__head p { color: var(--ink-2); margin-top: 16px; max-width: 34ch; font-size: 16px; }
.ladder__rungs { display: grid; }
.rung { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 20px; padding: 26px 0 26px calc(var(--i, 0) * 7%); border-top: 1px solid var(--line); }
.rung:last-child { border-bottom: 1px solid var(--line); }
.rung__n { font-family: var(--font-display); font-weight: 200; font-size: 48px; line-height: 1; color: var(--gold-3); }
.rung:first-child .rung__n { color: var(--gold); }
.rung h4 { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2vw, 28px); line-height: 1.1; color: var(--ink); padding-top: 8px; }
.rung p { color: var(--ink-2); font-size: 15px; margin-top: 8px; max-width: 44ch; }
.rung__note { display: inline-block; margin-top: 14px; color: var(--gold); border: 1px solid rgba(var(--gold-rgb), .4); border-radius: 999px; padding: 6px 12px; }

/* ---------------- The turn: night to morning ---------------- */
.turn { position: relative; height: 220vh; }
.turn__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.turn__light { position: absolute; inset: 0; opacity: 0; will-change: background; }
.turn__copy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 0 var(--gutter); pointer-events: none; }
.turn__words { position: relative; height: 1.15em; width: 100%; font-family: var(--font-display); font-weight: 300; font-size: clamp(30px, 6.4vw, 104px); line-height: 1; letter-spacing: -.01em; }
.turn__word { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; will-change: opacity, transform; }
.turn__word--a { color: var(--ink-2); }
.turn__word--b { color: var(--gold); }
.turn__sub { margin: 34px auto 0; color: var(--ink-2); font-size: 16px; max-width: 44ch; }

/* ---------------- 05 How we build one ---------------- */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.step { display: grid; align-content: start; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.step > .mono { color: var(--gold-2); }
.step h3 { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2vw, 28px); line-height: 1.1; color: var(--ink); }
.step p { color: var(--ink-2); font-size: 15px; }
.step__out { color: var(--gold-2); margin-top: 6px; }

/* ---------------- 06 Straight answers ---------------- */
.ag--faq .ag__head { grid-template-columns: 1fr; }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px) clamp(32px, 5vw, 96px); margin: 0; }
.faq > div { padding-top: 22px; border-top: 1px solid var(--line); }
.faq dt { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.1; color: var(--ink); }
.faq dd { margin: 12px 0 0; color: var(--ink-2); font-size: 16px; max-width: 52ch; }

/* ---------------- 07 Contact ---------------- */
.contact__title--agents { font-size: clamp(52px, 10vw, 180px); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .nav__links a[href="index.html"] { display: none; }
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shapes { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .what__grid { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero--agents .hero__content { grid-template-columns: 1fr; gap: 40px; padding-bottom: 40px; }
  .hero__model { justify-items: stretch; }
  .trace { width: 100%; height: clamp(320px, 50vh, 420px); }
  .trace__caption { text-align: left; }
  .ag__head { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 640px) {
  .parts, .cases, .steps, .faq { grid-template-columns: 1fr; }
  .diff li { grid-template-columns: 1fr; }
  .diff li h3, .diff li p { grid-column: 1; }
  .diff li.diff__agent { padding-inline: 14px; margin-inline: -14px; }
  .rung { padding-left: 0; grid-template-columns: 48px minmax(0, 1fr); }
  .rung__n { font-size: 40px; }
  .turn { height: 180vh; }
  .trace { font-size: 11.5px; }
  .trace__line { grid-template-columns: 48px 14px minmax(0, 1fr); }
  .cases__more { flex-direction: column; align-items: flex-start; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .loop__pulse { display: none; }
  .trace__line { animation: none; }
  .trace__caret { display: none; }
  body.is-loaded .hero__copy, body.is-loaded .hero__model { animation-delay: 0s; }
}
