:root {
  --bg: #f7f6f0;
  --bg-dark: #edece4;
  --ink: #0c0c0c;
  --ink-2: #282828;
  --muted: #67665f;
  --gutter: clamp(16px, 10vw, 128px);
  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 65px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
img { display: block; }
a { color: inherit; }

/* Accessibility helpers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 8px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; text-decoration: none; font-size: 16px;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: calc(1024px + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Header */
/* Sticky header: 48px margin + 16px padding keeps the logo at 64px from the top, as in Figma */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: 48px;
  padding-block: 16px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: rgba(12,12,12,.08); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { width: 32px; height: 32px; }
.nav { display: flex; gap: 32px; }
.nav a {
  font-size: 20px;
  line-height: 23px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); }

/* About */
.about {
  display: flex;
  align-items: flex-end;
  gap: 45px;
  padding-top: 47px;
  padding-bottom: 64px;
}
.about-photo {
  width: 479px;
  height: 476px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 38%;
}
.about-text { display: flex; flex-direction: column; gap: 16px; width: 501px; flex-shrink: 0; }
.about-name { display: flex; flex-direction: column; gap: 4px; }
.about h1 { font-size: 24px; font-weight: 700; line-height: normal; color: var(--ink); }
.subtitle { font-size: 16px; line-height: 19px; color: var(--muted); }
.about .body { color: var(--ink); }

/* Shared text */
/* Figma rounds 140% of 16px to whole-pixel 22px lines */
.body { font-size: 16px; line-height: 22px; color: #000; }
.body p + p { margin-top: 22px; }
.label {
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Bands */
.band { padding-block: 64px; }
.band .wrap { display: flex; flex-direction: column; gap: 45px; }
.section-title { font-size: 24px; font-weight: 700; line-height: normal; color: var(--ink); }

/* Projects */
.projects { display: flex; flex-direction: column; gap: 120px; }
.project { display: flex; flex-direction: column; gap: 32px; }
.project-info { display: flex; flex-direction: column; gap: 16px; }
.project h3 { font-size: 20px; font-weight: 700; line-height: normal; color: var(--ink); }
.project-cols { display: flex; gap: 48px; align-items: flex-start; }
.col-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.col-side { width: var(--side); flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.meta { display: flex; flex-direction: column; gap: 8px; }
.meta p:not(.label), .meta ul { font-size: 16px; line-height: 22px; color: var(--ink-2); }
.meta ul { list-style: none; }
.meta li::before { content: "• "; }

/* Image carousel */
.carousel {
  position: relative;
  background: var(--bg-dark);
  border-radius: 8px;
  aspect-ratio: 1024 / 437;
}
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; }
/* Only hide inactive slides once the script has marked one active, so the first image never fades in */
.carousel.is-ready .slide { opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s; }
.carousel.is-ready .slide.is-active { opacity: 1; visibility: visible; }
.slide-full { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
/* Full-screen product shots float like the Figma "Full page" frame */
.slide-img.screen { border-radius: 3.613px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
/* Transparent PNG centered on the card; width is set per image to match Figma */
.slide-img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: auto; max-width: none; }
.stage { position: absolute; inset: 0; }
.stage > img, .stage > span { position: absolute; }
.crop { overflow: hidden; }
.crop img { position: absolute; max-width: none; }
.shadow {
  filter: drop-shadow(0 2.476px 3.714px rgba(0,0,0,.04)) drop-shadow(0 6.19px 11.143px rgba(0,0,0,.05)) drop-shadow(0 11.143px 34.667px rgba(0,0,0,.1));
}
.shadow-sm {
  filter: drop-shadow(0 1.193px 1.789px rgba(0,0,0,.04)) drop-shadow(0 2.981px 5.366px rgba(0,0,0,.05)) drop-shadow(0 5.366px 16.695px rgba(0,0,0,.1));
}
.blur {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  background: rgba(0,0,0,.01);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.carousel-btn svg { width: 16px; height: 16px; }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
.carousel:hover .carousel-btn, .carousel-btn:focus-visible { opacity: 1; }
.carousel-btn:hover { background: #fff; }
@media (hover: none) { .carousel-btn { opacity: 1; } }
.carousel-btn:disabled { opacity: 0 !important; pointer-events: none; }
.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.carousel-dots button {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(12,12,12,.2); cursor: pointer;
}
.carousel-dots button[aria-current="true"] { background: var(--ink); }

/* Resume */
.resume h3.label { margin-bottom: 8px; }
.resume .col-main { max-width: 640px; }
/* Resume and Contact are narrower than the work, so center the block on the page
   (text stays left-aligned) and give them more room so they read as their own sections */
#resume .wrap, #contact .wrap { max-width: calc(640px + 2 * var(--gutter)); }
#resume { padding-top: 160px; }
#contact { padding-block: 160px; }
.resume .resume-subhead { margin-top: 64px; }
.job-summary { margin: 0; font-size: 16px; line-height: 22px; color: #000; }
.jobs { display: flex; flex-direction: column; gap: 48px; }
.job h4, .school h4 { margin: 0; font-size: 16px; font-weight: 700; line-height: 22px; color: var(--ink); }
.job .roles, .job .bullets { list-style: none; margin: 0; padding: 0; }
.job .roles { margin: 4px 0 12px; font-size: 16px; line-height: 22px; color: var(--ink-2); }
.dates { color: var(--muted); white-space: nowrap; }
.dates::before { content: "· "; }
.job .bullets { font-size: 16px; line-height: 22px; color: #000; }
.job .bullets li + li { margin-top: 12px; }
.schools { display: flex; flex-direction: column; gap: 16px; }
.school p { margin: 0; font-size: 16px; line-height: 22px; color: var(--ink-2); }

/* Contact */
.contact-links { display: flex; gap: 32px; flex-wrap: wrap; }
.contact-links a {
  font-size: 16px;
  line-height: 22px;
  color: #000;
  text-decoration: underline;
  text-underline-position: from-font;
  text-decoration-thickness: from-font;
}

/* Smaller screens */
@media (max-width: 1100px) {
  .about { flex-direction: column; align-items: flex-start; gap: 32px; }
  .about-photo { width: 100%; max-width: 479px; height: auto; aspect-ratio: 479 / 476; }
  .about-text { width: 100%; max-width: 640px; flex-shrink: 1; }
}
@media (max-width: 860px) {
  .project-cols { flex-direction: column; gap: 24px; }
  .col-side { width: 100%; }
  .project h3 { white-space: normal; }
  .projects { gap: 80px; }
}
@media (max-width: 600px) {
  .site-header { margin-top: 16px; }
  .nav { gap: 16px; }
  .nav a { font-size: 16px; }
  .about { padding-top: 23px; }
  .band { padding-block: 48px; }
  .band .wrap { gap: 32px; }
  .carousel-btn { opacity: 1; width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Apple-style "hold" scrolling on desktop (see sections.js). A panel that
   fits the screen gets .is-locked: it sits in a taller track, stays pinned
   while you scroll through the extra length, and scrolling settles onto it.
   Panels that don't fit the screen scroll normally. */
.pin-track { position: relative; }
html.pin-on { scroll-snap-type: y proximity; }
.pin-track.is-locked { scroll-snap-align: start; scroll-margin-top: 65px; }
.pin.is-locked { position: sticky; }
.project.is-locked { min-height: calc(100svh - 65px); }
.project.is-locked { justify-content: center; }
.pin-on .projects { gap: 0; }
.pin-on .project:not(.is-locked) { padding-block: 60px; }
.pin.is-measuring { min-height: 0 !important; padding-block: 0 !important; }
.pin-on .pin-fade > * {
  opacity: calc((0.25 + 0.75 * var(--enter, 1)) * (1 - 0.7 * var(--exit, 0)));
  transform: translateY(calc((1 - var(--enter, 1)) * var(--rise, 40px)));
  will-change: opacity, transform;
}
.pin-on .pin-fade > :nth-child(2) { --rise: 64px; }
