/* The timeline (/portfolio/) as chapters, in the home page's look. Loaded after home.css, whose tokens, .btn, .chips,
   .eyebrow and side panel it uses. A chapter's tone sets its band: blue (in both themes, like the home Contact block),
   dark (the page) or alt (the alternate band). */

.tl-page { padding-top: 64px; }

/* ── Top of the page ──────────────────────────────────────────────────────── */
.tl-hero { padding-block: clamp(56px, 8vw, 120px) clamp(64px, 9vw, 128px); }
.tl-hero .eyebrow a { color: inherit; text-decoration: none; }
.tl-hero .eyebrow a:hover { color: var(--fg); }
.tl-title { margin: 20px 0 clamp(20px, 3vw, 32px); font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(84px, 17vw, 300px); line-height: .8; letter-spacing: -.02em; }
.tl-title span, .ch-title span { color: var(--blue); }
.tl-lede { max-width: 46ch; color: var(--muted); font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; }
.tl-lede p { margin: 0; }

/* The chapters, as three big links. */
.tl-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; list-style: none; }
.tl-index li { display: grid; }
.tl-index a { position: relative; display: grid; align-content: space-between; gap: 28px; min-height: 180px; padding: 22px 24px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); text-decoration: none; overflow: hidden; transition: transform 400ms var(--ease); }
.tl-index a:hover { transform: translateY(-4px); }
.tl-index a[data-tone="blue"] { border-color: transparent; color: #fff; background: radial-gradient(90% 100% at 100% 0%, #5468ff 0%, transparent 60%), var(--blue); }
.tl-index-n { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 64px; line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); }
.tl-index a[data-tone="blue"] .tl-index-n { -webkit-text-stroke-color: rgb(255 255 255 / .6); }
.tl-index-name { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: clamp(24px, 2.4vw, 34px); line-height: .95; }
.tl-index-when { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ── A chapter: a full-width band; the heading sticks beside its entries on wide screens ── */
.ch { position: relative; padding-block: clamp(72px, 10vw, 140px); scroll-margin-top: 64px; }
.ch[data-tone="alt"] { background: var(--bg-alt); }
.ch[data-tone="blue"] { --line: rgb(255 255 255 / .22); --line-strong: rgb(255 255 255 / .4); --muted: rgb(255 255 255 / .78); --accent: #fff; color: #fff;
  background: radial-gradient(70% 90% at 100% 0%, #4d62ff 0%, transparent 60%), var(--blue); }
.ch[data-tone="blue"] .eyebrow { color: rgb(255 255 255 / .8); }
.ch[data-tone="blue"] .eyebrow::before { background: #fff; }
.ch[data-tone="blue"] .ch-title span { color: #fff; opacity: .55; }
.ch-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.ch-head { position: sticky; top: 104px; display: grid; gap: 18px; }
.ch-num { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(96px, 12vw, 180px); line-height: .78; color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); }
.ch-title { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(48px, 6.4vw, 104px); line-height: .86; letter-spacing: -.015em; text-wrap: balance; }
.ch-line { max-width: 36ch; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.45; }

/* Entries: rows; one with more to say opens the side panel. */
.ch-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ch-row { border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.ch-item { display: grid; grid-template-columns: 48px 150px minmax(0, 1fr) auto 32px; gap: 6px 20px; align-items: center; width: 100%; padding: 20px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
div.ch-item { grid-template-columns: 48px 150px minmax(0, 1fr) auto 32px; }
button.ch-item { cursor: pointer; }
.ch-mark { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, currentColor 6%, transparent); }
.ch-mark img { width: 100%; height: 100%; object-fit: cover; }
.ch-mark svg { width: 22px; height: 22px; stroke-width: 1.6; }
.ch-row[data-kind="milestone"] .ch-mark { border-color: transparent; background: #ffd34d; color: #3a2a00; }
.ch-when { display: grid; gap: 2px; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.ch-when small { font-size: 11px; opacity: .75; }
.ch-what { display: grid; gap: 3px; min-width: 0; }
.ch-name { font-family: var(--display); font-weight: 700; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.15; letter-spacing: -.02em; transition: transform 400ms var(--ease); }
.ch-org { color: var(--accent); font-weight: 500; font-size: 15px; }
.ch-kind { padding: 4px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ch-row[data-kind="project"] .ch-kind { border-style: dashed; }
.ch-plus { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); transition: transform 400ms var(--ease), background-color 200ms; }
.ch-plus::before, .ch-plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -.75px 0 0 -6px; border-radius: 1px; background: currentColor; }
.ch-plus::after { transform: rotate(90deg); }
button.ch-item:hover .ch-name { transform: translateX(8px); }
button.ch-item:hover .ch-plus { transform: rotate(90deg); background: color-mix(in srgb, currentColor 12%, transparent); }
button.ch-item:focus-visible { outline-offset: 4px; }
/* Arriving from the home page's experience list (/portfolio/#id): the row lights up once. */
.ch-row.hit { animation: ch-hit 2.4s var(--ease) 400ms both; }
@keyframes ch-hit { 0%, 100% { box-shadow: inset 4px 0 0 transparent; } 15%, 70% { box-shadow: inset 4px 0 0 var(--accent); } }
@media (prefers-reduced-motion: reduce) { .ch-row.hit { animation: none; box-shadow: inset 4px 0 0 var(--accent); } }

/* Side panel extras (the panel itself is home.css). */
.tl-panel-logo { width: 56px; height: 56px; border-radius: 14px; }
.tl-panel-org { color: var(--accent); font-weight: 500; }
.tl-panel-org a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.tl-panel-org a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tl-panel-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.tl-panel-list li { position: relative; padding-left: 22px; }
.tl-panel-list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }

/* ── Foot ─────────────────────────────────────────────────────────────────── */
.tl-foot { border-top: 1px solid var(--line); }
.tl-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-block: 24px max(24px, env(safe-area-inset-bottom)); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tl-foot span { margin-right: auto; }
.tl-foot a { text-decoration: none; }
.tl-foot a:hover { color: var(--fg); }

/* ── Narrow screens ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-head { position: static; }
  .ch-num { font-size: 88px; }
}
@media (max-width: 720px) {
  .tl-index { grid-template-columns: minmax(0, 1fr); }
  .tl-index a { min-height: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 18px; }
  .tl-index-n { grid-row: span 2; font-size: 52px; }
  .ch-item, div.ch-item { grid-template-columns: 44px minmax(0, 1fr) 28px; gap: 4px 14px; align-items: start; padding: 18px 0; }
  .ch-mark { grid-row: span 3; width: 44px; height: 44px; }
  .ch-when { grid-column: 2; grid-row: 1; }
  .ch-what { grid-column: 2; grid-row: 2; }
  .ch-kind { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 6px; }
  .ch-plus { grid-column: 3; grid-row: 1 / span 3; align-self: center; width: 28px; height: 28px; }
}
