/* ============================================================
   Agentum · Learn — Harness Engineering course page.
   Shared by /learn/ (EN) and /learn/es/ (ES). Built on the
   design-system tokens (/ds/styles.css); the .ara theme vars
   mirror the landing page so the two read as one site.
   ============================================================ */

.ara {
  --bg: #141414;
  --text: #ffffff;
  --text-2: #a3a3a3;
  --text-3: #6e6e6e;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --surface: #1c1c1c;
  --surface-2: #222222;
  --surface-3: #2a2a2a;
  --surface-hover: #242424;
  --cta-bg: #ef4444;
  --cta-text: #ffffff;
  --uifont: var(--font-sans);
  --mono: var(--font-mono);
  --panel: #1a1918;          /* solid reading surface — braille shows only in the gaps/gutters */
  --panel-line: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.28);
}
body.light .ara, .ara.light {
  --bg: #ffffff;
  --text: #141414;
  --text-2: #5a5a5a;
  --text-3: #8a8a8a;
  --line: rgba(0,0,0,0.08);
  --line-2: rgba(0,0,0,0.14);
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #ececec;
  --surface-hover: #f2f2f2;
  --cta-bg: #ef4444;
  --cta-text: #ffffff;
  --panel: #ffffff;          /* solid reading surface in light mode */
  --panel-line: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.28);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #141414; overflow-x: clip; }
body {
  background: #141414; color: #fff;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.5; overflow-x: clip;
  transition: background var(--dur-slow) var(--ease-standard);
}
body.light { background: #f7f7f7; }
::selection { background: var(--selection-bg); color: #fff; }
:where(a) { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
code { font-family: var(--mono); }

#bg-glyphs { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; pointer-events: none; display: block; }
.ara { position: relative; z-index: 1; background: transparent; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .wrap { padding: 0 18px; } }

/* ---- nav ---- */
nav.top { position: absolute; top: 0; left: 0; right: 0; z-index: 50; height: 64px; display: flex; align-items: center; background: transparent; }
nav.top .row { display: flex; align-items: center; width: 100%; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.brand img { width: 23px; height: 23px; }
.brand .crumb { color: var(--text-3); font-weight: 400; }
nav.top .center { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: 26px; pointer-events: none; white-space: nowrap; }
nav.top .center a.navlink { pointer-events: auto; color: var(--text-2); font-size: 14.5px; transition: color .15s; }
nav.top .center a.navlink:hover { color: var(--text); }
nav.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill-cta { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 18px; border-radius: var(--radius-pill); background: var(--cta-bg); color: var(--cta-text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: opacity .15s, transform .12s; }
.pill-cta:hover { opacity: 0.85; color: var(--cta-text); } .pill-cta:active { transform: scale(0.985) translateY(0.5px); }
.pill-cta .arr { transition: transform .16s; } .pill-cta:hover .arr { transform: translateX(2px); }
.pill-ghost { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); color: var(--text-2); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; transition: border-color .15s, color .15s; }
.pill-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.pill-ghost .st { color: var(--amber); }
.theme-toggle { width: 34px; height: 34px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: inline-grid; place-items: center; transition: color .15s, border-color .15s; }
.theme-toggle:hover { color: var(--text); border-color: var(--text-3); }
.theme-toggle svg { width: 16px; height: 16px; }
body:not(.light) .moon { display: none; } body.light .sun { display: none; }

/* language toggle */
.langtog { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-pill); overflow: hidden; height: 34px; font-family: var(--mono); font-size: 12px; }
.langtog a { display: inline-grid; place-items: center; height: 100%; padding: 0 11px; color: var(--text-3); transition: color .15s, background .15s; }
.langtog a:hover { color: var(--text); }
.langtog a.on { color: var(--text); background: var(--surface-2); }
@media (max-width: 900px) { nav.top .center, .pill-ghost { display: none; } }

/* ---- hero ---- */
.lhero { position: relative; text-align: center; padding: clamp(108px, 13vw, 156px) 0 clamp(20px, 3vw, 40px); }
.lhero .inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.lhero .eyebrow { margin-bottom: 20px; }
.lhero h1 { font-family: var(--uifont); font-size: clamp(38px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 500; margin: 0; max-width: 18ch; color: var(--text); }
.lhero .sub { font-size: clamp(16px, 1.5vw, 20px); color: var(--text-2); max-width: 58ch; margin: 22px auto 0; line-height: 1.55; }
.lhero .cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.cta-lg { height: 48px; padding: 0 24px; font-size: 15px; }

/* sources strip */
.sources { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px 9px; justify-content: center; }
.sources a { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 5px 12px; transition: color .15s, border-color .15s; }
.sources a:hover { color: var(--text-2); border-color: var(--text-3); }

/* ---- section panels ---- */
.band > .wrap, .final > .wrap, footer > .wrap {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 28px;
  padding: clamp(40px, 5.5vw, 76px) clamp(24px, 4vw, 56px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 36px 90px -56px rgba(0,0,0,0.7);
}
.band { padding: clamp(16px, 2.4vw, 28px) 20px; }
.band + .band { padding-top: clamp(8px, 1.2vw, 14px); }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-3); }
.h2 { font-family: var(--uifont); font-size: clamp(28px, 3.6vw, 48px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 500; margin: 16px 0 0; max-width: 18ch; color: var(--text); }
.blurb { font-size: clamp(15.5px, 1.4vw, 19px); color: var(--text-2); max-width: 60ch; margin: 18px 0 0; line-height: 1.6; }
.blurb code, .feat p code, .prim p code { font-size: 0.86em; color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: var(--radius-xs); border: 1px solid var(--line-2); }

/* ---- failure signals grid ---- */
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: clamp(36px, 4.5vw, 56px); }
@media (max-width: 820px) { .fgrid { grid-template-columns: 1fr; } }
.fcard { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-md); padding: 20px; }
.fcard .fn { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.fcard h3 { font-family: var(--uifont); font-size: 17px; font-weight: 500; margin: 12px 0 0; color: var(--text); letter-spacing: -0.01em; }
.fcard p { font-size: 14px; color: var(--text-2); margin: 9px 0 0; line-height: 1.55; }

/* ---- phase strip (the autonomous SDD role lifecycle) ---- */
.phaserow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(28px, 4vw, 48px); }
.phase { flex: 1 1 0; min-width: 150px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; }
.phase .pn { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); }
.phase h4 { font-size: 16px; font-weight: 500; margin: 9px 0 0; color: var(--text); letter-spacing: -0.01em; }
.phase .role { color: var(--agent-claude); font-family: var(--mono); font-size: 11px; margin-top: 6px; }
.phase p { font-size: 12.5px; color: var(--text-2); margin: 9px 0 0; line-height: 1.5; }
.phase.dev { border-color: var(--agent-claude); box-shadow: 0 0 0 1px var(--agent-claude) inset; }

/* ---- the loop diagram ---- */
.loop { margin-top: clamp(36px, 4.5vw, 56px); }
.loopgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .loopgrid { grid-template-columns: 1fr; } }
.lnode { position: relative; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; }
.lnode.key { border-color: var(--agent-claude); box-shadow: 0 0 0 1px var(--agent-claude) inset; }
.lnode .ls { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); }
.lnode h4 { font-size: 15.5px; font-weight: 500; margin: 8px 0 0; color: var(--text); }
.lnode .file { font-family: var(--mono); font-size: 11.5px; color: var(--agent-claude); margin-top: 6px; }
.lnode p { font-size: 13px; color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.loopfoot { margin-top: 18px; display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); border: 1px dashed var(--line-2); border-radius: var(--radius-pill); padding: 9px 16px; }
.loopfoot .rot { color: var(--agent-claude); }
.loopfoot code { font-size: 0.9em; color: var(--text); }

/* ---- runfilm: an auto-playing harness-run terminal (flips red → green) ---- */
.runfilm { margin-top: clamp(34px, 4.5vw, 56px); }
.rf-win { border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; background: #0c0c0e; box-shadow: 0 28px 70px -34px rgba(0,0,0,0.85); }
.rf-bar { height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 15px; background: #16161b; border-bottom: 1px solid rgba(255,255,255,0.06); }
.rf-bar i { width: 11px; height: 11px; border-radius: 999px; background: #2f2f2f; }
.rf-bar i:nth-child(1) { background: #ff5f57; } .rf-bar i:nth-child(2) { background: #febc2e; } .rf-bar i:nth-child(3) { background: #28c840; }
.rf-bar .rf-t { margin-left: 8px; font-family: var(--font-term); font-size: 12.5px; color: #7c7c84; }
.rf-bar .rf-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-term); font-size: 11.5px; color: #56d364; }
.rf-bar .rf-live::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #56d364; box-shadow: 0 0 8px rgba(86,211,100,0.7); animation: rfPulse 1.6s ease-in-out infinite; }
.rf-body { padding: 20px 20px 22px; font-family: var(--font-term); font-size: clamp(13.5px, 1.25vw, 16px); line-height: 2.05; color: #d3d3d3; }
.rf-ln { white-space: pre-wrap; }
.rf-flip { position: relative; display: inline-block; }
.rf-green { color: #56d364; }
.rf-red { position: absolute; left: 0; top: 0; color: #f0857d; white-space: nowrap; }
.rf-cur { display: inline-block; width: 9px; height: 1.05em; background: #d3d3d3; margin-left: 7px; vertical-align: -2px; animation: rfBlink 1.05s steps(1) infinite; }
@keyframes rfPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes rfBlink { 50% { opacity: 0; } }
@keyframes rfRed { 0%,6% { opacity: 0; } 12%,46% { opacity: 1; } 54%,100% { opacity: 0; } }
@keyframes rfGreen { 0%,52% { opacity: 0; text-shadow: none; } 60% { opacity: 1; text-shadow: 0 0 18px rgba(86,211,100,0.65); } 94% { opacity: 1; text-shadow: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .rf-red { animation: rfRed 5.4s infinite; }
  .rf-green { animation: rfGreen 5.4s infinite; }
}
@media (prefers-reduced-motion: reduce) { .rf-red { opacity: 0; } .rf-cur { animation: none; } }

/* ---- feature blocks (text + window) ---- */
.feat { display: grid; grid-template-columns: 1fr 1.12fr; gap: 52px; align-items: center; margin-top: clamp(44px, 6vw, 80px); }
.feat.flip { grid-template-columns: 1.12fr 1fr; }
.feat.flip .ftext { order: 2; } .feat.flip .fvis { order: 1; }
.feat h3 { font-family: var(--uifont); font-size: clamp(21px, 2.2vw, 29px); line-height: 1.14; letter-spacing: -0.02em; font-weight: 500; margin: 0; color: var(--text); }
.feat p { color: var(--text-2); font-size: 15.5px; line-height: 1.6; margin: 16px 0 0; max-width: 46ch; }
.feat .step { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 14px; }
@media (max-width: 820px) { .feat, .feat.flip { grid-template-columns: 1fr; gap: 26px; } .feat.flip .ftext { order: 1; } .feat.flip .fvis { order: 2; } }

/* mini terminal windows — always dark, like the app */
.mini { --bg: #141414; --text: #f2f2f2; --text-2: #a3a3a3; --text-3: #6e6e6e; --line: rgba(255,255,255,0.08); --line-2: rgba(255,255,255,0.14); --surface: #1c1c1c; --surface-2: #222222;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; background: #141414; box-shadow: 0 18px 50px -28px rgba(0,0,0,0.8); }
.mini .mchrome { height: 32px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #121215; }
.mini .mchrome span { width: 9px; height: 9px; border-radius: 999px; background: #2f2f2f; }
.mini .mchrome span:nth-child(1){ background:#ff5f57;} .mini .mchrome span:nth-child(2){ background:#febc2e;} .mini .mchrome span:nth-child(3){ background:#28c840;}
.mini .mchrome .mt { margin-left: 6px; font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.mbody { padding: 16px; }
:root { --font-term: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace; }
.term { background: #050506; color: #f2f2f2; font-family: var(--font-term); font-size: 12.5px; line-height: 1.66; padding: 16px 18px; font-feature-settings: "liga" 0, "calt" 0; border-radius: 8px; }
.term .ln { white-space: pre-wrap; }
.c3 { color: #6e6e6e; } .cg { color: #3fb950; } .cc { color: #d08770; } .cb { color: #79c0ff; } .ca { color: #d29922; } .cw { color: #fff; } .cm { color: #bc8cff; }

/* session list rows */
.srows { display: flex; flex-direction: column; gap: 2px; }
.srow { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-family: var(--font-term); font-size: 12px; }
.srow.active { background: #1c1c1c; }
.srow .st { width: 8px; height: 8px; border-radius: 999px; background: #6e6e6e; }
.srow.live .st { background: #3fb950; box-shadow: 0 0 8px rgba(63,185,80,.5); }
.srow.run .st { background: #d29922; box-shadow: 0 0 0 3px rgba(210,153,34,.18); }
.srow .nm { color: #f2f2f2; } .srow .mt { color: #6e6e6e; font-size: 11px; text-align: right; }

/* phone / tunnel mock */
.tunnel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.tnode { border: 1px solid var(--line-2); background: #1c1c1c; border-radius: var(--radius-md); padding: 14px; text-align: center; }
.tnode .ti { font-size: 22px; } .tnode .tn { font-family: var(--font-term); font-size: 11px; color: #a3a3a3; margin-top: 7px; } .tnode .tm { font-family: var(--font-term); font-size: 10px; color: #6e6e6e; margin-top: 3px; }
.tlink { display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: var(--font-term); font-size: 9.5px; color: #3fb950; }
.tlink .tline { width: 100%; min-width: 34px; height: 2px; border-radius: 2px; background: repeating-linear-gradient(90deg, #3fb950 0 6px, transparent 6px 11px); }
.tlink .lock { font-size: 12px; }
@media (max-width: 460px) { .tunnel { grid-template-columns: 1fr; } .tlink { flex-direction: row; } .tlink .tline { width: 40px; } }

/* ---- harness primitives list ---- */
.prims { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: clamp(36px, 4.5vw, 56px); }
@media (max-width: 720px) { .prims { grid-template-columns: 1fr; } }
.prim { display: flex; gap: 14px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-md); padding: 18px; }
.prim .pf { font-family: var(--mono); font-size: 11px; color: var(--agent-claude); flex: none; padding-top: 2px; min-width: 7.5em; }
.prim h4 { font-size: 15px; font-weight: 500; margin: 0; color: var(--text); }
.prim p { font-size: 13.5px; color: var(--text-2); margin: 7px 0 0; line-height: 1.55; }

/* ---- lecture cards ---- */
.lecgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: clamp(36px, 4.5vw, 56px); }
@media (max-width: 900px) { .lecgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .lecgrid { grid-template-columns: 1fr; } }
.leccard { display: block; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-md); padding: 18px; transition: border-color .15s, transform .15s, background .15s; }
.leccard:hover { border-color: var(--border-strong); transform: translateY(-2px); background: var(--surface-hover); }
.leccard .ln { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.leccard h4 { font-size: 15px; font-weight: 500; margin: 9px 0 0; color: var(--text); line-height: 1.3; letter-spacing: -0.01em; }
.leccard p { font-size: 13px; color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.leccard .go { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.leccard:hover .go { color: var(--text-2); }

/* ---- final cta ---- */
.final { text-align: center; padding: clamp(20px, 2.6vw, 40px) 20px clamp(40px, 6vw, 80px); position: relative; }
.final .inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.final h2 { font-family: var(--uifont); font-size: clamp(30px, 4.5vw, 60px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 500; margin: 0; max-width: 17ch; color: var(--text); }
.final p { font-size: clamp(15px, 1.4vw, 18px); color: var(--text-2); max-width: 52ch; margin: 20px auto 0; line-height: 1.55; }
.final .cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }

/* ---- footer ---- */
footer { padding: clamp(16px, 2.4vw, 32px) 20px 40px; position: relative; z-index: 2; }
footer .frow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
footer .brand { font-size: 18px; }
footer .flinks { display: flex; flex-wrap: wrap; gap: 18px; }
footer .fl { color: var(--text-2); font-size: 14px; } footer .fl:hover { color: var(--text); }
footer .legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
footer .legal a { color: var(--text-2); } footer .legal a:hover { color: var(--text); }

/* reveal — only active once JS adds body.reveals-on, so content is never stuck hidden */
body.reveals-on [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
body.reveals-on [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { body.reveals-on [data-reveal] { opacity: 1; transform: none; transition: none; } }
