/* ==========================================================================
   polish.css · revision 3, the craft layer
   polish.js drives it; the page reads and works without either.
   ========================================================================== */

/* -- inertial scroll (the Lenis contract) -- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* -- INTRO: the page opens along the seam it closes on.
      Pure CSS once html.has-intro is set; the script only removes it. -- */
.intro { display: none; }
.has-intro .intro {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}
.intro__half {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50.2%;
    display: flex;
    align-items: center;
    overflow: hidden;
    animation: intro-out-l 820ms cubic-bezier(0.77, 0, 0.18, 1) 1180ms both;
}
.intro__half--l { left: 0; background: var(--g-accent); color: var(--on-accent); justify-content: flex-end; }
.intro__half--r { right: 0; background: var(--g-ink); color: #f4f2ee; justify-content: flex-start; animation-name: intro-out-r; }
.intro__name {
    display: flex;
    overflow: hidden;
    padding: 0.08em 0.2em 0.04em;
    font-family: var(--sc-font-display);
    font-weight: 900;
    font-stretch: 125%;
    font-size: clamp(2rem, 8.6vw, 11rem);
    line-height: 0.8;
    letter-spacing: -0.055em;
    text-transform: uppercase;
}
.intro__name span { display: inline-block; animation: intro-rise 760ms cubic-bezier(0.2, 0.9, 0.1, 1) calc(100ms + var(--i) * 48ms) both; }
.intro__seam {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: #f4f2ee;
    transform-origin: top;
    animation: intro-seam 560ms cubic-bezier(0.65, 0, 0.35, 1) 360ms both, intro-fade 260ms linear 1180ms forwards;
}
.intro__tag {
    position: absolute;
    bottom: clamp(1.5rem, 6svh, 3.5rem);
    font: 500 0.72rem/1 var(--sc-font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    animation: intro-tag 1300ms linear both;
}
.intro__tag--l { right: calc(50% + 16px); color: var(--on-accent); }
.intro__tag--r { left: calc(50% + 16px); color: var(--on-ink-soft); }
@keyframes intro-rise { from { transform: translateY(108%); } }
@keyframes intro-seam { from { transform: scaleY(0); } }
@keyframes intro-fade { to { opacity: 0; } }
@keyframes intro-out-l { to { transform: translateX(-101%); } }
@keyframes intro-out-r { to { transform: translateX(101%); } }
@keyframes intro-tag { 0%, 42% { opacity: 0; } 58%, 86% { opacity: 1; } 100% { opacity: 0; } }

/* what the curtain uncovers arrives a beat behind it */
@keyframes rise-in { from { transform: translateY(42%); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes bar-drop { from { transform: translateY(-100%); } }
.has-intro .giant > * { animation: rise-in 1100ms cubic-bezier(0.16, 1, 0.3, 1) 1320ms both; }
.has-intro .giant > :nth-child(2) { animation-delay: 1400ms; }
.has-intro .giant > :nth-child(3) { animation-delay: 1480ms; }
.has-intro .hero__title { animation: rise-in 1000ms cubic-bezier(0.16, 1, 0.3, 1) 1480ms both; }
.has-intro .hero__sub { animation: rise-in 1000ms cubic-bezier(0.16, 1, 0.3, 1) 1580ms both; }
.has-intro .seam, .has-intro .op-log { animation: fade-in 700ms ease-out 1650ms both; }
.has-intro .bar { animation: bar-drop 800ms cubic-bezier(0.16, 1, 0.3, 1) 1500ms both; }

/* -- NAV: current chapter marked, bar tucks away on the way down -- */
.bar { transition: translate 460ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.is-tucked { translate: 0 -100%; }
.bar__index a.is-current { color: var(--on-ink); }
.bar__index a.is-current::after { transform: scaleX(1); }

/* -- TEXT ROLL: the label slides up to a second copy of itself -- */
.roll { display: inline-block; overflow: hidden; vertical-align: top; height: 1.25em; line-height: 1.25; }
.roll__in { display: block; transition: transform 560ms cubic-bezier(0.76, 0, 0.24, 1); }
.roll__in::after { content: attr(data-t); content: attr(data-t) / ""; display: block; }
@media (hover: hover) and (pointer: fine) {
    .has-roll:hover .roll__in { transform: translateY(-50%); }
}
.has-roll:focus-visible .roll__in { transform: translateY(-50%); }

/* -- MAGNETIC: calls to action lean toward the pointer -- */
.is-magnetic,
.social-row a.is-magnetic {
    transition: translate 650ms cubic-bezier(0.2, 0.9, 0.2, 1), transform 140ms var(--sc-ease-out),
        background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out), border-color 160ms var(--sc-ease-out);
}

/* -- HEADINGS rise out of their own line boxes -- */
.is-split .w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0 0.06em 0.12em;
    margin: 0 -0.06em -0.12em;
}
.is-split .w > span {
    display: inline-block;
    transform: translateY(110%) rotate(4deg);
    transform-origin: 0 100%;
    transition: transform 1100ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 75ms);
}
.is-split.is-in .w > span { transform: none; }

/* -- THE TAPE: two bands crossing the paper/ink cut -- */
.profile { padding-bottom: calc(var(--sc-section) + clamp(2.5rem, 5vw, 5rem)); }
.experience { padding-top: calc(var(--sc-section) + clamp(2.5rem, 5vw, 5rem)); }
.tape { position: relative; z-index: 6; height: 0; pointer-events: none; overflow-x: clip; overflow-y: visible; }
.tape__band {
    position: absolute;
    top: 0;
    left: -8vw;
    width: 116vw;
    overflow: hidden;
    padding-block: 0.42em;
    font-family: var(--sc-font-display);
    font-weight: 900;
    font-stretch: 125%;
    font-size: clamp(1.5rem, 0.9rem + 2.6vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.6);
}
/* orange rides mostly over the ink below the cut, ink mostly over the paper above it */
.tape__band--a { z-index: 2; background: var(--g-accent); color: var(--on-accent); transform: translateY(-22%) rotate(-3.4deg); }
.tape__band--b {
    z-index: 1;
    background: var(--g-ink-2);
    color: #f4f2ee;
    font-weight: 800;
    font-stretch: 100%;
    border-block: 1px solid rgba(230, 232, 236, 0.16);
    transform: translateY(-88%) rotate(2.6deg);
}
.tape__track { display: flex; width: max-content; will-change: transform; }
.tape__group { display: flex; align-items: center; gap: 0.42em; padding-right: 0.42em; }
.tape__group i { font-style: normal; font-size: 0.72em; }
.tape__group img { height: 1.05em; width: auto; }

/* -- CONTACT: the address breaks at the @, never mid-word -- */
.contact__mail { overflow-wrap: normal; }

/* -- THE LAST SCREEN -- */
.foot { display: block; }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.foot__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5em 0.9em; font: 500 0.78rem/1.3 var(--sc-font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-ink-soft); }
.foot__k { color: var(--accent); }
#foot-clock { color: var(--on-ink); font-variant-numeric: tabular-nums; }
.foot__top { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 600 0.92rem/1 var(--sc-font-text); text-decoration: none; color: var(--on-ink); }
.foot__top:hover { color: var(--accent); }
.foot__name {
    display: flex;
    flex-direction: column;
    margin-top: var(--sc-7);
    font-size: 17vw;
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(230, 232, 236, 0.28);
    white-space: nowrap;
}
.foot__line { width: max-content; overflow: hidden; padding: 0.04em 0.04em 0.02em 0; }
.foot__line:last-child { align-self: flex-end; }
.foot__name .l { display: inline-block; }
.foot__name.is-armed .l { transform: translateY(102%); transition: transform 1200ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 60ms); }
.foot__name.is-armed .foot__line:last-child .l { transition-delay: calc(240ms + var(--i) * 60ms); }
.foot__name.is-in .l { transform: none; }

@media (prefers-reduced-motion: reduce) {
    .bar { transition: none; }
    .roll__in { transition: none; }
    .has-roll:hover .roll__in, .has-roll:focus-visible .roll__in { transform: none; }
}
