/*
Theme Name: Rutger Hartog
Theme URI: https://rutgerhartog.nl
Author: Rutger Hartog
Author URI: https://rutgerhartog.nl
Description: Bold poster-style portfolio theme for a motion & creative designer — full-bleed showreel hero with a rotating headline, bento-style content pages, a full-screen menu, and a project lightbox.
Version: 1.0.13
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rutger-hartog
*/

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --red: #ff1e1e;
  --black: #0d0d0d;
  --paper: #f4f4f5;
  --muted: #b9b9b9;
  --gutter: clamp(1rem, 2.5vw, 2.5rem);

  /* landing hero */
  --video-h: 32vh;
  --black-h: 30vh;
  --headline-size: clamp(2rem, min(16.5vw, 28vh), 18rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  background: var(--black);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* front page is a single fixed viewport */
body.landing { overflow: hidden; }

/* prevent background scroll when the menu is open */
body.menu-open { overflow: hidden; }

/* ---------------- hamburger button ---------------- */
.hamburger {
  position: fixed;
  top: clamp(1rem, 2.2vh, 1.5rem);
  left: var(--gutter);
  z-index: 200;
  width: 2.8rem; height: 2.4rem;
  display: grid; align-content: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.hamburger span {
  display: block;
  width: 30px; height: 3px;
  background: var(--red); border-radius: 2px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  transition: transform 0.3s ease, opacity 0.2s ease, background 0.2s ease;
}
.hamburger.is-open span { background: var(--black); filter: none; }
.hamburger.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------------- full-screen menu ---------------- */
.menu {
  position: fixed; inset: 0;
  z-index: 150;
  background: var(--red);
  color: var(--black);
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: clamp(4rem, 11vh, 8rem) var(--gutter) clamp(3.5rem, 9vh, 6rem);
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.menu.is-open { opacity: 1; visibility: visible; }

.menu__list { list-style: none; display: flex; flex-direction: column; margin: auto 0; }
.menu__list li {
  transform: translateY(18px); opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.menu.is-open .menu__list li { transform: none; opacity: 1; }
.menu.is-open .menu__list li:nth-child(1) { transition-delay: 0.06s; }
.menu.is-open .menu__list li:nth-child(2) { transition-delay: 0.12s; }
.menu.is-open .menu__list li:nth-child(3) { transition-delay: 0.18s; }
.menu.is-open .menu__list li:nth-child(4) { transition-delay: 0.24s; }
.menu.is-open .menu__list li:nth-child(5) { transition-delay: 0.30s; }
.menu.is-open .menu__list li:nth-child(6) { transition-delay: 0.36s; }

.menu__link {
  display: inline-block;
  font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.6rem, min(8vw, 8.5vh), 5.5rem);
  line-height: 1.04; letter-spacing: -0.02em;
  text-decoration: none; color: var(--black);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu__link:hover { transform: translateX(0.25em); opacity: 0.75; }
/* current page rendered as the italic-serif accent (WP adds current-menu-item on the li) */
.menu__link.is-current,
.current-menu-item > .menu__link {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic; font-weight: 700; text-transform: none;
  padding-left: 0.1em;
}

.menu__foot {
  position: absolute; left: var(--gutter); right: var(--gutter);
  bottom: clamp(1rem, 2.6vh, 1.8rem);
  display: flex; justify-content: space-between;
  font-weight: 900; font-size: clamp(0.8rem, 1.3vw, 1.1rem);
}

/* ---------------- generic sub-page scaffold ---------------- */
.subpage { background: var(--black); color: var(--paper); min-height: 100vh; }
/* The <body> also carries .subpage; make it a flex column that can grow past
   the viewport (html,body{height:100%} would otherwise pin it), so the
   site-footer sits after the content instead of overlapping it. */
body.subpage { height: auto; display: flex; flex-direction: column; }
body.subpage > main.subpage { flex: 1 0 auto; }
body.subpage > .site-footer { flex: 0 0 auto; }

.wrap {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(6rem, 15vh, 10rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.eyebrow {
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: clamp(0.75rem, 1.1vw, 0.95rem); color: var(--red);
  margin-bottom: 1.2rem;
}

.page-title {
  font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.6rem, 11vw, 8.5rem); line-height: 0.88; letter-spacing: -0.03em;
}
.page-title em {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic; font-weight: 700; text-transform: none; color: var(--red);
}
.page-title--serif { padding-left: 0.09em; }

.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.5rem); line-height: 1.5;
  max-width: 60ch; margin-top: 1.6rem; color: var(--muted);
}

.placeholder-note {
  margin-top: 0.6rem; font-size: 0.85rem; color: #7a7a7a; font-style: italic;
}

/* ---------------- long-form legal page (algemene voorwaarden) ---------------- */
.legal { max-width: 72ch; margin-top: clamp(2rem, 6vh, 3.2rem); }
.legal__intro {
  color: var(--muted); line-height: 1.6;
  font-size: clamp(1.02rem, 1.5vw, 1.25rem); margin: 0 0 0.5rem;
}
.legal__art { margin-top: clamp(1.8rem, 4vh, 2.6rem); padding-top: clamp(1.4rem, 3vh, 2rem); border-top: 1px solid #262626; }
.legal__art h2 {
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em;
  font-size: clamp(1.05rem, 1.9vw, 1.45rem); line-height: 1.1; margin: 0 0 1rem; color: var(--paper);
}
.legal__art ol { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
.legal__art li { color: var(--muted); line-height: 1.6; font-size: clamp(0.95rem, 1.2vw, 1.06rem); padding-left: 0.2rem; }
.legal__art li::marker { color: var(--red); font-weight: 700; }
.legal__art li strong { color: var(--paper); font-weight: 700; }
.legal__meta { margin-top: clamp(2.2rem, 5vh, 3rem); color: #7a7a7a; font-size: 0.85rem; line-height: 1.5; }

/* ---------------- shared site footer (sub-pages) ---------------- */
.site-footer {
  background: var(--black); color: #7a7a7a;
  border-top: 1px solid #262626;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 0.6rem 1.2rem;
  padding: 1.5rem var(--gutter);
  font-size: 0.82rem; letter-spacing: 0.02em;
}
.site-footer__link { color: #9a9a9a; text-decoration: none; font-weight: 700; }
.site-footer__link:hover, .site-footer__link:focus-visible { color: var(--red); }
/* discreet legal link inside the front-page poster credit row */
.footer__legal { color: inherit; text-decoration: none; font-weight: 700; opacity: 0.82; }
.footer__legal:hover, .footer__legal:focus-visible { opacity: 1; text-decoration: underline; }
@media (max-width: 480px) { .footer__legal { display: none; } }

/* ---------------- bento grid ---------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(150px, auto);
  grid-auto-flow: row dense;
  gap: clamp(0.7rem, 1.2vw, 1.1rem);
  margin-top: clamp(2rem, 6vh, 3.5rem);
}

.box {
  background: #161616;
  border: 1px solid #242424;
  border-radius: 18px;
  padding: clamp(1.1rem, 2vw, 1.8rem);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.box h2, .box h3 { font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.05; }
.box h3 { font-size: clamp(1rem, 1.5vw, 1.25rem); }
.box h2 { font-size: clamp(1.25rem, 2.2vw, 1.9rem); }
.box p  { color: var(--muted); line-height: 1.5; font-size: clamp(0.95rem, 1.25vw, 1.08rem); }
.box .big {
  font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.7rem, 3.4vw, 3rem); line-height: 0.95; letter-spacing: -0.02em;
}
.box .serif { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; text-transform: none; color: var(--red); }

.box--red { background: var(--red); color: var(--black); border-color: transparent; }
.box--red p { color: rgba(0,0,0,0.72); }
.box--red .serif { color: var(--black); }
.box--outline { background: transparent; border: 1px solid #333; }
.box--media {
  background-color: #1c1c1c;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  justify-content: flex-end; position: relative; overflow: hidden;
}
/* dark scrim on clickable media tiles so the label stays readable over the thumbnail */
a.box--media::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0) 60%);
  transition: background 0.2s ease;
}
a.box--media:hover::after { background: linear-gradient(to top, rgba(255,30,30,0.55), rgba(0,0,0,0.1) 70%); }
.box--media .tag { position: relative; z-index: 1; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }

/* portrait: always a square that scales with the column width */
.box--portrait {
  padding: 0; padding-top: 100%;   /* 1:1, height follows width */
  position: relative; overflow: hidden; background: #1c1c1c;
}
.box--portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

a.box { text-decoration: none; color: inherit; transition: transform 0.2s ease, background 0.2s ease; }
a.box:hover { transform: translateY(-3px); }

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.row-2 { grid-row: span 2; }
.row-3 { grid-row: span 3; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; align-content: flex-start; }
.chip {
  border: 1px solid currentColor; border-radius: 999px;
  padding: 0.3rem 0.8rem; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85;
}

.mini { display: flex; flex-direction: column; gap: 0; margin-top: 0.3rem; }
.mini .line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid #2a2a2a; font-size: 0.98rem; }
.box--red .mini .line { border-color: rgba(0,0,0,0.18); }
.mini .line:last-child { border-bottom: 0; }
.mini .t { font-weight: 900; }
.mini .r { color: var(--muted); }
.box--red .mini .r { color: rgba(0,0,0,0.65); }

.form { margin-top: 0.6rem; display: grid; gap: 1rem; }
.form label { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; }
.form input, .form textarea {
  width: 100%; background: #161616; border: 1px solid #2b2b2b; color: var(--paper);
  padding: 0.9rem 1rem; font: inherit; border-radius: 3px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--red); border-color: transparent; }
.form button {
  justify-self: start; background: var(--red); color: var(--black);
  border: 0; border-radius: 3px; padding: 0.9rem 1.6rem; cursor: pointer;
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
  transition: transform 0.2s ease;
}
.form button:hover { transform: translateY(-2px); }

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .col-6, .col-4 { grid-column: span 4; }
  .col-3 { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .col-2, .col-3, .col-4, .col-6 { grid-column: span 1; }
  .row-2, .row-3 { grid-row: auto; }
  /* keep the red "Selected work" box at the top on mobile */
  .box--priority { order: -1; }
}

/* ---------------- project modal / lightbox ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(10, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
body.modal-open { overflow: hidden; }

.modal {
  width: min(920px, 100%); max-height: 86vh; overflow: auto;
  background: #141414; border: 1px solid #2a2a2a; border-radius: 22px;
  padding: clamp(1.4rem, 3vw, 2.6rem); position: relative;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s ease;
}
.modal-backdrop.is-open .modal { transform: none; }

.modal__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 0;
  background: var(--red); color: var(--black);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.2s ease;
}
.modal__close:hover { transform: scale(1.08); }

.modal__media {
  aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #1c1c1c, #262626);
  display: grid; place-items: center;
  color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em;
}
/* multiple videos stacked inside the modal */
.modal__media.has-videos {
  aspect-ratio: auto; background: none; display: block; padding: 0;
}
.modal__vid {
  position: relative; width: 100%; height: 0; padding-top: 56.25%; /* 16:9 */
  border-radius: 12px; overflow: hidden; background: #000;
}
.modal__vid + .modal__vid { margin-top: 0.9rem; }
.modal__vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* portrait (9:16) videos shown side by side.
   NOTE: a padding-top % resolves against the flex CONTAINER width, not the
   column width, so it can't size each column — use aspect-ratio instead. */
.modal__media.is-portrait { display: flex; gap: 0.7rem; justify-content: center; }
.modal__media.is-portrait .modal__vid {
  flex: 1 1 0; width: auto; height: auto; padding-top: 0;
  aspect-ratio: 9 / 16; max-height: 78vh;
}
.modal__media.is-portrait .modal__vid + .modal__vid { margin-top: 0; }

.modal__eyebrow { color: var(--red); font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; }
.modal__title {
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(1.6rem, 4vw, 3rem); line-height: 0.95; margin: 0.5rem 0 1.1rem;
}
.modal__title em { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; text-transform: none; color: var(--red); }
.modal__body p { color: var(--muted); line-height: 1.6; font-size: clamp(0.98rem, 1.4vw, 1.15rem); }
.modal__body p + p { margin-top: 0.9rem; }

/* ============================================================
   Landing hero (front page)
   ============================================================ */
.page {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: var(--video-h) var(--black-h) 1fr;
}

.band { position: relative; overflow: hidden; }
.band--video { background: var(--black); container-type: size; }
.band--black { background: var(--black); overflow: visible; }
.band--red {
  background: linear-gradient(180deg,
    var(--red) 0%, var(--red) 55%, #a81414 80%, #3a0808 100%);
}

.band--video iframe {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(100cqw, 177.78cqh);
  height: max(56.25cqw, 100cqh);
  border: 0; display: block;
}

.reel-controls {
  position: absolute; z-index: 6;
  right: var(--gutter); bottom: 0.7rem;
  display: flex; gap: 0.55rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.band--video:hover .reel-controls,
.band--video:focus-within .reel-controls { opacity: 1; pointer-events: auto; }
.rbtn {
  width: clamp(2.2rem, 3vw, 2.8rem); height: clamp(2.2rem, 3vw, 2.8rem);
  border: 0; border-radius: 50%;
  background: var(--red); color: var(--black);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.rbtn:hover { transform: scale(1.07); }
.rbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rbtn svg { width: 46%; height: 46%; display: block; fill: currentColor; }

.footer {
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  bottom: clamp(1rem, 2.6vh, 1.8rem);
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--black); font-weight: 900;
  font-size: clamp(0.85rem, 1.4vw, 1.25rem); line-height: 1.1;
  white-space: nowrap; z-index: 5;
}

.headline {
  position: absolute;
  font-size: var(--headline-size);
  line-height: 0.8; letter-spacing: -0.03em; white-space: nowrap;
}
.word-rotor {
  right: var(--gutter);
  bottom: 0.14em;
  color: var(--red);
  text-align: right;
  /* same size as DESIGNER, right-aligned to match */
  font-size: var(--headline-size);
}
.word-designer {
  right: var(--gutter);
  top: -0.055em;
  color: var(--black);
  font-weight: 900; text-transform: uppercase;
}

.swap {
  display: inline-block;
  transform-origin: left bottom;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700; font-style: italic;
  letter-spacing: -0.01em; white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.swap.is-out { opacity: 0; transform: translateY(-0.3em); }
.swap.is-in  { opacity: 0; transform: translateY(0.3em); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .hamburger span, .menu, .menu__list li, .menu__link, a.box, .contact-links a,
  .modal-backdrop, .modal, .modal__close, .swap { transition: none; }
  .swap.is-out, .swap.is-in { transform: none; }
}
