/* Layout 04 — Open
   The editorial scroll makes room for the floating agent panel on the right
   and the topic rail on the left, and takes the room back when the panel is
   put away. */

.iter-open .editorial { padding-left: clamp(116px, 10.5vw, 178px); padding-right: calc(var(--panel-w) + var(--edge) * 2); }
.iter-open.agent-hidden .editorial { padding-right: clamp(20px, 4vw, 60px); }

/* Experience and Area of Discipline carry the most text, so they sit on a
   pane of dark glass, the way sections sit on paper in Split. */
.iter-open #work,
.iter-open #skills {
  position: relative;
  margin-top: clamp(30px, 6vh, 70px);
  margin-bottom: clamp(30px, 6vh, 70px);
  padding: clamp(24px, 4.4cqw, 60px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(169, 191, 217, 0.1), rgba(169, 191, 217, 0.02) 55%), rgba(15, 24, 36, 0.62);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(26px) saturate(125%);
}
.iter-open #work .row:first-child,
.iter-open #work .row-group:first-child .row:first-child { border-top-color: rgba(255, 255, 255, 0.22); }
.iter-open #projects { border-top: 0; }
/* the last entry already carries its own space underneath, so the pane closes sooner after it */
.iter-open #work { padding-bottom: clamp(6px, 1.4cqw, 20px); }

/* The same two sections on paper instead, the way they sit in Split: warm
   white, dark ink, the navy of the role titles. Switched from the header. */
.iter-open.paper #work,
.iter-open.paper #skills {
  border-color: rgba(0, 0, 0, 0.08);
  /* 80% white: enough of the mountains shows through to keep it part of the scene */
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
  color: var(--ink);
}
.iter-open.paper #work .row-timeline::before { background: linear-gradient(180deg, #3a587a, rgba(58, 88, 122, 0.2)); }
.iter-open.paper #work .row-timeline li::before { border-color: #3a587a; background: #f2eee7; }
.iter-open.paper #work .row-timeline li:first-child::before { background: #3a587a; box-shadow: 0 0 0 4px rgba(58, 88, 122, 0.16); }
.iter-open.paper #work .tl-when { color: var(--ink-faint); }
.iter-open.paper #work .row-timeline b { color: var(--ink-navy); }
.iter-open.paper #work .row-timeline p { color: var(--ink-soft); }
.iter-open.paper :is(#work, #skills) .kick { color: var(--ink-faint); }
.iter-open.paper :is(#work, #skills) :is(h2, h3) { color: var(--ink); }
.iter-open.paper #work .row { border-top-color: rgba(0, 0, 0, 0.09); }
.iter-open.paper #work .row:first-child,
.iter-open.paper #work .row-group:first-child .row:first-child { border-top-color: rgba(0, 0, 0, 0.16); }
.iter-open.paper #work .row:hover { background: rgba(0, 0, 0, 0.035); }
.iter-open.paper #work .row-dates { color: var(--ink-faint); }
.iter-open.paper #work .row-role { color: var(--ink-navy); }
.iter-open.paper #work .row p { color: var(--ink-soft); }
.iter-open.paper #skills .columns article { border-top-color: rgba(0, 0, 0, 0.2); }
.iter-open.paper #skills .columns ul { color: var(--ink-soft); }
.iter-open.paper #skills .tools-card { border-top-color: transparent; }
/* on paper the toolbox and its tools go back to the dark ink they have on the live site */
.iter-open.paper .toolbox-svg > rect:not(.toolbox-cavity),
.iter-open.paper .toolbox-lid > rect:first-of-type { fill: #3d3d3d; }
.iter-open.paper .toolbox-lid > path { stroke: #3d3d3d; }
.iter-open.paper .toolbox-cavity { fill: #2f2f2f; }
.iter-open.paper .toolbox-latch { fill: #5c5a58; }
.iter-open.paper .toolbox-latch-in { fill: #3a3836; }
.iter-open.paper .toolbox-hint { color: var(--ink-faint); }
.iter-open.paper .physics-icon img,
.iter-open.paper .physics-icon svg { fill: #3d3d3d; filter: brightness(0) invert(1) brightness(0.239); opacity: 0.85; }
.iter-open.paper .toolbox-broom { color: var(--ink); border-color: rgba(61, 61, 61, 0.24); background: rgba(61, 61, 61, 0.06); box-shadow: none; }
.iter-open.paper .toolbox-broom.is-visible:hover { background: rgba(61, 61, 61, 0.12); border-color: rgba(61, 61, 61, 0.4); color: var(--ink); }
.iter-open.paper :is(#work, #skills) .is-cited { animation: auraCited 4.6s ease both; }

/* ── the rail: where you are, by topic ──────────────────────────────────── */
.topic-rail { position: fixed; left: clamp(12px, 1.8vw, 28px); top: 50%; z-index: 9; display: grid; gap: 6px; translate: 0 -50%; animation: floatIn 900ms 600ms var(--ease) both; }
.topic-rail button { display: flex; align-items: center; gap: 11px; height: 22px; padding: 0; border: 0; background: none; color: var(--faint-white); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.topic-rail i { width: 14px; height: 1.5px; border-radius: 1px; background: currentColor; transition: width 600ms var(--ease), background 300ms ease; }
.topic-rail span { opacity: 0; transform: translateX(-6px); white-space: nowrap; transition: opacity 280ms ease, transform 450ms var(--ease); }
.topic-rail button:hover { color: var(--white); }
.topic-rail button:hover span,
.topic-rail button.is-on span { opacity: 1; transform: none; }
.topic-rail button.is-on { color: var(--white); }
.topic-rail button.is-on i { width: 34px; background: var(--aura-flow) 0 0 / 300% 100%; animation: auraFlow 8s linear infinite; }

@media (max-width: 1100px) {
  /* less room: the rail keeps its ticks and shows a label only on hover */
  .iter-open .editorial { padding-left: 54px; }
  .topic-rail button.is-on span { opacity: 0; }
  .topic-rail button:hover span { opacity: 1; padding: 2px 8px; border-radius: 4px; background: rgba(15, 24, 36, 0.9); }
}

@media (max-width: 720px) {
  .iter-open .editorial { padding: 0 0 176px; }
  .iter-open #work,
  .iter-open #skills { padding: 18px 14px; border-radius: 10px; }

  /* The opening screen, composed for a phone: the portrait small beside who and
     where, then the headline at full width, the introduction, and the four
     links as an even grid. Everything sits above the agent's sheet. */
  .iter-open .hero {
    min-height: 0;
    grid-template-columns: 108px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: "portrait kick" "portrait meta" "title title" "lede lede" "actions actions";
    align-items: start;
    align-content: start;
    gap: 0 16px;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 0 50px;
  }
  .iter-open .hero-copy,
  .iter-open .hero-fit { display: contents; }
  .iter-open .hero-portrait { grid-area: portrait; order: 0; width: 108px; max-width: none; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
  .iter-open .hero .kick { grid-area: kick; align-self: end; line-height: 1.5; letter-spacing: 0.16em; }
  .iter-open .hero-meta { grid-area: meta; flex-direction: column; flex-wrap: nowrap; gap: 5px; margin-top: 10px; font-size: 0.74rem; line-height: 1.35; }
  .iter-open .hero-meta span { align-items: flex-start; }
  .iter-open .hero-meta svg { flex: none; margin-top: 1px; }
  .iter-open .hero h1 { grid-area: title; margin-top: 28px; font-size: clamp(3rem, 16.4cqw, 4.7rem); }
  .iter-open .hero-fit .lede { grid-area: lede; width: auto; min-width: 0; margin-top: 20px; font-size: 0.98rem; line-height: 1.58; }
  .iter-open .hero-actions { grid-area: actions; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; }
  .iter-open .hero-actions .ghost-btn { padding: 12px 10px; text-align: center; }

  /* the rail lies along the top edge of the sheet: five segments, the lit one is where you are */
  .assistant-shell > .topic-rail { position: static; display: flex; gap: 4px; translate: none; padding: 0 6px; animation: none; }
  .assistant-shell > .topic-rail button { flex: 1 1 0; height: 12px; gap: 0; }
  .assistant-shell > .topic-rail i,
  .assistant-shell > .topic-rail button.is-on i { width: 100%; height: 2px; }
  .assistant-shell > .topic-rail i { background: rgba(255, 255, 255, 0.2); }
  .assistant-shell > .topic-rail button.is-on i { background: var(--aura-flow) 0 0 / 300% 100%; }
  .assistant-shell > .topic-rail span { display: none; }
}
