/* Alok Kulkarni — portfolio. Dark room, software first, film for the eye. Unbounded / Onest, lunar and bronze. */

:root {
  --bg: #111111;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --ink: #f2f2f2;
  --muted: #a6a6a6;
  --accent: #a08672;
  --accent-hi: #c2a690;
  --accent-ink: #111111;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --small: 0.875rem;
  --body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --lead: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --head: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --giant: clamp(2.25rem, 0.4rem + 7.4vw, 8rem);

  --wrap: 1320px;
  --m: clamp(20px, 4vw, 56px);
  --gap: clamp(16px, 2.4vw, 32px);
  --section: clamp(96px, 11vw, 168px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.btn {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink); font-weight: 500;
  border-radius: 999px;
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}
.btn:hover { background: var(--accent-hi); }
.btn:active { transform: scale(0.97); }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; transition: color 200ms var(--ease); }
.link:hover { color: var(--accent-hi); }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  height: 72px; padding: 0 max(var(--m), calc((100vw - var(--wrap)) / 2));
  transition: background-color 300ms var(--ease);
}
.bar.is-solid { background: var(--bg); }
.bar__mark { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.04em; font-size: 20px; }
.bar__links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); font-size: 15px; }
.bar__links a:not(.bar__cta) { transition: color 200ms var(--ease); }
.bar__links a:not(.bar__cta):hover { color: var(--accent-hi); }
.bar__cta { padding: 9px 18px; background: var(--ink); color: var(--bg); border-radius: 999px; font-weight: 500; transition: background-color 200ms var(--ease); }
.bar__cta:hover { background: var(--accent-hi); }

/* ---------- hero: full-bleed footage, name on top ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: #000;
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  animation: drift 16s var(--ease) both;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient( /* taste-skill-ignore: neutral scrim so the name reads over footage */to top, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.55) 38%, rgba(10,10,10,0.12) 70%, rgba(10,10,10,0.4) 100%);
}
@keyframes drift { from { transform: scale(1.1); } to { transform: scale(1.02); } }
.hero__copy {
  position: relative; z-index: 1;
  width: 100%; max-width: calc(var(--wrap) + var(--m) * 2);
  margin: 0 auto; padding: 0 var(--m) clamp(40px, 6vh, 72px);
}
.hero__title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.045em; line-height: 0.88;
  font-size: var(--giant);
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .line > span { display: block; }
.hero__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: var(--gap); margin-top: clamp(28px, 4vh, 44px);
}
.hero__lede { max-width: 48ch; font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem); line-height: 1.45; }
.hero__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; font-size: var(--small); }

/* ---------- main two-column layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 96px);
  max-width: calc(var(--wrap) + var(--m) * 2);
  margin: 0 auto;
  padding: var(--section) var(--m) 0;
}
.side__in { position: sticky; top: 112px; display: grid; gap: 32px; }
.side__about { font-size: var(--lead); line-height: 1.4; }
.side__facts { display: grid; gap: 6px; color: var(--muted); }
.side__nav { display: grid; gap: 4px; }
.side__nav a {
  display: inline-flex; align-items: center; gap: 14px; padding: 6px 0;
  color: var(--muted); font-weight: 500; transition: color 200ms var(--ease);
}
.side__nav a::before { content: ""; width: 28px; height: 2px; background: currentColor; transition: width 300ms var(--ease); }
.side__nav a:hover, .side__nav a.is-on { color: var(--ink); }
.side__nav a.is-on::before { width: 56px; background: var(--accent); }
.side__social { display: flex; gap: 24px; }
.side__social a { color: var(--muted); transition: color 200ms var(--ease); }
.side__social a:hover { color: var(--ink); }

.flow { display: grid; gap: var(--section); padding-bottom: var(--section); }
.block__h {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.03em; line-height: 1; font-size: var(--head);
  margin-bottom: clamp(28px, 3.5vw, 48px);
}
h3 { font-size: var(--lead); font-weight: 500; line-height: 1.3; }
h3 a { transition: color 200ms var(--ease); }
h3 a::after { content: " ↗"; color: var(--muted); font-size: 0.8em; transition: transform 200ms var(--ease), color 200ms; display: inline-block; }
h3 a:hover { color: var(--accent-hi); }
h3 a:hover::after { color: var(--accent-hi); transform: translate(2px, -2px); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags li { padding: 4px 12px; background: var(--surface-2); color: var(--ink); border-radius: 999px; font-size: var(--small); }

/* featured project */
.feat { display: grid; gap: 24px; margin-bottom: 56px; }
.feat__body p { margin-top: 10px; color: var(--muted); max-width: 62ch; }
.feat__body h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); }

/* stat panels stand in where a project has no screen to show */
.stat {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  aspect-ratio: 16 / 9; padding: clamp(22px, 3vw, 40px);
  background: var(--surface); border-radius: var(--r);
}
.stat__big { font-family: var(--display); font-weight: 700; font-size: clamp(3.5rem, 2rem + 6vw, 7.5rem); line-height: 0.9; letter-spacing: -0.04em; color: var(--ink); }
.stat__big small { font-family: var(--text); font-weight: 500; font-size: var(--lead); letter-spacing: 0; margin-left: 12px; color: var(--accent-hi); }
.stat__cap { color: var(--muted); }
.stat__bars { display: grid; gap: 8px; margin-top: 12px; font-size: var(--small); color: var(--muted); font-variant-numeric: tabular-nums; }
.stat__bars div { display: grid; grid-template-columns: 80px 1fr 88px; align-items: center; gap: 12px; }
.stat__bars b { color: var(--ink); font-weight: 500; text-align: right; }
.stat__bars i { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.stat__bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent); border-radius: 4px; transform-origin: left; transition: transform 1100ms var(--ease) 200ms; }
.stat--sm { padding: 18px 20px; gap: 4px; }
.stat--sm .stat__big { font-size: clamp(2.4rem, 1.6rem + 2vw, 3.4rem); }
.stat--sm .stat__big small { font-size: var(--small); margin-left: 6px; }
.stat--sm .stat__cap { font-size: var(--small); line-height: 1.35; }

/* project list */
.projects { display: grid; gap: 12px; }
.proj {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(18px, 2.4vw, 32px);
  align-items: center; padding: 16px; margin: 0 -16px; border-radius: calc(var(--r) + 4px);
  transition: background-color 250ms var(--ease);
}
.proj:hover { background: var(--surface); }
.proj__thumb { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r); background: var(--surface); }
.proj:hover .proj__thumb.stat { background: var(--surface-2); }
.proj__thumb img, .proj__thumb video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform 600ms var(--ease); }
.proj:hover .proj__thumb img, .proj:hover .proj__thumb video { transform: scale(1.04); }
.proj__thumb--phone { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 18%; }
.proj__thumb--phone img { object-fit: contain; }
.proj:hover .proj__thumb--phone img { transform: none; }
.proj__body p { margin-top: 6px; color: var(--muted); }
.proj .tags { margin-top: 12px; }
.more { margin-top: 32px; }

/* experience */
.job { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--gap); padding: 20px 0; }
.job + .job { margin-top: 12px; }
.job__when { color: var(--accent-hi); font-size: var(--small); padding-top: 4px; font-variant-numeric: tabular-nums; }
.job p:not(.job__when) { margin-top: 8px; color: var(--muted); max-width: 62ch; }

/* skills */
.skills > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--gap); padding: 14px 0; }
.skills dt { font-weight: 500; }
.skills dd { color: var(--muted); }

/* ---------- film: a fixed bento of clips ---------- */
.film { padding: var(--section) 0; background: #0b0b0b; }
.film__head, .strip { max-width: calc(var(--wrap) + var(--m) * 2); margin: 0 auto; padding-left: var(--m); padding-right: var(--m); }
.film__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: end; padding-bottom: 48px; }
.film__h { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.03em; line-height: 1; font-size: var(--head); }
.film__lede { color: var(--muted); max-width: 52ch; }
.strip {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(220px, 24vw, 340px); gap: 14px; grid-auto-flow: dense;
}
.clip { position: relative; overflow: hidden; border-radius: var(--r); background: var(--surface); grid-column: span 3; }
.clip--wide, .clip.grade { grid-column: span 6; }
.clip > img, .clip > video { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
.clip:hover > img, .clip:hover > video { transform: scale(1.04); }
.clip--tall > img { object-position: 50% 30%; }
.clip figcaption {
  position: absolute; left: 14px; bottom: 14px; padding: 6px 12px;
  background: rgba(17,17,17,0.8); border-radius: 999px; font-size: var(--small); pointer-events: none;
}

/* the grade control: a real piece of a grading tool */
.grade__frame { position: absolute; inset: 0; cursor: ew-resize; touch-action: pan-y; }
.grade__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.grade__graded { clip-path: inset(0 0 0 var(--x)); }
.grade__handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.grade__handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--ink); transition: transform 200ms var(--ease); }
.grade__frame:hover .grade__handle::after { transform: scale(1.2); }
.grade__tag { position: absolute; top: 14px; padding: 4px 10px; background: rgba(17,17,17,0.8); border-radius: 999px; font-size: 13px; pointer-events: none; }
.grade__tag--l { left: 14px; }
.grade__tag--r { right: 14px; }
.grade__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.grade__frame:has(.grade__range:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: -2px; }

/* ---------- contact ---------- */
.contact {
  max-width: calc(var(--wrap) + var(--m) * 2); margin: 0 auto;
  padding: var(--section) var(--m) var(--m);
  display: grid; gap: clamp(24px, 4vw, 48px);
}
.contact__h { font-size: var(--lead); font-weight: 500; color: var(--muted); }
.contact__mail {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-size: clamp(1.5rem, 0.2rem + 5.2vw, 5.4rem);
  overflow-wrap: anywhere; transition: color 250ms var(--ease);
}
.contact__mail:hover { color: var(--accent-hi); }
.contact__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-top: 32px; color: var(--muted); font-size: var(--small); }
.contact__links { display: flex; gap: 24px; }
.contact__links a:hover { color: var(--ink); }

/* ---------- motion ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 800ms var(--ease) var(--d, 0ms), transform 900ms var(--ease) var(--d, 0ms); }
html.js [data-reveal].in { opacity: 1; transform: none; }
html.js .hero__title .line > span { transform: translateY(105%); }
html.js .hero__row { opacity: 0; transform: translateY(16px); }
html.js body.loaded .hero__title .line > span { transform: none; transition: transform 1000ms var(--ease); }
html.js body.loaded .hero__title .line:nth-child(2) > span { transition-delay: 110ms; }
html.js body.loaded .hero__row { opacity: 1; transform: none; transition: opacity 800ms var(--ease) 550ms, transform 800ms var(--ease) 550ms; }
html.js .stat__bars i::after { transform: scaleX(0); }
html.js .feat.in .stat__bars i::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; transition-delay: 0ms !important; }
  html.js [data-reveal], html.js .hero__title .line > span, html.js .hero__row { transform: none !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .side__in { position: static; }
  .side__nav, .side__social, .side__facts { display: none; }
  .strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .clip--wide, .clip.grade { grid-column: span 6; }
  .film__head { grid-template-columns: minmax(0, 1fr); }
  .film__lede { justify-self: start; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .bar { height: 60px; }
  .bar__links a:not(.bar__cta) { display: none; }
  .hero__row { grid-template-columns: minmax(0, 1fr); }
  .hero__actions { align-items: flex-start; }
  .hero__lede { font-size: 1.125rem; }
  .proj { grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; }
  .proj:hover { background: transparent; }
  .projects { gap: 40px; }
  .stat__bars div { grid-template-columns: 70px 1fr 80px; }
  .job, .skills > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 46vw; gap: 10px; }
  .clip { grid-column: span 1; }
  .clip--wide, .clip.grade { grid-column: span 2; height: auto; }
  .clip figcaption { font-size: 13px; left: 10px; bottom: 10px; }
}

/* keep every column from growing past its track */
.flow { grid-template-columns: minmax(0, 1fr); }
.flow > *, .feat > *, .proj > *, .layout > *, .hero__row > * { min-width: 0; }
.block__h, .film__h { overflow-wrap: anywhere; }
.hero__btns { display: flex; gap: 10px; }
.btn--ghost { background: rgba(242, 242, 242, 0.12); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 640px) { .bar__links a[href*="github"] { display: inline; } }
.job__where { margin-top: 2px !important; color: var(--muted); font-size: var(--small); }
.job__list { display: grid; gap: 8px; margin-top: 12px; color: var(--muted); max-width: 64ch; }
.job__list li { position: relative; padding-left: 18px; }
.job__list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.feat__media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: var(--surface); }
.feat__media video { width: 100%; height: 100%; object-fit: cover; }
.proj__thumb img[src*="thumbs/"] { object-position: 50% 50%; }

.side__about { font-size: clamp(1.375rem, 1.1rem + 0.6vw, 1.75rem); line-height: 1.3; }
.side__stats { display: grid; gap: 18px; }
.side__stats > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: baseline; gap: 14px; }
.side__stats dt { font-family: var(--display); font-weight: 700; font-size: 2.4rem; line-height: 1; letter-spacing: -0.04em; color: var(--accent-hi); }
.side__stats dd { color: var(--muted); line-height: 1.4; }
@media (max-width: 1000px) {
  .side__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .side__stats > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 640px) { .side__stats dt { font-size: 2rem; } .side__stats dd { font-size: var(--small); } }

.side__film { position: relative; width: min(100%, 300px); aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r); background: var(--surface); }
.side__film video { width: 100%; height: 100%; object-fit: cover; }
.side__film figcaption { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 5px 10px; width: max-content; max-width: calc(100% - 20px); background: rgba(17,17,17,0.8); border-radius: 999px; font-size: 13px; line-height: 1.3; }
@media (max-width: 1000px) { .side__film { width: min(100%, 360px); } }

@media (max-width: 1000px) { .side__in { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .side__stats { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side__stats > div { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .side__about { font-size: 1.375rem; }
}

@media (max-width: 1000px) { .layout { gap: clamp(96px, 16vw, 140px); } }

/* the email always fits: one line on wide screens, broken after the @ on phones; JS fits the size */
.contact__mail { overflow-wrap: normal; white-space: nowrap; font-size: 5vw; }
.contact__mail span { display: inline-block; }
@media (max-width: 640px) { .contact__mail { white-space: normal; font-size: 11vw; } .contact__mail span { display: block; width: max-content; } }

/* links that look like links */
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.lbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: var(--small);
  text-decoration: none; transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.lbtn span { transition: transform 200ms var(--ease); }
.lbtn:hover { background: var(--ink); color: var(--bg); }
.lbtn:hover span { transform: translate(2px, -2px); }
.lbtn--main { background: var(--accent); color: var(--accent-ink); }
.lbtn--main:hover { background: var(--accent-hi); color: var(--accent-ink); }
.links--none { color: var(--muted); font-size: var(--small); }
h3 a { text-decoration: underline; text-decoration-color: rgba(194, 166, 144, 0.5); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
h3 a::after { color: var(--accent-hi); }
h3 a:hover { text-decoration-color: var(--accent-hi); }
.bar__links a:not(.bar__cta) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; text-decoration-color: rgba(242,242,242,0.4); }


/* ================= motion layer (motion.js) ================= */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* the name, letter by letter */
html.motion .hero__title .line > span { transform: none !important; transition: none !important; }
.hero__title .ch { display: inline-block; white-space: pre; transform: translate3d(0, 112%, 0) rotate(6deg); transform-origin: 0 100%;
  transition: transform 1100ms var(--ease) calc(120ms + var(--i) * 38ms); }
body.loaded .hero__title .ch { transform: none; }
html.motion .hero__video { animation: none; will-change: transform; }
html.motion .hero__copy { will-change: transform, opacity; }

/* headings, word by word */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .w > span { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform 900ms var(--ease) calc(var(--i) * 70ms); }
.split.on .w > span { transform: none; }

/* film tiles wipe open, then their footage drifts with the scroll */
html.motion .clip { clip-path: inset(100% 0 0 0 round var(--r)); transition: clip-path 1200ms var(--ease) calc(var(--ci) * 110ms); }
html.motion .clip.open { clip-path: inset(0 0 0 0 round var(--r)); }
html.motion .clip > img, html.motion .clip > video { transform: scale(1.06); transition: none; will-change: transform; }
html.motion .clip:hover > img, html.motion .clip:hover > video { transform: scale(1.06); }
html.motion .clip figcaption { transform: translateY(8px); opacity: 0; transition: transform 600ms var(--ease) 500ms, opacity 600ms var(--ease) 500ms; }
html.motion .clip.open figcaption { transform: none; opacity: 1; }

/* nav links: an underline that draws in from the left */
.bar__links a:not(.bar__cta) { position: relative; text-decoration: none; padding: 6px 0; }
.bar__links a:not(.bar__cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 1px;
  background: var(--accent-hi); transform: scaleX(0); transform-origin: right; transition: transform 450ms var(--ease); }
.bar__links a:not(.bar__cta):hover::after, .bar__links a:not(.bar__cta):focus-visible::after { transform: scaleX(1); transform-origin: left; }
.bar__links a:not(.bar__cta):hover { color: var(--ink); }

/* magnetic + tilt */
.mag { transition: transform 400ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease); will-change: transform; }
.tilt { transition: transform 500ms var(--ease); transform-style: preserve-3d; will-change: transform; }

/* ================= the hand-drawn note ================= */
.note { position: absolute; z-index: 5; pointer-events: none; transform: rotate(-5deg); transform-origin: left bottom; }
.note__text { display: inline-block; font-family: "Caveat", "Comic Sans MS", cursive; font-weight: 700; line-height: 0.95;
  font-size: clamp(2.4rem, 1.5rem + 2.6vw, 4.2rem); color: #f2f2f2;
  clip-path: inset(-10% 100% -10% 0); transition: clip-path 1100ms steps(22, end); }
.note.on .note__text { clip-path: inset(-10% -5% -10% 0); }
.note.off { opacity: 0; transform: rotate(-5deg) translateY(-14px); transition: opacity 600ms var(--ease), transform 700ms var(--ease); }
.note__arrow { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; overflow: visible; }
.note__stroke { fill: none; stroke: #f2f2f2; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.note__arrow.on .note__stroke { stroke-dashoffset: 0 !important; transition: stroke-dashoffset 800ms cubic-bezier(0.65, 0, 0.35, 1) 950ms; }
.note__arrow.on .note__stroke + .note__stroke { transition-delay: 1700ms; transition-duration: 260ms; }
.note__arrow.off { opacity: 0; transition: opacity 500ms var(--ease); }


/* ================= prelude: only the footage, then the site arrives ================= */
html.prelude .bar, html.prelude .hero__copy { opacity: 0 !important; pointer-events: none; }
html.prelude .hero::after { opacity: 0.45; }
.hero::after { transition: opacity 1200ms var(--ease); }
html.arrived .bar { animation: arriveBar 900ms var(--ease) 500ms both; }
@keyframes arriveBar { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
html.prelude .hero__video { animation: fadeUp 1400ms var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; filter: brightness(0.5); } to { opacity: 1; filter: none; } }
.note { z-index: 6; }

/* the hand-off: erase the note, retract the arrow, the site rises underneath, all overlapping */
.note.erase .note__text { clip-path: inset(-10% -5% -10% 105%); transition: clip-path 900ms cubic-bezier(0.65, 0, 0.35, 1); }
.note__arrow.erase .note__stroke { transition: stroke-dashoffset 650ms cubic-bezier(0.65, 0, 0.35, 1) 120ms; }
.note__arrow.erase .note__stroke + .note__stroke { transition-duration: 220ms; transition-delay: 0ms; }
html.arrived .hero::after { transition: opacity 1400ms cubic-bezier(0.33, 1, 0.68, 1); }
html.arrived .hero__title .ch { transition-duration: 1200ms; }
html.arrived .bar { animation-delay: 650ms; }

/* résumé in the bar: an outlined pill between the links and Contact */
.bar .bar__links a.bar__resume { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  background: rgba(242, 242, 242, 0.12); color: var(--ink); font-weight: 500; text-decoration: none !important;
  transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.bar__resume::after { display: none !important; }
.bar .bar__links a.bar__resume:hover { background: var(--accent-hi); color: var(--accent-ink); }
.bar__resume span { transition: transform 200ms var(--ease); }
.bar__resume:hover span { transform: translate(2px, -2px); }
@media (max-width: 640px) {
  .bar__links a[href*="github"] { display: none; }
  .bar .bar__links a.bar__resume { display: inline-flex !important; padding: 7px 13px; }
}

/* profile buttons: logo + name, same family as the project link buttons */
.side__social, .contact__links { display: flex; flex-wrap: wrap; gap: 10px; }
.sbtn { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 16px 0 13px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink) !important; font-size: var(--small); font-weight: 500; text-decoration: none !important;
  transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.sbtn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.sbtn:hover { background: var(--ink); color: var(--bg) !important; }
.contact__links .sbtn { min-height: 40px; }

/* the pinned side column must fit the screen: compact, and pinned only when there is room */
.side__in { gap: 28px; }
.side__film { width: min(100%, 248px); }
@media (max-height: 820px) { .side__in { position: static; } }

/* a quiet hint during the opening */
.skiphint { position: absolute; left: 50%; bottom: clamp(20px, 4vh, 40px); z-index: 6; transform: translateX(-50%);
  font-size: 13px; color: rgba(242, 242, 242, 0.55); letter-spacing: 0.01em; white-space: nowrap; pointer-events: none;
  animation: hintIn 800ms var(--ease) 1600ms both; }
.skiphint.off { opacity: 0 !important; transition: opacity 400ms var(--ease); }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* the pinned column stops a full section gap above the film section, never flush against it */
.side { padding-bottom: var(--section); }
@media (max-width: 1000px) { .side { padding-bottom: 0; } }
.side__social { margin-top: -6px; }
