/* Home page, scene by scene. */

main > section { background: transparent; }

/* ---------- hero: title card ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 0 var(--gutter) clamp(72px, 7vw, 96px);
}
.hero__inner { position: relative; width: 100%; max-width: var(--maxw); margin: 0 auto; padding-top: 120px; }
.hero__title {
  max-width: 11.5em;
  margin-top: clamp(16px, 2vw, 28px);
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6.6vw, 7.4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.9;
  padding-bottom: 0.08em;
  text-wrap: balance;
}
.hero__title em { color: var(--accent); }
.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 40px;
  margin-top: clamp(32px, 4.4vw, 60px);
}
.hero__sub { max-width: 34ch; font-size: clamp(1rem, 1.3vw, 1.18rem); color: var(--text-dim); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero__mail { font-size: 0.95rem; color: var(--text-dim); }

/* ---------- about ---------- */

.about__statement {
  max-width: 20em;
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.about__statement .word { display: inline-block; }

/* ---------- projects: each one a scene ---------- */

.films { display: grid; gap: clamp(88px, 12vw, 180px); margin-top: clamp(48px, 7vw, 104px); }
.film { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2vw, 32px); row-gap: 20px; align-items: start; }
.film__rail {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.film__no { font-family: var(--font-serif); font-size: clamp(2.4rem, 4vw, 3.6rem); line-height: 0.8; color: var(--accent); }
.film__frame { grid-row: 2; grid-column: 1 / span 7; }
.film__text { grid-row: 2; grid-column: 8 / -1; align-self: center; }
.film--right .film__frame { grid-column: 6 / -1; }
.film--right .film__text { grid-column: 1 / span 5; }

.film__kind { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.film__title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5.6vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.92;
  padding-bottom: 0.06em;
  text-wrap: balance;
}
.film__desc { max-width: 54ch; margin: 22px 0; font-size: 0.97rem; color: var(--text-dim); }
.film__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; font-size: 0.92rem; }

/* Frame: letterboxed screenshot with a lit edge; the image drifts inside it. */
.media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 40px 80px -40px oklch(0.05 0.01 255 / 0.9), 0 0 0 1px oklch(1 0 0 / 0.02) inset;
}
.media::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, oklch(0.76 0.145 62 / 0.08), transparent 35%, oklch(0.06 0.01 255 / 0.35)); }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.media:hover img { transform: scale(1.04); }
/* A soft light follows the pointer across the screenshot (home.js sets --mx and --my). */
.media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), oklch(0.93 0.07 75 / 0.22), transparent 62%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.media:hover::before { opacity: 1; }
.reduce .media::before { display: none; }

/* ---------- skills: end credits, a role on the left and its names on the right ---------- */

.skills { padding-block: clamp(64px, 8vw, 120px); }
.credits { display: grid; gap: clamp(14px, 1.6vw, 22px); margin-top: clamp(28px, 4vw, 52px); }
.credits > div { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 6px 40px; align-items: baseline; }
.credits dt { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.credits dd { margin: 0; max-width: 34em; font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.2; color: var(--text); }

/* ---------- education: plain list ---------- */

.edu { margin-top: clamp(40px, 6vw, 88px); border-top: 1px solid var(--line); }
.edu__row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 16px 40px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.edu__when { padding-top: 0.7em; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim); }
.edu__title { font-family: var(--font-serif); font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 400; letter-spacing: -0.015em; line-height: 1.05; }
.edu__org { margin-top: 8px; color: var(--accent); }
.edu__note { max-width: 62ch; margin-top: 8px; font-size: 0.95rem; color: var(--text-dim); }

/* ---------- experience ---------- */

.timeline { position: relative; margin-top: clamp(40px, 6vw, 88px); padding-left: clamp(24px, 4vw, 56px); }
.timeline__line { position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline__fill { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.reduce .timeline__fill { transform: none; }
.entry { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 16px 40px; padding-bottom: clamp(56px, 8vw, 112px); }
.entry:last-child { padding-bottom: 0; }
.entry__when { padding-top: 0.9em; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); }
.entry__org { font-family: var(--font-serif); font-size: clamp(2.2rem, 4.2vw, 3.8rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1; }
.entry__role { margin-top: 10px; color: var(--accent); }
.entry__loc { margin-top: 4px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-dim); }
.entry__list { display: grid; gap: 14px; max-width: 62ch; margin-top: 24px; color: var(--text-dim); }
.entry__list li { position: relative; padding-left: 1.3em; }
.entry__list li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--accent); }
.entry__list b { font-weight: 500; color: var(--text); }

/* ---------- contact: the end ---------- */

.contact { padding-block: clamp(96px, 10vw, 160px) clamp(48px, 5vw, 72px); }
.contact .section-title { font-size: clamp(4.4rem, 15vw, 14rem); }
.contact__mail {
  display: inline-block;
  max-width: 100%;
  margin-top: clamp(24px, 3vw, 40px);
  padding-bottom: 0.12em;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6.4vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--line-strong), var(--line-strong));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 3px, 100% 1px;
  transition: background-size 0.7s var(--ease), color 0.3s;
}
.contact__mail:hover, .contact__mail:focus-visible { background-size: 100% 3px, 100% 1px; color: var(--accent); }
.contact__cv { display: flex; width: fit-content; margin-top: clamp(24px, 2.4vw, 36px); }
.contact__list { display: grid; gap: 12px; max-width: 520px; margin-top: clamp(28px, 3vw, 44px); font-family: var(--font-mono); font-size: 0.95rem; }
.contact__list li { display: flex; align-items: baseline; gap: 24px; }
.contact__k { width: 6.5em; color: var(--text-dim); }

/* ---------- small screens ---------- */

@media (max-width: 899px) {
  .film { row-gap: 24px; }
  .film__frame, .film--right .film__frame, .film__text, .film--right .film__text { grid-row: auto; grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .credits { gap: 24px; }
  .credits > div { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .entry__when { padding-top: 0; }
  .edu__row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- legibility over the moving background: every block of text sits in its own soft shadow ---------- */

.hero__sub, .film__text, .entry__main, .edu__row > div, .credits { position: relative; isolation: isolate; }
/* the rail is a thin strip, so its shadow is a band rather than a pool */
.film__rail { isolation: isolate; }
.film__rail::before { content: ''; position: absolute; inset: -18px -24px -6px; z-index: -1; background: radial-gradient(farthest-side, oklch(0.115 0.01 255 / 0.7), oklch(0.115 0.01 255 / 0.35) 70%, transparent); pointer-events: none; }
.film__text::before, .entry__main::before, .edu__row > div::before, .credits::before {
  content: '';
  position: absolute;
  inset: -34px -46px;
  z-index: -1;
  background: radial-gradient(closest-side, oklch(0.115 0.01 255 / 0.66), oklch(0.115 0.01 255 / 0.32) 58%, transparent);
  pointer-events: none;
}
.hero__sub, .film__desc, .entry__list, .edu__note, .contact__list, .credits,
.film__rail, .film__kind, .entry__when, .entry__org, .entry__role, .entry__loc, .edu__when, .edu__org, .edu__title, .about__statement, .eyebrow {
  text-shadow: 0 0 12px oklch(0.12 0.01 255), 0 0 26px oklch(0.12 0.01 255 / 0.8);
}
.film__desc, .entry__list, .edu__note { color: oklch(0.8 0.012 255); }

/* the shadows must not push the page wider than the screen */
@media (max-width: 899px) {
  .film__text::before, .entry__main::before, .edu__row > div::before, .credits::before { inset: -26px -14px; }
  .film__rail::before { inset: -14px -10px -6px; }
}
