/* ============ Alveria Cher — Portfolio 2026 ============ */
@font-face { font-family: "EB Garamond"; font-weight: 400; font-display: swap; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }

/* 1 design unit = 1px on the 1512px Figma frame, scaled to the viewport */
:root {
  --u: calc(min(100vw, 1920px) / 1512);
  --black: #000;
  --white: #fff;
  --grey: #8c8c8c;
  --grey-dark: #595959;
  --sit-red: #da291c;
  --serif: "EB Garamond", "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, sans-serif;
  --track: 0.1715em; /* 2.4px @ 14px */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.frame { position: relative; width: 100%; max-width: 1920px; margin: 0 auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
}
.nav__inner {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1920px; margin: 0 auto;
  padding: calc(64 * var(--u)) calc(120 * var(--u)) 24px;
  font: 600 14px/1 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.nav__right { display: flex; justify-content: space-between; width: 193px; }
.nav a { position: relative; padding: 4px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: var(--track); bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav--overlay { position: absolute; left: 0; right: 0; background: transparent; }

/* ---------- Homepage hero (always fits one screen; scroll swaps the text, not the page) ---------- */
body.home-page { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.hero {
  /* scale by width, but never taller than the screen */
  --hu: min(var(--u), calc(100vh / 982));
  position: relative;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
@supports (height: 100dvh) { .hero { --hu: min(var(--u), calc(100dvh / 982)); } }
.hero__name {
  position: absolute; left: 50%; top: 50%;
  width: calc(1512 * var(--hu)); height: calc(438 * var(--hu));
  transform: translate(-50%, -50%);
  font: 400 calc(140 * var(--hu))/1.3 var(--serif);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__name span { position: absolute; }
.hero__name span:nth-child(1) { left: calc(416 * var(--hu)); top: 0; }
.hero__name span:nth-child(2) { left: calc(594 * var(--hu)); top: calc(130 * var(--hu)); }
.hero__name span:nth-child(3) { left: calc(767 * var(--hu)); top: calc(256 * var(--hu)); }

/* scenes: Hello → About → Skills, stacked in the same screen; only the active one shows */
.hero__scene { position: absolute; inset: 0; }
.hero__scene:not([data-scene="hello"]) { display: none; }          /* no-JS: Hello only */
.scenes-ready .hero__scene:not([data-scene="hello"]) { display: block; }
.scenes-ready .hero__scene { visibility: hidden; pointer-events: none; }
.scenes-ready .hero__scene.is-active,
.scenes-ready .hero__scene.is-leaving { visibility: visible; }
.scenes-ready .hero__scene.is-active { pointer-events: auto; }

/* the page itself never scrolls: home.js reads wheel / trackpad / swipe / keys directly
   and swaps one scene per gesture; touch-action: none stops the phone from scrolling or bouncing */
.scenes-ready .hero {
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.scenes-ready .hero img { -webkit-user-drag: none; pointer-events: none; }
.scenes-ready .contact-scene .contact__email { -webkit-user-select: text; user-select: text; }

/* line-by-line rise + fade */
.scenes-ready .scene-line {
  opacity: 0; transform: translateY(20px);
  transition: opacity .55s cubic-bezier(.2,.7,.2,1), transform .55s cubic-bezier(.2,.7,.2,1);
}
.scenes-ready .is-active .scene-line {
  opacity: 1; transform: none;
  transition-delay: calc(var(--i, 0) * .07s);
}
.scenes-ready .is-leaving .scene-line {
  opacity: 0; transform: translateY(-16px);
  transition-duration: .2s; transition-timing-function: ease-in; transition-delay: 0s;
}

/* About: dark photo background (crossfade), white text; nav + footer turn white. Skills stays white. */
.hero__bgs { position: absolute; inset: 0; }
.hero__bg {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .5s ease;
}
.hero__bg.is-shown { opacity: 1; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
/* About: water ripples on the photo (ripple.js draws the photo into this canvas, desktop only) */
.hero__ripple { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
body[data-scene="about"] .hero__ripple.is-ready { opacity: 1; }

/* Contact scene: the contact card over the blurred Skills screen, reached by scrolling past Skills */
.contact-scene__scrim {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.contact-scene__wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.contact-scene__wrap > .scene-line { width: min(560px, 100%); }
.contact-scene .contact__box { opacity: 1; transform: none; transition: none; width: 100%; }
.contact-scene__top { display: inline-flex; align-items: center; gap: 6px; }
.contact-scene__top svg { width: 10px; height: 10px; transition: transform .25s ease; }
.contact-scene__top:hover svg { transform: translateY(-2px); }
.scenes-ready .scene-fade { opacity: 0; transition: opacity .35s ease; }
.scenes-ready .is-active .scene-fade { opacity: 1; }
.scenes-ready .is-leaving .scene-fade { opacity: 0; transition-duration: .2s; }
.hero__scene[data-theme="dark"] { color: var(--white); }
.nav--overlay, .hero__foot, .hero__foot .muted { transition: color .4s ease; }
body.is-dark .nav--overlay, body.is-dark .hero__foot { color: var(--white); }
body[data-scene="about"] .hero__foot .muted { color: #e0e0e2; }
.hero__scene[data-theme="dark"] .scene__note { color: var(--white); }

/* About + Skills text (Figma "Homepage-About" 112:21684, "Homepage-Skills" 112:21663) */
.scene {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: calc(24 * var(--hu));
  text-align: center;
}
.scene--about { top: calc(50% - 236 * var(--hu)); width: calc(1271 * var(--hu)); }
.scene--skills { top: calc(50% - 244 * var(--hu)); width: calc(840 * var(--hu)); }
.nw { white-space: nowrap; }
.scene__group { display: flex; flex-direction: column; align-items: center; }
.scene__title, .scene__lead {
  font-family: var(--serif); font-weight: 400; line-height: 1.3;
  letter-spacing: -0.02em; text-transform: uppercase;
}
.scene__title { font-size: calc(80 * var(--hu)); }
.scene__lead { font-size: calc(48 * var(--hu)); margin-top: calc(-10.4 * var(--hu)); } /* Figma's mixed-size text sits the lead 10.4px closer to the title */
.scene__note {
  width: calc(408 * var(--hu));
  font: 400 calc(20 * var(--hu))/1.3 var(--sans); letter-spacing: -0.02em;
  color: var(--grey);
}

.hero__foot {
  position: absolute; left: 0; right: 0;
  bottom: calc(114 * var(--hu));
  max-width: 1920px; margin: 0 auto;
  display: flex; justify-content: space-between;
  padding: 0 calc(119 * var(--u)) 0 calc(120 * var(--u));
  font: 600 14px/1.5 var(--sans);
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.hero__foot .muted { color: var(--grey); }

/* ---------- Work page intro ---------- */
.intro { height: calc(341 * var(--u)); min-height: 220px; position: relative; }
.intro__block { position: absolute; left: calc(876 * var(--u)); top: calc(102 * var(--u)); }
.intro h1 {
  font: 400 calc(60 * var(--u))/0.84 var(--serif);
  letter-spacing: -0.02em; text-transform: uppercase;
}
.intro p {
  margin-top: calc(44 * var(--u));
  width: 408px; font: 400 14px/1.4 var(--sans);
}
.intro p .muted { color: var(--grey); display: block; }
.intro p .caps { text-transform: uppercase; display: block; font-weight: 500; }

/* ---------- Case study cards ---------- */
.case {
  position: relative; display: block;
  height: calc(982 * var(--u));
  overflow: hidden;
  cursor: pointer;
}
.case__media { position: absolute; inset: 0; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.case:hover .case__media { transform: scale(1.025); }
.case__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.case__title {
  position: absolute; left: calc(120 * var(--u)); top: calc(344 * var(--u));
  font: 400 calc(68 * var(--u))/1.1 var(--serif);
  letter-spacing: -0.02em; white-space: nowrap;
}
.case__desc {
  position: absolute; left: calc(120 * var(--u)); top: calc(528 * var(--u));
  width: calc(307 * var(--u)); min-width: 260px;
  font: 400 16px/1.4 var(--sans);
}

.case--diag { color: var(--white); background: #8ea0c0; }
.case--sit { background: var(--white); }
.case--sit .case__title { color: #000000; }
.case--sit .case__desc { color: var(--grey-dark); }
/* hover cue */
.case__cta {
  position: absolute; left: calc(120 * var(--u)); top: calc(640 * var(--u));
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12px/1 var(--sans); letter-spacing: var(--track); text-transform: uppercase;
  padding: 12px 18px; border: 1px solid currentColor; border-radius: 999px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}
.case:hover .case__cta, .case:focus-visible .case__cta { opacity: 1; transform: none; }
.case:focus-visible { outline: 2px solid var(--black); outline-offset: -6px; }
.case__cta svg { width: 12px; height: 12px; }

/* ---------- Footer ---------- */
.footer {
  max-width: 1920px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 64px calc(120 * var(--u));
  font: 600 14px/1.5 var(--sans); letter-spacing: var(--track); text-transform: uppercase;
}

/* ---------- Contact panel ---------- */
.contact { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.contact__scrim { position: absolute; inset: 0; background: rgba(255,255,255,.75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity .25s ease; }
.contact__box {
  position: relative; width: min(560px, 100%);
  background: var(--white); border: 1px solid #e6e6e6;
  padding: 56px 48px 48px; box-shadow: 0 30px 80px rgba(0,0,0,.08);
  opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease;
}
.contact.is-open .contact__scrim { opacity: 1; }
.contact.is-open .contact__box { opacity: 1; transform: none; }
.contact__close {
  position: absolute; top: 20px; right: 24px; border: 0; background: none; cursor: pointer;
  font: 600 11px/1 var(--sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-dark);
}
.contact__close:hover { color: var(--black); }
.contact__eyebrow { font: 600 12px/1 var(--sans); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey); }
.contact__title { font: 400 clamp(40px, 6vw, 60px)/0.95 var(--serif); letter-spacing: -0.02em; text-transform: uppercase; }
.contact__email { margin-top: 28px; font: 400 18px/1.4 var(--sans); user-select: all; word-break: break-all; }
.contact__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.contact__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; border: 1px solid var(--black); border-radius: 999px; cursor: pointer;
  background: var(--black); color: var(--white);
  font: 600 12px/1 var(--sans); letter-spacing: var(--track); text-transform: uppercase;
  transition: background .2s ease, color .2s ease;
}
.contact__btn:hover { background: var(--white); color: var(--black); }
.contact__btn--ghost { background: var(--white); color: var(--black); }
.contact__btn--ghost:hover { background: var(--black); color: var(--white); }
.contact__btn:focus-visible, .contact__close:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  :root { --u: 1px; }
  .nav__inner { padding: 28px 20px 24px; font-size: 12px; }
  .nav__right { width: auto; gap: 28px; }

  .hero { height: 100svh; min-height: 560px; }
  .hero__name {
    /* Figma "Homepage – Mobile": lines 54.28px apart at 58.5px, block top 98.28px above centre */
    position: absolute; left: 20px; right: 20px; width: auto; height: auto; transform: translateY(-1.68em);
    font-size: clamp(48px, 15vw, 92px); line-height: 1.12;
    display: flex; flex-direction: column;
  }
  .hero__name span { position: static; }
  .hero__name span + span { margin-top: -0.1921em; }
  .hero__name span:nth-child(1) { padding-left: 6%; }
  .hero__name span:nth-child(2) { padding-left: 20%; }
  .hero__name span:nth-child(3) { padding-left: 36%; }
  .hero__foot { bottom: 21px; padding: 0 20px; font-size: 10px; flex-direction: column; gap: 4px; }

  /* About + Skills on phones: centred between nav and footer, 20px side margins */
  .scene { left: 20px; right: 20px; width: auto; top: 50%; transform: translateY(-50%); gap: 24px; }
  .scene--skills { gap: 28px; }
  .br-desktop { display: none; }
  .scene__title { font-size: clamp(40px, 12.3vw, 72px); line-height: 1.15; }
  .scene__lead { font-size: clamp(22px, 6.15vw, 34px); line-height: 1.25; margin-top: 0; }
  .scene__note { width: auto; max-width: 300px; font-size: 14px; line-height: 1.4; }

  /* 4-col grid: 20px margins, 16px gutters; intro text starts on column 2 */
  .intro { height: auto; min-height: 0; padding: 42px 22px 47px calc(20px + (100% - 88px) / 4 + 16px); }
  .intro__block { position: static; }
  .intro h1 { font-size: 48px; }
  .intro p { width: auto; margin-top: 14px; }
  main { padding-bottom: 80px; }

  /* case cards: full-bleed artwork, glass text panel at the bottom */
  .case { height: auto; aspect-ratio: 390 / 694; display: flex; flex-direction: column; justify-content: flex-end; }
  .case__media { position: absolute; inset: 0; }
  .case:hover .case__media { transform: none; }
  .case__img { object-fit: cover; object-position: center top; }
  .case__body {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
    padding: 32px 20px 48px;
    background: rgba(255,255,255,.2);
    -webkit-backdrop-filter: blur(50px); backdrop-filter: blur(50px);
  }
  .case--sit .case__body { background: rgba(255,255,255,.3); }
  .case__title, .case__desc, .case__cta { position: static; }
  .case__title { font-size: 42px; line-height: 1.1; white-space: normal; }
  .case__desc { width: auto; min-width: 0; font-size: 15px; line-height: 1.4; }
  .case--diag .case__desc { color: var(--white); }
  .case__cta { opacity: 1; transform: none; }

  .contact__box { padding: 56px 24px 32px; }
  .footer { padding: 40px 20px; font-size: 11px; flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scenes-ready .scene-line { transition: none !important; transform: none !important; }
  .hero__bg, .nav--overlay, .hero__foot, .hero__foot .muted, .scenes-ready .scene-fade { transition: none; }
  .case__media, .case__cta { transition: none; }
}
