/* Magdalena Wilson — portfolio */

:root {
  --paper: #ffffff;
  --ink: #2f4329;
  --muted: #6b6458;
  --rule: #d6cdbb;

  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 48px);
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

/* ---------- header ---------- */

.site-head { position: sticky; top: 0; z-index: 20; background: #fff; }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; padding: clamp(14px, 2vw, 26px) clamp(16px, 4vw, 78px); }
.logo { display: block; line-height: 0; }
.logo img { width: clamp(200px, 20.5vw, 393px); height: auto; }
.site-nav { display: flex; gap: 4px clamp(24px, 3vw, 52px); }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: clamp(1.05rem, 1.9vw, 2.25rem); }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- home: tagline ---------- */

.tagline { padding: clamp(28px, 4vw, 72px) clamp(16px, 4vw, 78px) clamp(4px, 1vw, 12px); }
.tagline p { margin: 0; max-width: none; font-weight: 300; font-size: clamp(1.7rem, 3.6vw, 3.6rem); line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
.tagline span { font-weight: 700; background: linear-gradient(transparent 62%, #dfe6d3 62%, #dfe6d3 92%, transparent 92%); padding-inline: .06em; }

/* ---------- home: category bands ---------- */

.work { display: grid; gap: clamp(28px, 2.7vw, 52px); padding-block: clamp(28px, 2.7vw, 52px) clamp(48px, 5vw, 96px); }
.band { display: grid; grid-template-columns: clamp(150px, 18.75vw, 360px) minmax(0, 1fr); gap: 16px 0; padding: clamp(24px, 2vw, 38px) clamp(16px, 2.6vw, 50px); background: #dfe6d3; scroll-margin-top: 120px; }
.band h2 { margin: 0; font-weight: 700; font-size: clamp(1.3rem, 1.9vw, 2.25rem); line-height: 1.2; text-transform: uppercase; }
.band-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px clamp(16px, 3.9vw, 74px); max-width: 1290px; }
.card { display: block; min-width: 0; text-decoration: none; color: var(--ink); }
.card .thumb { aspect-ratio: 380 / 268.6; overflow: hidden; background: #fff; border-radius: 8px; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card .thumb.tint { background: #f1f4ec; }
.card .thumb img.cover { object-fit: cover; }
.card .thumb img.cutout { padding: 9%; }
.card:hover .thumb img { transform: scale(1.035); }
.card .info { margin-top: 10px; }
.card h3 { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 900px) { .band { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .band-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- project page ---------- */

.project { padding-block: clamp(36px, 6vw, 72px) clamp(64px, 10vw, 120px); }

.proj-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.proj-title h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.proj-title .collab { flex-basis: 100%; margin: 0; font-style: italic; font-weight: 300; color: var(--muted); }
.proj-title .meta { margin: 0; font-style: italic; font-weight: 300; font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: var(--muted); }

.shot { margin: 0; background: #fff; outline: 1px solid #d9d9d9; outline-offset: -1px; border-radius: 10px; overflow: hidden; }
.shot img { width: 100%; }
.shot + .shot { margin-top: clamp(40px, 6vw, 72px); }



/* ---------- click to expand ---------- */

img.zoom { cursor: zoom-in; }
.zoombox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: transparent;
  cursor: zoom-out;
}
.zoombox[open] { display: flex; align-items: center; justify-content: center; }
.zoombox::backdrop { background: rgba(22, 19, 15, .88); }
svg.zoom-svg { cursor: zoom-in; }
.zoombox svg { width: min(calc(100vw - 32px), calc((100dvh - 32px) * 16 / 9)); height: auto; background: #fff; }
.zoombox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); width: auto; height: auto; background: #fff; }
.zoombox-x {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font: 400 1.6rem/1 var(--sans);
  cursor: pointer;
}
.zoombox-x:hover { background: rgba(255, 255, 255, .3); }
.zoombox-x:focus-visible { outline-color: #fff; }

/* ---------- slides rebuilt from SVG (Downstairs Neighbor) ---------- */

.slide svg { display: block; width: 100%; height: auto; }
.slide text, .zoombox svg text { font-family: "Archivo", "Barlow", sans-serif; }
.critter { transform-box: fill-box; transform-origin: center; transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.critter:hover { transform: rotate(-6deg) scale(1.08); }
@media (prefers-reduced-motion: reduce) { .critter { transition: none; } }

/* ---------- about page ---------- */

.about-page { max-width: 1920px; margin-inline: auto; padding: clamp(40px, 4vw, 80px) clamp(16px, 6.5vw, 126px) clamp(56px, 6vw, 112px); }
.about-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(32px, 10vw, 192px); align-items: stretch; }
.about-portrait { position: relative; margin: 0; padding: 0 0 20px 20px; }
.about-portrait::before { content: ""; position: absolute; left: 0; top: 20px; right: 20px; bottom: 0; background: #a9b99c; }
.about-portrait img { position: relative; display: block; width: 100%; height: auto; }
.about-bio { display: flex; flex-direction: column; justify-content: center; padding: clamp(20px, 2vw, 40px); background: #dfe6d3; }
.about-bio h1 { margin: 0 0 .6em; font-weight: 700; font-size: clamp(1.4rem, 1.9vw, 2.25rem); line-height: 1.2; }
.about-bio p { margin: 0 0 1em; font-size: clamp(1.05rem, 1.4vw, 1.5rem); line-height: 1.5; }
.about-bio p:last-child { margin-bottom: 0; }
.about-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3.5vw, 66px); margin-top: clamp(40px, 4.3vw, 82px); }
.skill-box { padding: clamp(20px, 1.8vw, 34px); background: #dfe6d3; }
.skill-box h2 { margin: 0 0 12px; font-weight: 700; font-size: clamp(1.3rem, 1.9vw, 2.25rem); }
.skill-box ul { margin: 0; padding-left: 1.2em; font-size: clamp(1rem, 1.3vw, 1.4rem); line-height: 1.45; }
.about-email { margin: 0; }
.about-email span { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.about-email a { display: inline-block; margin-top: 4px; font-weight: 700; font-size: clamp(1.15rem, 1.6vw, 1.6rem); color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.about-email a:hover { text-decoration-thickness: 3px; }
@media (max-width: 760px) { .about-top, .about-skills { grid-template-columns: minmax(0, 1fr); } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- poster gallery ---------- */

.gallery { columns: 3 280px; column-gap: clamp(16px, 2vw, 28px); }
.gallery img { display: block; width: 100%; height: auto; margin: 0 0 clamp(16px, 2vw, 28px); break-inside: avoid; outline: 1px solid #d9d9d9; outline-offset: -1px; border-radius: 8px; transition: transform .3s ease; }
.gallery img:hover { transform: scale(1.015); }



/* scrolling band (professional work) */
.band-scroll { position: relative; min-width: 0; max-width: 1290px; }
.band-cards.scroller { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 2 * clamp(16px, 3.9vw, 74px)) / 3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; max-width: none; }
.band-cards.scroller::-webkit-scrollbar { display: none; }
.band-cards.scroller .card { scroll-snap-align: start; }
.band-arrow { position: absolute; top: calc((100% - 34px) / 2 - 22px); width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); font: 700 1.3rem/1 var(--sans); cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); z-index: 2; }
.band-arrow.prev { left: -22px; }
.band-arrow.next { right: -22px; }
.band-arrow:hover { background: #f1f4ec; }
@media (max-width: 600px) { .band-cards.scroller { grid-auto-columns: calc((100% - clamp(16px, 3.9vw, 74px)) / 2); } }

/* project pages: header bar in the home page band green */
body.project-page { overflow-x: clip; }
body.project-page .site-head { position: static; }
body.project-page .project { padding-top: 0; }
body.project-page .proj-title { margin-inline: calc(50% - 50vw); padding: clamp(32px, 4vw, 64px) calc(50vw - 50%); background: #dfe6d3; }

/* ---------- comics ---------- */

.comic + .comic { margin-top: clamp(56px, 7vw, 112px); }
.comic-title { margin: 0; font-weight: 700; font-size: clamp(1.4rem, 2.2vw, 2.2rem); }
.comic-credit { margin: 4px 0 0; font-style: italic; font-weight: 300; color: var(--muted); }
.comic-pages, .comic-strips { display: grid; gap: clamp(20px, 2.5vw, 40px); margin-top: clamp(20px, 2.5vw, 32px); }
.comic-pages img, .comic-strips img { display: block; width: 100%; height: auto; outline: 1px solid #d9d9d9; outline-offset: -1px; border-radius: 6px; }
.comic-pages img { max-width: 1000px; margin-inline: auto; }
.comic-strips img { max-width: 1200px; margin-inline: auto; }

/* ---------- phones and tablets ---------- */

/* About: stack photo and bio until there's room for two real columns */
@media (max-width: 900px) {
  .about-top { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .about-bio { margin-top: 0; }
}
@media (max-width: 600px) {
  .about-skills { grid-template-columns: minmax(0, 1fr); }
}

/* Scrolling rows on phones: keep the arrows inside the band so they don't hang off the screen edge */
@media (max-width: 600px) {
  .band-arrow { width: 38px; height: 38px; font-size: 1.1rem; }
  .band-arrow.prev { left: -8px; }
  .band-arrow.next { right: -8px; }
}

/* Slides are wide, so on a phone point people to the full-screen view */
@media (max-width: 700px) {
  body.project-page .proj-title::after { content: "Tap any slide to see it full screen."; display: block; flex-basis: 100%; margin-top: 10px; font-size: .9rem; font-style: italic; font-weight: 300; color: var(--muted); }
  .proj-title h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
}

/* Full-screen view on a portrait phone: show slides at full screen height and let people swipe across */
@media (max-width: 700px) and (orientation: portrait) {
  .zoombox.wide[open] { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .zoombox.wide img { max-width: none; max-height: none; height: calc(100dvh - 120px); width: auto; flex: none; margin-inline: 16px; }
  .zoombox.wide svg { flex: none; height: calc(100dvh - 120px); width: calc((100dvh - 120px) * 16 / 9); margin-inline: 16px; }
}

/* Phones: centered name with the nav underneath */
@media (max-width: 600px) {
  .head-in { flex-direction: column; justify-content: center; gap: 8px; padding-block: 18px 12px; }
  .logo img { width: min(78vw, 300px); }
  .site-nav { justify-content: center; }
}

/* Band labels on one line; on wide screens they sit in their own column, so let them wrap only there */
@media (max-width: 600px) { .band h2 { white-space: nowrap; } .band h2 br { display: none; } }
@media (max-width: 900px) { .band h2 { text-align: center; } }

/* About: rounded boxes and one even gap between everything */
.about-page { --about-gap: clamp(20px, 3vw, 44px); }
.about-top { gap: var(--about-gap); }
.about-skills { gap: var(--about-gap); margin-top: var(--about-gap); }
.about-bio, .about-contact, .skill-box { border-radius: 12px; }
.about-portrait img, .about-portrait::before { border-radius: 12px; }
.about-bio a { color: var(--ink); text-underline-offset: 3px; }
.about-portrait { display: flex; }
.about-portrait img { height: 100%; object-fit: cover; }

/* About: the bio sets the row height (even padding all round); the photo fills that height */
@media (min-width: 901px) {
  .about-bio { justify-content: flex-start; padding: clamp(24px, 2.4vw, 44px); }
  .about-portrait { display: block; min-height: 0; }
  .about-portrait img { position: absolute; top: 0; right: 0; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: cover; object-position: center 30%; }
}
/* Skills boxes: same even padding as the bio, with the heading/list line spacing trimmed so the text sits evenly */
.skill-box { padding: clamp(24px, 2.4vw, 44px); }
.skill-box h2 { line-height: 1; margin-top: -0.08em; }
.skill-box ul { margin-bottom: -0.2em; }
