/*
 * maxwellhandler.com homepage (v12)
 * Homepage-only sections. Shared rules (fonts, top bar, menu, sections, steps, cards,
 * pencil marks, footer) are in base.css; every value comes from tokens.css. One-off
 * component dimensions stay literal with a comment saying why.
 */

/* Intro header (the block is the shared .page-head) */
.intro__status { font-family: var(--font-mono); font-size: var(--text-13); color: var(--muted); }
.intro__dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: var(--space-2);
}
.intro__lede { max-width: 720px; font-size: var(--text-22); line-height: var(--leading-body); }

/* Intro edit: the lede strikes and rewrites itself once (js/home.js).
 * Every mark's finished state is the default, so reduced motion and no-JS show it.
 * JS adds .is-pending to put a mark in its start state, then removes it on cue. */
@media (min-width: 641px) { .intro__pair { white-space: nowrap; } } /* each strike + insert stays together */
.intro__lede.is-resetting * { transition: none; } /* reset snaps, no reverse animation */
/* Strikes are the shared .strike.strike--drawn (base.css); these are their animation hooks. */
.intro__strike { transition: color var(--edit-fade); }
.intro__strike.is-pending { color: var(--ink); }
.intro__strike .strike__line path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset var(--edit-draw); }
.intro__strike.is-pending path { stroke-dashoffset: 1; opacity: 0; } /* opacity hides the round-cap dot */
.intro__insert {
  display: inline-block; overflow: hidden; vertical-align: -0.12em; white-space: nowrap;
  transition-property: max-width; transition-timing-function: var(--edit-write);
}
.intro__insert.is-pending { max-width: 0; }
.intro__insert-text {
  display: inline-block; padding: 0 2px 0 var(--space-2);
  font-family: var(--font-hand); font-size: var(--text-28); font-weight: 500; line-height: var(--leading-tight); color: var(--pencil);
}
.intro__caret { position: relative; display: inline-block; }
.intro__caret .intro__insert-text { padding-left: 6px; }
.intro__caret-mark {
  position: absolute; left: 0; bottom: 1px; width: 10px; height: 7px; overflow: visible; transition: opacity var(--edit-fade);
}
.intro__caret-mark path { fill: none; stroke: var(--pencil); stroke-width: var(--stroke-main); stroke-linecap: round; stroke-linejoin: round; }
.intro__caret.is-pending > .intro__caret-mark { opacity: 0; }
.intro__hl { transition: background-size var(--edit-swipe); } /* on the shared .hl swipe */
.intro__hl.is-pending { background-size: 0% 75%; }
/* Replay sits inline after “in fintech.”. Hidden (no space) until JS un-hides it;
 * then visibility reserves its width so nothing reflows when it fades in. */
.intro__replay {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-1); padding: 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: var(--text-12); color: var(--muted);
  opacity: 0; visibility: hidden; transition: opacity var(--edit-reveal);
}
.intro__replay[hidden] { display: none; } /* reduced motion and no-JS: no button, no reserved space */
/* 44px hit area that doesn't grow the line box */
.intro__replay::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--tap); transform: translateY(-50%); }
.intro__replay svg path { fill: none; stroke: currentColor; stroke-width: var(--stroke-main); stroke-linecap: round; stroke-linejoin: round; }
.intro__replay.is-on { opacity: 1; visibility: visible; }
.intro__replay:hover { color: var(--ink); }
@media (max-width: 640px) {
  .intro__lede { font-size: var(--text-19); }
  .intro__insert-text { font-size: var(--text-24); }
}
.intro__links {
  display: flex; flex-wrap: wrap; gap: 0 var(--space-5);
  font-family: var(--font-mono); font-size: var(--text-15);
}
.intro__links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* 01 How I work */
.how { display: flex; flex-direction: column; gap: var(--space-7); }
.how__intro { display: flex; flex-direction: column; gap: var(--space-4); max-width: 680px; }
.thesis { font-size: var(--text-28); line-height: var(--leading-lede); font-weight: 500; letter-spacing: var(--tracking-2); }
.thesis__mark { position: relative; display: inline-block; padding-bottom: 6px; }
.thesis__underline {
  position: absolute; left: -4px; bottom: -6px; width: calc(100% + 12px); height: 16px;
  overflow: visible; color: var(--pencil);
}
.how__body { font-size: var(--text-19); line-height: var(--leading-body); color: var(--ink-soft); }

.workflow { display: flex; flex-direction: column; gap: var(--space-4); }
.cards {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-3);
}
.card__file { font-size: var(--text-13); overflow-wrap: anywhere; }
.workflow__note { font-family: var(--font-mono); font-size: var(--text-12); color: var(--muted); }

/* 02 Builds */
.project {
  padding: var(--space-7) 0; border-top: 1px solid var(--rule);
}
.project__grid { display: flex; flex-wrap: wrap; gap: var(--space-7); }
.rail { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: var(--space-5); }
.rail__num { font-family: var(--font-mono); font-size: var(--text-12); color: var(--accent); }
.project__title { font-size: var(--text-28); font-weight: 600; letter-spacing: var(--tracking-2); line-height: var(--leading-heading); }
.meta { display: flex; flex-direction: column; gap: var(--space-4); }
.meta__row { display: flex; flex-direction: column; gap: var(--space-1); }
.meta dd { font-size: var(--text-15); }
.rail__links { display: flex; flex-direction: column; align-items: flex-start; margin-top: var(--space-1); }
.rail__note { font-family: var(--font-mono); font-size: var(--text-13); color: var(--muted); }

/* Redacted title: "codename lantern" */
.project__title--redacted { position: relative; display: flex; flex-direction: column; gap: var(--space-1); font-weight: 400; }
.redact { position: relative; display: inline-block; align-self: flex-start; }
.redact__word { font-size: var(--text-28); font-weight: 600; letter-spacing: var(--tracking-2); line-height: var(--leading-heading); }
.redact__bar {
  position: absolute; left: -6px; right: -10px; top: 6px; height: 26px;
  background: var(--ink); border-radius: 3px 8px 4px 9px; transform: rotate(-2deg); opacity: 0.94;
}

/* "try it!" margin note */
/* The note sits above the button's right end so it stays inside the rail and the
   48px gap (beside the button it reached the story column). The margin gives it
   clear space below the Stack line at every width. */
.try { position: relative; align-self: flex-start; margin-top: var(--space-6); }
.try__note { position: absolute; left: calc(100% - 24px); top: -44px; width: 96px; height: 70px; pointer-events: none; }
.try__text { left: 30px; top: 0; } /* places the shared .hand-note */
.try__arrow { position: absolute; inset: 0; width: 96px; height: 70px; overflow: visible; color: var(--pencil); }

.story { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.story__lede { font-size: var(--text-19); line-height: var(--leading-lede); max-width: 620px; }
.story__label { margin-top: var(--space-4); }
.story__text { font-size: var(--text-16); line-height: var(--leading-body); color: var(--ink-soft); max-width: 620px; }

/* Phone frames */
.phones { display: flex; flex-wrap: wrap; gap: var(--space-5); margin: var(--space-2) 0; }
.phone { width: 180px; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.phone__frame {
  border: 8px solid var(--ink); border-radius: 32px; background: var(--ink);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--ink) 35%, transparent); overflow: hidden;
}
.phone__frame img { display: block; width: 100%; height: auto; }
.phone__cap { font-family: var(--font-mono); font-size: var(--text-12); color: var(--muted); }

/* 03 Experiments */
.experiments {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--space-5);
}
.experiment__meta { font-family: var(--font-mono); font-size: var(--text-12); color: var(--muted); }
.experiment__title { font-size: var(--text-22); font-weight: 600; line-height: var(--leading-heading); }
.experiment strong { font-weight: 600; }

/* 04 Journey */
.path__intro { display: flex; flex-direction: column; gap: var(--space-2); max-width: 680px; margin-bottom: var(--space-6); }
.path__lede { font-size: var(--text-22); line-height: var(--leading-lede); font-weight: 500; }
.path__sub { font-size: var(--text-16); color: var(--muted); }
.timeline { list-style: none; padding: 0; border-left: 1px solid var(--ink); }
/* 112px year column: fits "2024 → now" in mono on one line; a one-off component width, so literal */
.timeline__row {
  position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1.3fr);
  gap: var(--space-4); padding: var(--space-4) 0 var(--space-4) var(--space-6); border-top: 1px solid var(--rule);
}
.timeline__row::before {
  content: ""; position: absolute; left: -5px; top: 22px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--ink);
}
/* Current role: larger accent dot with a soft pulsing ring (decorative, so a pseudo-element) */
.timeline__row--current::before {
  left: -6px; top: 21px; width: 12px; height: 12px; background: var(--accent);
  animation: mh-pulse 2.4s ease-out infinite;
}
@keyframes mh-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .timeline__row--current::before { animation: none; } }
.timeline__year {
  position: relative; align-self: start; padding-top: 2px;
  font-family: var(--font-mono); font-size: var(--text-13);
}
.timeline__row--current .timeline__year { font-weight: 500; white-space: nowrap; justify-self: start; }
.timeline__role { display: flex; flex-direction: column; gap: var(--space-1); }
.timeline__title { font-size: var(--text-16); font-weight: 600; }
.timeline__company { font-size: var(--text-15); color: var(--muted); }
.timeline__note { font-size: var(--text-15); line-height: var(--leading-body); color: var(--ink-soft); }
.path__cta { margin-top: var(--space-section); }
@media (max-width: 500px) {
  .timeline__row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}

/* Build-log link after the credit. On its own line, so the credit is no wider than before
   and the footer row wraps exactly as it did; the 44px hit area doesn't grow the line box. */
.footer__log { position: relative; display: block; width: fit-content; white-space: nowrap; }
@media (max-width: 640px) { .footer__log { margin-inline: auto; } } /* the credit wraps and centers here */
.footer__log::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--tap); transform: translateY(-50%); }
