:root {
  --ink: #17162b;
  --paper: #f4f0ff;
  --cream: #fcfaff;
  --sage: #b9b2ff;
  --sage-dark: #554ca4;
  --coral: #d64f9d;
  --blue: #6e8dff;
  --line: rgba(23, 22, 43, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
a { color: inherit; text-decoration: none; }

.site-header { position: absolute; inset: 0 0 auto; z-index: 5; height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 6vw, 96px); }
.brand { font-family: "Playfair Display", serif; font-size: 1.45rem; font-weight: 600; }
.brand span, em { color: var(--coral); }
nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 46px); font-size: .86rem; font-weight: 600; }
nav a { transition: opacity .2s; }
nav a:hover { opacity: .55; }
.nav-contact { border: 1px solid currentColor; border-radius: 99px; padding: 11px 18px; }

.hero { min-height: 100svh; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, .9fr); align-items: center; gap: 5vw; padding: 120px clamp(24px, 9vw, 150px) 70px; }
.hero::before { content: ""; position: absolute; width: 40vw; height: 40vw; border: 1px solid rgba(24,37,31,.08); border-radius: 50%; left: -24vw; top: 18%; }
.eyebrow { margin: 0 0 18px; color: var(--sage-dark); font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Playfair Display", serif; font-weight: 600; line-height: .95; letter-spacing: -.045em; }
h1 { font-size: clamp(4rem, 8.5vw, 9rem); }
h1 em, h2 em { font-weight: 600; }
.intro { max-width: 540px; margin: 35px 0; font-size: clamp(1rem, 1.3vw, 1.22rem); line-height: 1.7; }
.scroll-link { display: inline-flex; align-items: center; gap: 18px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .11em; }
.arrow { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--ink); transition: transform .2s; }
.scroll-link:hover .arrow { transform: translateY(5px); }
.portrait-wrap { width: min(37vw, 540px); aspect-ratio: .78; justify-self: end; position: relative; }
.portrait-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 51% 32%; filter: saturate(.82); border-radius: 48% 48% 20px 20px; }
.portrait-accent { position: absolute; width: 58%; aspect-ratio: 1; right: -8%; top: -7%; border-radius: 50%; background: var(--sage); }
.portrait-note { position: absolute; right: -34px; bottom: 9%; display: grid; place-items: center; width: 115px; aspect-ratio: 1; border-radius: 50%; text-align: center; color: white; background: var(--coral); font-family: "Playfair Display", serif; font-style: italic; transform: rotate(8deg); }
.side-note { position: absolute; right: 28px; bottom: 50%; margin: 0; font-size: .65rem; letter-spacing: .2em; writing-mode: vertical-rl; text-transform: uppercase; }

.about { min-height: 78vh; padding: 12vw clamp(24px, 9vw, 150px); background: var(--ink); color: var(--cream); display: grid; grid-template-columns: 80px 1fr .65fr; gap: 5vw; align-items: center; }
.section-number { font-size: .72rem; letter-spacing: .15em; opacity: .6; }
.about h2, .resume h2, .contact h2 { font-size: clamp(3.1rem, 6vw, 6.5rem); }
.about-text { max-width: 460px; font-size: 1.05rem; line-height: 1.8; color: rgba(250,248,242,.72); }

.resume { padding: 130px clamp(24px, 9vw, 150px) 160px; background: var(--cream); }
.resume-heading { display: grid; grid-template-columns: 80px 1fr .65fr; gap: 5vw; align-items: end; margin-bottom: 120px; }
.resume-heading > p:last-child { line-height: 1.7; color: rgba(24,37,31,.62); }
.timeline { max-width: 1080px; margin: auto; position: relative; }
.timeline::before, .timeline-progress { position: absolute; width: 2px; left: 185px; top: 12px; bottom: 0; background: #d9ded8; }
.timeline::before { content: ""; }
.timeline-progress { z-index: 1; background: transparent; overflow: hidden; }
.timeline-progress span { display: block; height: 0; background: var(--coral); transition: height .1s linear; }
.timeline-item { display: grid; grid-template-columns: 135px 100px 1fr; position: relative; padding-bottom: 90px; }
.timeline-date { padding-top: 3px; font-size: .74rem; line-height: 1.55; letter-spacing: .08em; text-align: right; color: var(--sage-dark); }
.timeline-dot { position: relative; z-index: 2; justify-self: center; margin-top: 3px; width: 18px; height: 18px; border: 5px solid var(--cream); outline: 2px solid var(--sage); border-radius: 50%; background: var(--cream); transition: background .5s, outline-color .5s, transform .5s; }
.timeline-item.visible .timeline-dot { background: var(--coral); outline-color: var(--coral); transform: scale(1.12); }
.timeline-card { max-width: 690px; padding: 0 0 12px; }
.timeline-type { margin: 0 0 10px; color: var(--coral); font-size: .68rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.timeline-card h3 { margin: 0; font-family: "Playfair Display", serif; font-size: clamp(1.8rem, 3vw, 2.9rem); line-height: 1.1; }
.place { margin: 10px 0 22px; font-weight: 600; color: var(--sage-dark); }
.timeline-card > p:not(.timeline-type, .place) { line-height: 1.7; color: rgba(24,37,31,.67); }
.role-points { margin: 0; padding: 0; list-style: none; color: rgba(23,22,43,.7); }
.role-points li { position: relative; padding-left: 24px; line-height: 1.65; }
.role-points li + li { margin-top: 8px; }
.role-points li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(214,79,157,.12); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px; font-size: .72rem; }

.projects { padding: 130px clamp(24px, 7vw, 120px) 170px; overflow: hidden; background: #e9e5ff; }
.projects-heading { display: grid; grid-template-columns: 80px 1fr .65fr; gap: 5vw; align-items: end; margin-bottom: 100px; }
.projects-heading h2 { font-size: clamp(3.1rem, 6vw, 6.5rem); }
.projects-heading > p:last-child { line-height: 1.7; color: rgba(23,22,43,.62); }
.polaroid-grid { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: clamp(20px, 3vw, 45px); max-width: 1300px; margin: auto; perspective: 1400px; }
.polaroid { height: 410px; perspective: 1200px; }
.polaroid:nth-child(odd) { transform: rotate(-2deg); }
.polaroid:nth-child(even) { transform: rotate(2.3deg) translateY(22px); }
.polaroid-inner { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.2,.75,.2,1); }
.polaroid:hover .polaroid-inner, .polaroid:focus-visible .polaroid-inner { transform: rotateY(180deg); }
.polaroid-front, .polaroid-back { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 15px 15px 25px; backface-visibility: hidden; background: #fffdf9; box-shadow: 0 18px 35px rgba(23,22,43,.16); }
.polaroid-front img, .polaroid-media { width: 100%; height: 290px; object-fit: cover; margin-bottom: 19px; filter: saturate(.9); }
.polaroid-front img.polaroid-poster { object-fit: contain; background: #14232a; }
.polaroid-front strong { padding-inline: 8px; font-family: "Playfair Display", serif; font-size: 1.25rem; }
.polaroid-front small { padding: 6px 8px 0; color: var(--sage-dark); }
.polaroid-back { justify-content: center; padding: 38px; color: white; background: var(--ink); transform: rotateY(180deg); }
.polaroid-back strong { font-family: "Playfair Display", serif; font-size: 1.8rem; }
.polaroid-back p { line-height: 1.65; color: rgba(255,255,255,.72); }
.polaroid-back > span { margin-top: 20px; color: #dfb9ff; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.prototype-back { background: var(--blue); }
.prototype-back > span { color: white; }

.reveal { opacity: 0; transform: translateY(55px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; transform: none; }
.contact { min-height: 75vh; padding: 12vw 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--sage); }
.contact a { margin-top: 50px; border-bottom: 1px solid currentColor; padding-bottom: 8px; font-size: clamp(1rem, 2vw, 1.4rem); }
footer { display: flex; justify-content: space-between; padding: 28px clamp(24px, 6vw, 96px); color: var(--cream); background: var(--ink); font-size: .75rem; }

@media (max-width: 760px) {
  .site-header { height: 75px; }
  nav a:not(.nav-contact) { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 110px; text-align: center; }
  .hero-copy { z-index: 2; }
  .intro { margin-inline: auto; }
  .portrait-wrap { width: min(86vw, 430px); justify-self: center; margin-top: 25px; }
  .portrait-note { right: -8px; }
  .side-note { display: none; }
  .about, .resume-heading, .projects-heading { grid-template-columns: 1fr; gap: 24px; }
  .about { min-height: auto; padding-block: 110px; }
  .resume { padding-block: 100px; }
  .resume-heading { margin-bottom: 85px; }
  .timeline::before, .timeline-progress { left: 9px; }
  .timeline-item { grid-template-columns: 20px 1fr; gap: 20px; padding-bottom: 75px; }
  .timeline-date { grid-column: 2; grid-row: 1; text-align: left; margin-bottom: 14px; }
  .timeline-dot { grid-column: 1; grid-row: 1 / span 2; width: 16px; height: 16px; }
  .timeline-card { grid-column: 2; }
  .projects { padding-block: 100px 130px; }
  .projects-heading { margin-bottom: 70px; }
  .polaroid-grid { grid-template-columns: 1fr; max-width: 340px; gap: 55px; }
  .polaroid:nth-child(n) { transform: rotate(-1deg); }
  .polaroid:nth-child(even) { transform: rotate(1deg); }
}

@media (min-width: 761px) and (max-width: 1100px) { .polaroid-grid { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
