/* Danielle Bergman — portfolio. Built from the Figma file "Portfolio" (1280px desktop frame).
   Desktop/tablet: the whole 1280px frame scales with the screen width, edge to edge.
   1u = 1 Figma pixel at the current screen width. */
:root {
  --orange: #E75617;
  --blue: #213FC5;
  --blue-84: rgba(33, 63, 197, .84);
  --white: #F9F9FB;
  --beige: #EBEAE2;
  --font: "Graphik", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --u: calc(100vw / 1280);
  --pad: calc(80 * var(--u));
  --v: calc(100vh / 800);          /* 1 Figma px of the 800px-tall frame */
  --s: min(var(--u), var(--v));     /* fit-to-screen unit for one-screen pages */
}
/* iPhone / iPad: use the iOS system font (San Francisco) */
@supports (-webkit-touch-callout: none) {
  :root { --font: -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--white); color: var(--blue); overflow-x: clip;
  font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
em { font-style: italic; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 20; width: 100%;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 var(--pad);
}
.logo { color: var(--orange); display: block; transition: color .2s; }
.logo:hover { color: var(--blue); }          /* Figma: logo hover variant turns blue */
.logo svg { width: 100%; height: auto; display: block; }
.site-header--big { height: calc(150 * var(--u)); }
.site-header--big .logo { width: calc(295 * var(--u)); margin-top: calc(17 * var(--u)); }
.nav {
  display: flex; gap: calc(20 * var(--u)); padding-top: calc(48 * var(--u));
  font-size: max(12px, calc(14 * var(--u))); font-weight: 600; line-height: 1; color: var(--orange);
}
.nav a { position: relative; padding: 2px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* project pages: sticky white bar (Figma "Group 3", 101px) */
.site-header--project { position: sticky; top: 0; height: calc(101 * var(--u)); background: var(--white); }
.site-header--project .logo { width: calc(191 * var(--u)); margin-top: calc(25 * var(--u)); }

/* ---------- Home ---------- */
/* home, about, contact = one screen (1280x800 frame): header on top, content in the middle, white space below */
.page-home, .page-about, .page-contact { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.home { flex: 1; display: flex; flex-direction: column; }
.home::before { content: ""; flex: 112 1 0; min-height: calc(24 * var(--s)); }
.home::after { content: ""; flex: 120 1 0; min-height: calc(24 * var(--s)); }
.home__hint { padding: 0 var(--pad); font-size: max(12px, calc(14 * var(--u))); font-weight: 600; color: var(--blue); margin-bottom: calc(40 * var(--s)); }
.carousel {
  display: flex; gap: calc(20 * var(--s)); overflow-x: auto; padding: 0 var(--pad); scroll-padding-left: var(--pad); overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; cursor: grab;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel.is-dragging .tile { pointer-events: none; }
.tile { position: relative; flex: 0 0 calc(360 * var(--s)); aspect-ratio: 1; overflow: hidden; scroll-snap-align: start; background: #ddd; }
.tile img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.tile__hover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(6 * var(--u));
  padding: calc(20 * var(--u)); text-align: center; color: #fff; background: rgba(33, 63, 197, .75);
  opacity: 0; transition: opacity .25s;
}
.tile:hover .tile__hover, .tile:focus-visible .tile__hover, .tile:active .tile__hover { opacity: 1; }
.tile__title { font-size: max(12px, calc(14 * var(--u))); font-weight: 600; line-height: 1.2; }
.tile__sub { font-size: max(11px, calc(12 * var(--u))); font-style: italic; letter-spacing: .16em; }
.tile:focus-visible { outline-offset: -3px; }

/* ---------- About / Contact (columns at 80px and 440px in Figma) ---------- */
.split, .contact { flex: 1; align-content: center; padding: calc(24 * var(--s)) var(--pad) calc(54 * var(--s)); }
.split { display: grid; grid-template-columns: calc(360 * var(--u)) 1fr; align-items: start; }
.split__title { font-size: calc(36 * var(--s)); font-weight: 600; line-height: 1.39; color: var(--blue-84); }
.split__title em { font-weight: 600; }
.split__body { padding-top: calc(56 * var(--s)); }
.about-text { font-size: calc(24 * var(--s)); font-weight: 500; line-height: 1.66; color: var(--blue); }
.about-text p + p { margin-top: calc(40 * var(--s)); }
.about-text em { font-weight: 500; }
.accent { color: var(--orange); }

.contact { display: grid; grid-template-columns: calc(360 * var(--u)) auto 1fr; }
.contact__a { grid-column: 1 / -1; font-size: calc(36 * var(--s)); font-weight: 600; color: var(--blue-84); line-height: 1.2; }
.contact__b { grid-column: 2; margin-top: calc(16 * var(--s)); font-size: calc(36 * var(--s)); font-weight: 600; color: var(--blue-84); line-height: 1.2; white-space: nowrap; }
.contact__b em { font-weight: 600; }
.contact__links { grid-column: 3; justify-self: end; margin-top: calc(20 * var(--s)); display: flex; flex-direction: column; gap: calc(45 * var(--s)); padding-right: calc(96 * var(--u)); }
.contact__links a { display: flex; align-items: center; gap: calc(30 * var(--s)); font-size: calc(24 * var(--s)); font-weight: 600; line-height: 1.66; color: var(--blue); }
.arrow { width: calc(44 * var(--s)); height: auto; flex: none; transition: transform .25s; }
.contact__links a:hover .arrow { transform: translateX(calc(8 * var(--u))); }
.contact__links a:hover span { color: var(--orange); }

/* ---------- Project pages: 0–345 info | 365–1200 media | 1222–1280 next ---------- */
.project {
  position: relative; padding: calc(27 * var(--u)) 0 calc(80 * var(--u));
  display: grid; grid-template-columns: calc(345 * var(--u)) calc(835 * var(--u)) 1fr; column-gap: calc(20 * var(--u)); align-items: start;
}
.project__info { position: sticky; top: calc(128 * var(--u)); display: flex; flex-direction: column; gap: calc(12 * var(--u)); }
.info { background: var(--beige); padding: calc(20 * var(--u)) calc(20 * var(--u)) calc(22 * var(--u)) var(--pad); color: var(--blue); }
.info h1 { font-size: max(13px, calc(16 * var(--u))); font-weight: 600; line-height: 1.36; margin-bottom: calc(10 * var(--u)); }
.info p { font-size: max(11px, calc(13 * var(--u))); line-height: 1.24; max-width: calc(266 * var(--u)); }
.info--comps h2 { font-size: max(12px, calc(14 * var(--u))); font-weight: 600; margin-bottom: calc(12 * var(--u)); }
.info--comps li { position: relative; font-size: max(11px, calc(13 * var(--u))); line-height: 1.25; padding-left: calc(53 * var(--u)); }
.info--comps li::before { content: ""; position: absolute; left: 0; top: .6em; width: calc(43 * var(--u)); height: 1px; background: var(--orange); }

.project__media { display: flex; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; }
.row { display: flex; gap: calc(10 * var(--u)); }
.row .m { flex: var(--w) 1 0; aspect-ratio: var(--ar); }
.row--narrow { justify-content: center; }
.row--narrow .m { flex: 0 0 53.05%; }               /* 443 / 835 */
.row--phones { justify-content: center; gap: 10.3%; }  /* 86 / 835 */
.row--phones .m { flex: 0 0 38.56%; }               /* 322 / 835 */
.m { position: relative; overflow: hidden; background: #ECECEE; }
.m img, .m video { width: 100%; height: 100%; object-fit: cover; }
.section-label { display: flex; align-items: center; gap: calc(40 * var(--u)); margin: calc(20 * var(--u)) 0 calc(12 * var(--u)); font-size: max(12px, calc(14 * var(--u))); font-weight: 600; color: var(--blue); white-space: nowrap; }
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--orange); }

.next {
  position: sticky; top: calc(128 * var(--u)); justify-self: end; width: calc(58 * var(--u)); height: calc(169 * var(--u));
  background: var(--beige); color: var(--orange); display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.next span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: max(12px, calc(16 * var(--u))); font-weight: 600; line-height: 1.66; white-space: nowrap; }
.next:hover { background: var(--orange); color: var(--white); }

/* oil paintings: free composition from Figma (x 440–1200 inside the 365–1200 column) */
.oil-grid { position: relative; display: grid; grid-template-columns: repeat(760, 1fr); padding-left: 8.98%; /* 75/835 */ row-gap: calc(10 * var(--u)); }
.oil { display: flex; flex-direction: column; }
.oil figcaption { display: flex; align-items: center; gap: calc(12 * var(--u)); margin-top: calc(8 * var(--u)); font-size: max(12px, calc(14 * var(--u))); font-weight: 600; color: var(--blue); white-space: nowrap; }
.oil figcaption::before, .oil figcaption::after { content: ""; height: 1px; background: var(--orange); }
.oil--a { grid-column: 1 / span 760; display: grid; grid-template-columns: 427fr 333fr; align-items: end; }
.oil--a figcaption { margin: 0 0 0 calc(32 * var(--u)); }
.oil--a figcaption::before { display: none; }
.oil--a figcaption::after { flex: 1; }
.oil--b { grid-column: 1 / span 760; }
.oil--b figcaption { flex-direction: row-reverse; justify-content: flex-end; }
.oil--b figcaption::after { width: calc(132 * var(--u)); }
.oil--b figcaption::before { display: none; }
.oil--c { grid-column: 285 / span 476; margin-top: calc(-8 * var(--u)); position: static; }
.oil--c figcaption { position: absolute; left: 8.98%; bottom: 0; margin: 0; }
.oil--c figcaption::before { display: none; }
.oil--c figcaption::after { width: calc(127 * var(--u)); order: 2; }

/* About (updated Figma frame): title at y200, photo 283x283 at (80,347), text column at x440 next to the photo */
.page-about .split { align-content: start; grid-template-rows: auto auto; row-gap: calc(52 * var(--s)); padding-top: calc(50 * var(--s)); }
.page-about .split__title { grid-column: 1 / -1; }
.about-photo { grid-column: 1; width: calc(283 * var(--s)); height: calc(283 * var(--s)); object-fit: cover; }
.page-about .split__body { grid-column: 2; padding-top: 0; margin-top: calc(-6 * var(--s)); }

/* frame heights follow the Figma frame fitted to the screen (like Figma's presentation view) */
.row .m, .oil .m { aspect-ratio: auto; height: calc(var(--h) * var(--s)); }

.m--contain { background: #F5F5F5; }
.m--contain video { object-fit: contain; }

.info p.lines { white-space: nowrap; max-width: none; letter-spacing: -0.005em; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --pad: 22px; }
  .site-header { align-items: center; }
  .site-header--big { height: auto; padding-top: 16px; padding-bottom: 8px; }
  .site-header--big .logo { width: 168px; margin-top: 0; }
  .site-header--project { height: 72px; }
  .site-header--project .logo { width: 128px; margin-top: 0; }
  .nav { padding-top: 0; gap: 16px; font-size: 13px; }

  .page-home, .page-about, .page-contact { min-height: 0; }
  .home { padding-top: 56px; padding-bottom: 40px; }
  .home::before, .home::after { display: none; }
  .home__hint { margin-bottom: 20px; font-size: 14px; }
  .carousel { gap: 12px; padding: 0 var(--pad); scroll-padding-left: var(--pad); scroll-snap-type: x mandatory; }
  .tile { flex-basis: 78vw; max-width: 340px; }
  .tile__title { font-size: 14px; }
  .tile__sub { font-size: 12px; }

  .split, .contact { flex: none; padding: 64px var(--pad) 72px; }
  .split { grid-template-columns: 1fr; }
  .split__title, .contact__a, .contact__b { font-size: 28px; line-height: 1.3; }
  .split__body { padding-top: 28px; }
  .page-about .split { row-gap: 24px; padding-top: 40px; }
  .about-photo { width: 100%; max-width: 340px; height: auto; aspect-ratio: 1; }
  .page-about .split__body { grid-column: 1; margin-top: 0; padding-top: 0; }
  .about-text { font-size: 18px; }
  .about-text p + p { margin-top: 24px; }
  .br-d { display: none; }
  .contact { grid-template-columns: 1fr; }
  .contact__b, .contact__links { grid-column: 1; }
  .contact__b { margin-top: 6px; white-space: normal; }
  .contact__links { justify-self: start; padding-right: 0; margin-top: 48px; gap: 28px; }
  .contact__links a { font-size: 20px; gap: 20px; }
  .arrow { width: 36px; }

  .project { display: flex; flex-direction: column; padding: 4px 0 40px; gap: 16px; }
  .project__info { position: static; width: 100%; padding: 0 var(--pad); gap: 12px; }
  .info { padding: 18px 20px; }
  .info h1 { font-size: 16px; margin-bottom: 10px; }
  .info p { max-width: none; font-size: 14px; line-height: 1.35; }
  .info p.lines { white-space: normal; letter-spacing: 0; }
  .info--comps h2 { font-size: 14px; margin-bottom: 12px; }
  .info--comps li { font-size: 14px; padding-left: 53px; }
  .info--comps li::before { width: 43px; }
  .project__media { width: 100%; padding: 0 var(--pad); gap: 8px; }
  .row { gap: 8px; }
  .row .m, .oil .m { height: auto; aspect-ratio: var(--ar); }
  .row--narrow .m { flex-basis: 82%; }
  .row--phones { gap: 8px; }
  .row--phones .m { flex: 1 1 0; }
  .section-label { gap: 20px; margin: 16px 0 6px; font-size: 14px; }
  .next { position: static; align-self: stretch; margin: 16px var(--pad) 0; width: auto; height: 56px; }
  .next span { writing-mode: horizontal-tb; transform: none; font-size: 16px; }
  .next span::after { content: " →"; }

  .oil-grid { display: flex; flex-direction: column; padding-left: 0; gap: 18px; }
  .oil--a { display: flex; }
  .oil--a figcaption, .oil--c figcaption { position: static; margin: 8px 0 0; }
  .oil figcaption { font-size: 14px; gap: 12px; }
  .oil--b figcaption::after { width: 132px; }
  .oil--c figcaption::after { width: 127px; }
  .oil--c { margin-top: 0; }
}

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