/* ==========================================================================
   Paulina Grube — Portfolio 2026
   Design system: Haettenschweiler (display/red) · Syne Mono (body) ·
   Syne Tactile (script accent) · Signal red / black / white · strict grid.
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------- */
/* Haettenschweiler is a licensed system font (ships with MS Office / Windows),
   not redistributed here — referenced by name so it renders on machines that
   have it installed, with a condensed-bold fallback stack for everyone else. */

@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Syne';
  src: url('../fonts/Syne-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Syne Mono';
  src: url('../fonts/SyneMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Syne Tactile';
  src: url('../fonts/SyneTactile-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --c-black: #0d0d0d;
  --c-white: #f7f6f2;
  --c-red: #e12c1f;
  --c-grey: #8a8a86;
  --c-line: #d8d6cf;

  --f-display: 'Haettenschweiler', 'Impact', 'Arial Narrow Bold', 'Oswald', sans-serif;
  --f-ui: 'Syne', sans-serif;
  --f-mono: 'Syne Mono', monospace;
  --f-script: 'Syne Tactile', cursive;

  --gap: clamp(16px, 3vw, 32px);
  --margin: clamp(20px, 5vw, 64px);
  --max: 1400px;

  --dur: 0.4s;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-black);
  font-family: var(--f-mono);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

/* ---- Layout ---------------------------------------------------------------- */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}
section { padding-block: clamp(48px, 10vw, 120px); }
section.tight { padding-block: clamp(24px, 5vw, 56px); }

/* ---- Typography roles ------------------------------------------------------ */
.display {
  font-family: var(--f-display);
  color: var(--c-red);
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: 0.01em;
  font-weight: 400;
}
.display--xl { font-size: clamp(3.2rem, 12vw, 10rem); }
.display--lg { font-size: clamp(2.4rem, 8vw, 6rem); }
.display--md { font-size: clamp(1.6rem, 5vw, 3.2rem); }
.display--sm { font-size: clamp(1.2rem, 3vw, 1.8rem); }
.display--black { color: var(--c-black); }
.display--white { color: var(--c-white); }

.script {
  font-family: var(--f-script);
  font-weight: 400;
  color: var(--c-black);
  text-transform: none;
  line-height: 1.1;
}

.ui { font-family: var(--f-ui); font-weight: 600; }

.eyebrow {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credits {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--c-grey);
  letter-spacing: 0.02em;
  line-height: 1.6;
}

p.lead { font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 62ch; }
p.body { font-size: 0.95rem; max-width: 58ch; }

/* ---- Discipline label (top-left, every project) ---------------------------- */
.discipline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.discipline-label::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--c-red);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Section divider (red, "BRANDING / visual identity") ------------------- */
.divider {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  color: var(--c-red);
  font-family: var(--f-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  border-top: 1px solid var(--c-line);
  padding-top: 0.9em;
  margin-bottom: 2em;
}
.divider span.sub {
  color: var(--c-grey);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ---- Nav ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--f-display);
  color: var(--c-black);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo span { color: var(--c-red); }
.site-nav ul { display: flex; gap: clamp(16px, 3vw, 40px); }
.site-nav a {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}
.site-nav a.is-active { color: var(--c-red); }
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur);
}
.site-nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .site-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--c-white);
    padding: 32px var(--margin);
    transform: translateY(-110%);
    transition: transform var(--dur) ease;
  }
  .site-nav.is-open { transform: translateY(0); }
  .site-nav ul { flex-direction: column; gap: 20px; }
  .site-nav a { font-size: 1.1rem; }
  .nav-toggle {
    display: block;
    font-family: var(--f-ui);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    text-transform: uppercase;
  }
}

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--c-line);
  padding-block: 40px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* ---- Buttons / links ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--c-black);
  padding: 0.9em 1.4em;
  transition: background var(--dur), color var(--dur);
}
.btn:hover { background: var(--c-black); color: var(--c-white); }
.btn--red { border-color: var(--c-red); color: var(--c-red); }
.btn--red:hover { background: var(--c-red); color: var(--c-white); }
.btn .arrow { transition: transform var(--dur); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Work index grid ---------------------------------------------------------- */
.work-list { border-top: 1px solid var(--c-line); }
.work-item {
  display: block;
  border-bottom: 1px solid var(--c-line);
  padding-block: clamp(24px, 5vw, 44px);
}
.work-item__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
}
.work-item__index { font-family: var(--f-mono); color: var(--c-grey); font-size: 0.85rem; }
.work-item__title {
  font-family: var(--f-display);
  color: var(--c-black);
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.9;
  transition: color var(--dur);
}
.work-item__meta { text-align: right; }
.work-item:hover .work-item__title { color: var(--c-red); }
.work-item__tags {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-grey);
}
.work-item__preview {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--dur) ease;
}
.work-item:hover .work-item__preview { max-height: 420px; }
.work-item__preview img { width: 100%; height: 340px; object-fit: cover; margin-top: 20px; }

@media (max-width: 720px) {
  .work-item__row { grid-template-columns: 1fr; }
  .work-item__meta { text-align: left; }
  .work-item__preview, .work-item:hover .work-item__preview { max-height: none; }
  .work-item__preview img { height: 220px; }
}

/* ---- Case study template ------------------------------------------------------- */
.case-hero {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 24px;
  padding-block: clamp(32px, 6vw, 64px) clamp(40px, 8vw, 80px);
  border-bottom: 1px solid var(--c-line);
}
.case-claim { max-width: 20ch; }
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--c-line);
}
.case-meta__block dt {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-grey);
  margin-bottom: 6px;
}
.case-meta__block dd { margin: 0; font-family: var(--f-mono); font-size: 0.88rem; }

.case-block {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding-block: clamp(40px, 8vw, 88px);
  border-bottom: 1px solid var(--c-line);
}
.case-block__label { grid-column: span 12; }
.case-block__label .eyebrow { color: var(--c-red); }
.case-block__number {
  font-family: var(--f-mono);
  color: var(--c-line);
  font-size: 3rem;
  line-height: 1;
}
.case-block__heading {
  grid-column: 1 / span 3;
}
.case-block__body { grid-column: 4 / span 9; }
.case-block__body p + p { margin-top: 1em; }

@media (max-width: 900px) {
  .case-block__heading, .case-block__body { grid-column: span 12; }
  .case-block__heading { margin-bottom: 12px; }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  margin-top: clamp(24px, 4vw, 40px);
  align-items: start;
}
.gallery img, .gallery video {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  background: var(--c-white);
  display: block;
}
.gallery figcaption {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-grey);
  margin-top: 8px;
}
/* Uniform-ratio variant — for a set of same-type images (posters, social posts, product shots)
   that should read as one consistent grid instead of the natural-height default above. */
.gallery--poster figure, .gallery--social figure, .gallery--square figure { overflow: hidden; }
.gallery--poster img, .gallery--social img, .gallery--square img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
/* A video dropped into a uniform-ratio gallery should fill the same box as the
   images beside it, otherwise it keeps its natural aspect and reads as smaller. */
.gallery--poster figure video, .gallery--social figure video, .gallery--square figure video { width: 100%; height: 100%; object-fit: cover; }
.gallery--poster figure { aspect-ratio: 0.706; }
.gallery--social figure { aspect-ratio: 4 / 5; }
.gallery--square figure { aspect-ratio: 1 / 1; }
.gallery--wide figure { aspect-ratio: 4 / 3; }
.gallery--wide img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.gallery--wide figure { overflow: hidden; }

/* Hover-to-enlarge — applies to every gallery figure that holds an image:
   whenever a crop or a small grid cell hides part of it, hovering reveals it
   in full, scaled up above the grid, instead of leaving content cut off or
   hard to read. Figures holding a <video>, or marked .no-zoom (already shown
   at full size), never match these rules — nothing about them changes on
   hover, not even a reflow. */
.gallery:not(.gallery--lightbox) figure:has(img):not(.no-zoom) {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  z-index: 1;
}
.gallery:not(.gallery--lightbox) figure:not(.no-zoom) img {
  transition: opacity 0.25s ease;
}
.gallery:not(.gallery--lightbox) figure:has(img):not(.no-zoom):hover {
  overflow: visible;
  z-index: 30;
}
.gallery:not(.gallery--lightbox) figure:not(.no-zoom):hover img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  /* Never smaller than the cell: on narrow screens a square cell can be nearly
     full-width, so the width cap must stay above that (90vw) or a square image
     would zoom *down*. 300% keeps the pop modest on wide screens. */
  max-width: min(300%, 90vw);
  max-height: 88vh;
  object-fit: contain;
  transform: translate(-50%, -50%);
  background: var(--c-white);
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.35);
  border: 1px solid var(--c-line);
}
/* The enlarged image floats above everything, including the figcaption still
   sitting at its original (small) position underneath — hide the caption
   while zoomed so it doesn't show through as illegible, half-covered text. */
.gallery:not(.gallery--lightbox) figure:not(.no-zoom) figcaption {
  transition: opacity 0.15s ease;
}
.gallery:not(.gallery--lightbox) figure:not(.no-zoom):hover figcaption {
  opacity: 0;
}

/* Lightbox variant — no hover-zoom. Instead, clicking/tapping an image opens
   it centered at near-full screen height; clicking again (anywhere) closes it. */
.gallery--lightbox figure img { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
  background: rgba(13, 13, 13, 0.92);
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-height: 96vh;
  max-width: 96vw;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.7);
}

.g-12 { grid-column: span 12; }
.g-8 { grid-column: span 8; }
.g-6 { grid-column: span 6; }
.g-4 { grid-column: span 4; }
.g-3 { grid-column: span 3; }
.g-2 { grid-column: span 2; }
@media (max-width: 900px) {
  .g-3, .g-2 { grid-column: span 4; }
}
@media (max-width: 720px) {
  .g-8, .g-6, .g-4, .g-3, .g-2 { grid-column: span 12; }
}

.case-credits {
  padding-block: clamp(28px, 5vw, 44px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.case-nav {
  display: flex;
  justify-content: space-between;
  padding-block: 32px;
  border-top: 1px solid var(--c-line);
}

.placeholder-note {
  grid-column: span 12;
  border: 1px dashed var(--c-red);
  color: var(--c-red);
  font-family: var(--f-mono);
  font-size: 0.82rem;
  padding: 20px;
  background: color-mix(in srgb, var(--c-red) 6%, transparent);
}

/* ---- Hero / intro cover --------------------------------------------------------- */
.cover {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--c-line);
}
.cover__kicker {
  font-family: var(--f-ui);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--c-grey);
}
.cover__name { line-height: 0.86; }
.cover__position { max-width: 46ch; }

/* ---- About / CV blocks ------------------------------------------------------------ */
.cv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap) clamp(32px, 6vw, 80px);
}
@media (max-width: 720px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-block dt { margin-bottom: 1em; }
.cv-block dd { margin: 0 0 1.4em 0; }
.cv-block dd .role { font-family: var(--f-ui); font-weight: 700; }
.cv-block dd .time { color: var(--c-grey); font-size: 0.85rem; }

.skills-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skills-list li {
  border: 1px solid var(--c-line);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: var(--f-mono);
}

/* ---- Video ------------------------------------------------------------------------- */
.gallery video { width: 100%; background: var(--c-black); }
.case-video--capped {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  display: block;
  background: var(--c-black);
}

/* ---- Color palette --------------------------------------------------------------------- */
.palette { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.palette__swatch { width: 120px; }
.palette__chip {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--c-line);
}
.palette__label { font-family: var(--f-ui); font-weight: 700; font-size: 0.75rem; margin-top: 8px; }
.palette__hex { font-family: var(--f-mono); font-size: 0.72rem; color: var(--c-grey); }

/* ---- Phone-frame embed (mobile web app demos) --------------------------------------- */
.phone-frame {
  width: min(340px, 100%);
  margin-inline: auto;
  border: 10px solid var(--c-black);
  border-radius: 36px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  background: var(--c-black);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.35);
}
.phone-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---- Wide embed (desktop web demos) ------------------------------------------------- */
.embed-frame {
  width: 100%;
  height: 75vh;
  min-height: 420px;
  border: 1px solid var(--c-line);
  background: var(--c-white);
}

/* ---- QR callout ----------------------------------------------------------------------- */
.qr-callout {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--c-line);
  padding: 20px;
}
.qr-callout img { width: 96px; height: 96px; flex-shrink: 0; }
.qr-callout p { font-family: var(--f-mono); font-size: 0.85rem; }

/* ---- Utility ------------------------------------------------------------------------ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.stack { display: flex; flex-direction: column; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
