/* Danielle Bergman — portfolio. Built from the Figma file "Portfolio" (1280px desktop frame). */
: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;
  /* desktop grid (Figma: 0–345 sidebar, 365–1200 media, 1222–1280 next tab) */
  --side: 26.95%;   /* 345 / 1280 */
  --gap: 1.5625%;   /* 20 / 1280 */
  --main: 65.23%;   /* 835 / 1280 */
  --pad: 80px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--blue);
  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; max-width: 1280px; margin: 0 auto;
  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: 150px; }
.site-header--big .logo { width: 295px; margin-top: 17px; }
.nav { display: flex; gap: 20px; padding-top: 48px; font-size: 14px; 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, 101px (Figma "Group 3") */
.page-project .site-header-wrap { position: sticky; }
.site-header--project {
  position: sticky; top: 0; height: 101px; max-width: none;
  background: var(--white);
}
.site-header--project .logo { width: 191px; margin-top: 25px; }
@media (min-width: 1280px) {
  .site-header--project { padding-left: calc((100vw - 1280px) / 2 + var(--pad)); padding-right: calc((100vw - 1280px) / 2 + var(--pad)); }
}

/* ---------- Home ---------- */
.home { max-width: 1280px; margin: 0 auto; padding-top: 112px; padding-bottom: 80px; }
.home__hint { padding: 0 var(--pad); font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 40px; }
.carousel {
  display: flex; gap: 20px; overflow-x: auto; 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 360px; 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: 6px;
  padding: 20px; 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 { opacity: 1; }
.tile__title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.tile__sub { font-size: 12px; font-style: italic; letter-spacing: .16em; }
.tile:focus-visible { outline-offset: -3px; }

/* ---------- About / Contact (two columns: 80px and 440px in Figma) ---------- */
.split, .contact { max-width: 1280px; margin: 0 auto; padding: 140px var(--pad) 120px; }
.split { display: grid; grid-template-columns: 360px 1fr; align-items: start; }
.split__title { font-size: 36px; font-weight: 600; line-height: 50px; color: var(--blue-84); }
.split__title em { font-weight: 600; }
.split__body { padding-top: 56px; max-width: 800px; }
.about-text { font-size: 24px; font-weight: 500; line-height: 1.66; color: var(--blue); }
.about-text p + p { margin-top: 40px; }
.about-text em { font-weight: 500; }
.accent { color: var(--orange); }

.contact { display: grid; grid-template-columns: 360px auto 1fr; grid-template-rows: auto auto; padding-top: 126px; }
.contact__a { grid-column: 1 / -1; font-size: 36px; font-weight: 600; color: var(--blue-84); line-height: 1.2; }
.contact__b { grid-column: 2; margin-top: 16px; font-size: 36px; 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: 20px; display: flex; flex-direction: column; gap: 45px; padding-right: 96px; }
.contact__links a { display: flex; align-items: center; gap: 30px; font-size: 24px; font-weight: 600; line-height: 1.66; color: var(--blue); }
.arrow { width: 44px; height: auto; flex: none; transition: transform .25s; }
.contact__links a:hover .arrow { transform: translateX(8px); }
.contact__links a:hover span { color: var(--orange); }

/* ---------- Project pages ---------- */
.project {
  position: relative; max-width: 1280px; margin: 0 auto; padding: 103px 0 80px;
  display: grid; grid-template-columns: var(--side) var(--main) 1fr; column-gap: var(--gap); align-items: start;
}
.project__info { position: sticky; top: 125px; display: flex; flex-direction: column; gap: 12px; }
.info { background: var(--beige); padding: 20px 20px 22px var(--pad); color: var(--blue); }
.info h1 { font-size: 16px; font-weight: 600; line-height: 1.36; margin-bottom: 10px; }
.info p { font-size: 13px; line-height: 1.24; max-width: 266px; }
.info--comps h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.info--comps li { position: relative; font-size: 13px; line-height: 16px; padding-left: 53px; }
.info--comps li::before { content: ""; position: absolute; left: 0; top: 8px; width: 43px; height: 1px; background: var(--orange); }

.project__media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.row { display: flex; gap: 10px; }
.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: 40px; margin: 20px 0 12px; font-size: 14px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--orange); }

.next {
  position: sticky; top: 125px; justify-self: end; width: 58px; height: 169px;
  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: 16px; font-weight: 600; line-height: 1.66; white-space: nowrap; }
.next:hover { background: var(--orange); color: var(--white); }
@media (min-width: 1281px) { .next { margin-right: calc((1280px - 100vw) / 2); } }

/* oil paintings: free composition from Figma (x 440–1200 inside 365–1200 column) */
.oil-grid { position: relative; display: grid; grid-template-columns: repeat(760, 1fr); padding-left: 8.98%; /* 75/835 */ row-gap: 10px; }
.oil { display: flex; flex-direction: column; }
.oil figcaption { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; 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 32px; }
.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: 132px; }
.oil--b figcaption::before { display: none; }
.oil--c { grid-column: 285 / span 476; margin-top: -8px; }
.oil--c figcaption { position: absolute; left: 8.98%; bottom: 0; margin: 0; }
.oil--c figcaption::before { display: none; }
.oil--c figcaption::after { width: 127px; order: 2; }
.oil--c { position: static; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root { --pad: 48px; }
  .split { grid-template-columns: 280px 1fr; }
  .about-text { font-size: 21px; }
  .contact { grid-template-columns: 1fr; }
  .contact__b, .contact__links { grid-column: 1; }
  .contact__b { padding-left: 0; white-space: normal; }
  .contact__links { justify-self: start; padding-right: 0; margin-top: 48px; gap: 28px; }
  .br-d { display: none; }
}

/* ---------- 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; }

  .home { padding-top: 56px; }
  .home__hint { margin-bottom: 20px; }
  .carousel { gap: 12px; padding: 0 var(--pad); scroll-padding-left: var(--pad); scroll-snap-type: x mandatory; }
  .tile { flex-basis: 78vw; max-width: 340px; }
  /* no hover on touch: show the project name under a soft gradient */
  @media (hover: none) {
    .tile__hover { opacity: 1; justify-content: flex-end; align-items: flex-start; text-align: left; background: linear-gradient(transparent 55%, rgba(33,63,197,.85)); padding: 16px; }
  }

  .split, .contact { 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; }
  .about-text { font-size: 18px; }
  .about-text p + p { margin-top: 24px; }
  .contact__b { margin-top: 6px; }
  .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); }
  .info { padding: 18px 20px; }
  .info p { max-width: none; font-size: 14px; line-height: 1.35; }
  .project__media { width: 100%; padding: 0 var(--pad); gap: 8px; }
  .row { gap: 8px; }
  .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; }
  .next {
    position: static; align-self: stretch; margin: 16px var(--pad) 0; width: auto; height: 56px;
  }
  .next span { writing-mode: horizontal-tb; transform: none; }
  .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--c { margin-top: 0; }
}

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