/* Welcome intro (intro.js). Ported from the Figma Make prototype "Portfolio Welcome Animation".
   Shown only when the inline <head> script adds html.intro-on (first homepage visit per session).
   Without JS the overlay never appears. */

/* Keeps the page width constant while the intro locks scrolling, so the intro's name
   lines up exactly with the nav name at hand-off. */
html { scrollbar-gutter: stable; }
html.intro-on { overflow: hidden; }

.intro { display: none; }
html.intro-on .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000; /* above the page; the dot cursor (9999) stays on top */
  overflow-y: auto;
  background: var(--bg);
  color: var(--fg);
}

/* Hidden until GSAP has applied the start states, so nothing flashes before the timeline runs */
.intro__inner { display: flex; flex-direction: column; min-height: 100%; visibility: hidden; }
.intro.is-running .intro__inner { visibility: visible; }

.intro__aside { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); white-space: nowrap; }

/* The padding is only a minimum (the content is centred); kept small so the footer button stays on screen on short viewports */
.intro__stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 16px; }

/* Typed headline in the wordmark style (Figtree SemiBold, -0.05em). intro.js splits it into
   .intro__char spans: every letter is laid out from the start and only its visibility changes,
   so the centred word never shifts while it types. */
.intro__word { display: flex; align-items: center; justify-content: center; height: 1.1em; margin: 0; font-size: clamp(72px, 13.9vw, 200px); font-weight: 400; line-height: 0.95; }
.intro__typed { font-weight: 600; letter-spacing: -0.05em; color: var(--fg); white-space: pre; }
.intro__char { position: relative; visibility: hidden; }
.intro__char.is-on { visibility: visible; }

/* Caret: sits after the newest letter. Solid while typing, blinks only when idle. */
.intro__char.is-caret::after { content: ""; position: absolute; left: 100%; top: 0.2em; width: max(2px, 0.045em); height: 0.82em; margin-left: 0.07em; background: var(--accent); animation: intro-caret 1s steps(1) infinite; }
.intro.is-typing .intro__char.is-caret::after { animation: none; }
@keyframes intro-caret { 50% { opacity: 0; } }

.intro__hello { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 40px; }
/* Sized to its text, so the tagline stays on one line wherever it fits */
.intro__lines { display: flex; flex-direction: column; max-width: 100%; font-size: 24px; font-weight: 400; letter-spacing: -0.48px; text-align: center; text-wrap: balance; }
/* Each line rises inside its own clipped box: 42.5px tall for one line (30.5px line + 6px above and below),
   and a tagline that wraps on a narrow phone keeps the same 30.5px line spacing */
.intro__lines p { overflow: hidden; padding-block: 6px; line-height: 30.5px; color: var(--fg); }
.intro__lines p:first-child { margin-bottom: -12px; color: #000000; }
.intro__lines span { display: block; }

.intro__footer { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 20px 0 28px; border-top: 1px solid var(--line); }
.intro__progress { position: absolute; top: -1px; left: 0; width: 100%; height: 1px; }
.intro__progress span { display: block; width: 100%; height: 100%; background: var(--fg); transform-origin: left center; transition: transform 120ms linear; }
.intro__footer .hm-card__meta { flex: 1 1 460px; white-space: nowrap; }
.intro__footer .intro__note { flex: 1 1 240px; max-width: 360px; white-space: normal; }
.intro__note dd { line-height: 1.45; }
.intro__status { min-width: 3.1em; } /* "Typing" > "Ready" must not nudge the items beside it */
.intro__count { display: inline-block; min-width: 4ch; font-variant-numeric: tabular-nums; }
.intro__enter { border: 0; font-family: inherit; line-height: normal; cursor: pointer; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 640px) {
  .intro__hello { flex-direction: row; gap: 28px; }
  .intro__lines { text-align: left; }
}
@media (min-width: 768px) {
  .intro__hello { margin-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro__char.is-caret::after { display: none; }
}
