/* ============================================================
   SITE.CSS — Shared styles for all pages
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0E0E0E;
  --white: #F0EDE8;
  --gold:  #C8A96E;
  --mid:   #5A5A5A;
  --light: #D4D0CA;
  --dim:   #1A1A1A;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ─── Navigation ──────────────────────────────────────────── */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15%;
  height: 64px;
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200,169,110,0.15);
}

.nav-logo {
  font-family: var(--font-nav-title, var(--font-display, 'Playfair Display', serif));
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--nav-title-color, var(--white));
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 40px; list-style: none; }
.nav-links > li { position: relative; }
.nav-links > li > a {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nav-links-color, var(--light));
  transition: color 0.2s;
}
.nav-links > li > a:hover,
.nav-links > li > a.active { color: var(--gold); }

.nav-work-btn {
  background: none; border: none; padding: 0; font: inherit;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nav-links-color, var(--light));
  cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: color 0.2s;
}
.nav-work-btn:hover, .nav-work-btn[aria-expanded="true"] { color: var(--gold); }
.nav-work-btn .caret {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid currentColor; transition: transform 0.2s; margin-top: 1px;
}
.nav-work-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #1A1A1A; border: 1px solid rgba(200,169,110,0.2);
  min-width: 210px; padding: 8px 0; opacity: 0;
  pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 200;
}
.dropdown.open { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
.dropdown a {
  display: block; padding: 11px 20px; font-size: 12px;
  letter-spacing: 0.10em; text-transform: none;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  color: var(--nav-title-color, var(--light));
  transition: color 0.15s, background 0.15s;
}
.dropdown a:hover, .dropdown a:focus {
  color: var(--gold); background: rgba(200,169,110,0.06); outline: none;
}

/* ─── Hamburger (mobile) ──────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 410;
  flex-direction: column;
  gap: 6px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--light);
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.hamburger:hover span { background: var(--gold); }
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;      /* top-aligned: never clips at the top */
  /* Start below the status bar / notch, and allow scrolling if the list is
     taller than the screen. Safe-area insets keep it clear of the notch and
     the home-indicator on iPhones. */
  padding: calc(72px + env(safe-area-inset-top, 0px)) 8% calc(48px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }

/* ── Rotate-to-portrait overlay ──────────────────────────────
   Hidden by default; shown only when a phone-sized screen is held in
   landscape (short viewport height rules out tablets/laptops). This keeps
   the site portrait-only on phones, since true orientation lock isn't
   available to normal browser tabs. */
.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-lock {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--black);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
  }
  .rotate-lock-inner { max-width: 340px; }
  .rotate-lock svg {
    width: 54px; height: 54px; margin-bottom: 18px;
    fill: none; stroke: var(--gold); stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .rotate-lock p {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 20px; font-style: italic; color: var(--white); margin: 0;
  }
  /* Prevent the page behind from scrolling while the overlay is up */
  body { overflow: hidden; }
}

/* Close (×) button, top-right of the mobile menu. Sits in a translucent
   white circle so it stays visible over bright, full-bleed images. */
.mobile-menu .mm-close {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px)); right: 5%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.4);
  border: none; border-radius: 50%; padding: 0; cursor: pointer;
  color: #111;
  backdrop-filter: blur(2px);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 2;
}
.mobile-menu .mm-close:hover { color: var(--gold); transform: rotate(90deg); }
.mobile-menu .mm-close svg {
  width: 24px; height: 24px; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}

.mobile-menu .mm-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--gold); margin: 28px 0 14px;
}
.mobile-menu .mm-label:first-child { margin-top: 0; }

.mobile-menu a.mm-link {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 400;
  color: var(--white);
  padding: 7px 0;
  display: block;
  transition: color 0.2s, transform 0.2s;
}
.mobile-menu a.mm-link:hover { color: var(--gold); transform: translateX(6px); }

.mobile-menu a.mm-sub {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--light);
  padding: 11px 0;
  display: block;
  transition: color 0.2s, transform 0.2s;
}
.mobile-menu a.mm-sub:hover { color: var(--gold); transform: translateX(6px); }

.mobile-menu .mm-socials { margin-top: 40px; }
.mobile-menu .mm-socials .social-icons { gap: 26px; }
.mobile-menu .mm-socials .social-icons svg { width: 22px; height: 22px; }

/* Mobile-break marker in the nav title: a normal space on desktop… */
.nav-logo .mobile-break { white-space: normal; }

/* ─── Social icons ────────────────────────────────────────── */
.social-icons { display: flex; align-items: center; gap: 18px; }
.social-icons a {
  display: flex; align-items: center; justify-content: center;
  color: var(--nav-links-color, var(--mid));
  transition: color 0.2s, transform 0.2s;
}
.social-icons a:hover { color: var(--gold); transform: translateY(-2px); }
.social-icons svg { width: 16px; height: 16px; fill: currentColor; }

.footer-socials { margin-top: 28px; }
.footer-socials .social-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 16px;
}
.footer-socials .social-icons { gap: 22px; }
.footer-socials .social-icons svg { width: 20px; height: 20px; }

/* ─── Footer ──────────────────────────────────────────────── */
footer.site-footer {
  border-top: 1px solid rgba(200,169,110,0.15);
  padding: 80px 15% 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.site-footer h3 {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 28px;
}

.sitemap-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; list-style: none; }
.sitemap-links a { font-size: 16px; letter-spacing: 0.06em; color: var(--mid); transition: color 0.2s; }
.sitemap-links a:hover { color: var(--white); }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-field input, .form-field textarea {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid rgba(200,169,110,0.25); padding: 10px 0;
  font-family: var(--font-body, 'Inter', sans-serif); font-size: 16px; font-weight: 300;
  color: var(--white); letter-spacing: 0.06em; outline: none;
  transition: border-color 0.2s; resize: none;
}
.form-field input::placeholder, .form-field textarea::placeholder {
  color: var(--mid); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
}
.form-field input:focus, .form-field textarea:focus { border-bottom-color: var(--gold); }
.form-field textarea { min-height: 80px; }
.form-field input.touched:invalid, .form-field textarea.touched:invalid { border-bottom-color: #C85A5A; }

.btn-send, .btn-gold {
  align-self: flex-start; margin-top: 10px; padding: 12px 36px;
  font-family: var(--font-body, 'Inter', sans-serif); font-size: 11px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  display: inline-block;
  transition: background 0.2s, color 0.2s;
  /* Filled (inverted) by default for visibility; outline on hover */
  background: var(--gold); color: var(--black); border: 1px solid var(--gold);
}
.btn-send:hover, .btn-gold:hover { background: transparent; color: var(--gold); }

/* Back button row at the bottom of work gallery pages */
.work-back-wrap {
  padding: 60px 15% 100px;
  display: flex;
  justify-content: center;
}
@media (max-width: 900px) {
  .work-back-wrap { padding: 48px 5% 72px; }
}

.form-message { font-size: 14px; letter-spacing: 0.06em; color: var(--gold); min-height: 18px; }

/* Success state — replaces the form after a successful send */
.form-success { display: none; }
.form-success.show { display: block; }
.form-success .fs-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: clamp(26px, 3vw, 36px); font-weight: 700;
  color: var(--white); margin: 6px 0 22px;
}
.contact-form.sent { display: none; }

/* Honeypot — visually removed but still in the DOM so bots fill it.
   Not display:none (some bots skip those); pushed off-screen instead. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Visually hidden — removed from view but kept as real, readable text in the
   DOM. Used for the crawler-facing content snapshot: many text extractors and
   non-JS scrapers skip elements with the `hidden` attribute entirely, but they
   do read clipped content like this.

   NOTE: these blocks duplicate content that JavaScript renders on the page, so
   they carry aria-hidden="true" — otherwise screen-reader users would hear
   everything twice. Sighted users never see it; screen readers skip it; text
   extractors still read it. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.footer-bar {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(200,169,110,0.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bar span { font-size: 11px; color: var(--mid); letter-spacing: 0.1em; }

/* ─── Work pages: masonry + lightbox ─────────────────────── */
.work-header { padding: 140px 15% 56px; }
.work-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 20px;
}
.work-title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 400; line-height: 1.1; margin-bottom: 28px;
}
.work-intro { font-size: 15px; color: var(--mid); line-height: 1.8; max-width: 560px; }

.gallery-section { padding: 0 15% 100px; }

/* Standard masonry (Projects, Packaging, Advertising) — 3 cols → 2 cols → 1 */
.masonry { column-count: 3; column-gap: 16px; }

/* Dense masonry (Poster Design) — 6 cols → 5 → 4 → 3 → 2.
   Posters are typically portrait, so more columns at every breakpoint and
   never drop to 1 column. */
.masonry.dense                            { column-count: 6; column-gap: 14px; }
@media (max-width: 1600px) { .masonry.dense { column-count: 5; } }
@media (max-width: 1300px) { .masonry.dense { column-count: 4; } }
@media (max-width: 1000px) { .masonry.dense { column-count: 3; } }
@media (max-width: 700px)  { .masonry.dense { column-count: 2; } }

.masonry-item {
  break-inside: avoid; margin-bottom: 16px; position: relative;
  overflow: hidden; cursor: pointer; background: var(--dim);
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.masonry-item.visible { opacity: 1; transform: translateY(0); }
.masonry-item img { width: 100%; display: block; transition: opacity 0.35s ease, transform 0.5s ease; }
.masonry-item:hover img { opacity: 0.3; transform: scale(1.03); }
.masonry-overlay {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 24px; opacity: 0;
  transition: opacity 0.35s ease; pointer-events: none;
}
.masonry-item:hover .masonry-overlay { opacity: 1; }
.masonry-overlay span {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: clamp(13px, 1.3vw, 17px); font-style: italic;
  color: var(--white); text-align: center; line-height: 1.4;
  padding-bottom: 6px; border-bottom: 1px solid var(--gold);
}

/* Case-study indicator — small arrow shown on items that link to a project page */
.masonry-item.has-case-study::after {
  content: '↗';
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,14,14,0.78);
  color: var(--gold);
  border: 1px solid rgba(200,169,110,0.4);
  font-size: 14px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(-4px);
  pointer-events: none;
}
.masonry-item.has-case-study:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,10,0.96);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  padding: 48px 6%;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img-wrap { max-width: 100%; max-height: calc(100% - 110px); display: flex; align-items: center; justify-content: center; }
.lightbox-img-wrap img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.lightbox-caption { text-align: center; margin-top: 28px; }
.lightbox-title { font-family: var(--font-display, 'Playfair Display', serif); font-size: 18px; font-style: italic; color: var(--white); margin-bottom: 6px; }
.lightbox-sub { font-size: 12px; letter-spacing: 0.1em; color: var(--mid); }
.lightbox-counter { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); margin-top: 14px; }

.lb-btn {
  position: absolute; border: none;
  /* Translucent white circle so the icon stays visible over dark backdrops
     AND light posters alike. Dark icon reads on the light circle either way. */
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  width: 48px; height: 48px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #111; cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background 0.2s, color 0.2s; z-index: 510;
}
.lb-btn:hover { background: rgba(255,255,255,0.6); color: var(--gold); }
.lb-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.lb-close { top: calc(20px + env(safe-area-inset-top, 0px)); right: 24px; }
.lb-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }

/* Slightly larger tap targets and safe-area-aware spacing on phones */
@media (max-width: 700px) {
  .lb-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }
  .lb-prev  { left: 8px; }
  .lb-next  { right: 8px; }
}

/* ─── Rich-text formatting (formatText output) ───────────── */
/* Rich-text inline links — accent-colored with subtle underline */
.rt-link {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
.rt-link:hover { opacity: 0.75; }

/* Underline uses the page's accent color — scales nicely at any font size */
.rt-underline {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.1em;
}
/* Lists generated from "* item" markup in description fields */
.rt-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}
.rt-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  line-height: 1.7;
}
.rt-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}
.rt-list li:last-child { margin-bottom: 0; }

/* Stack paragraphs in rich-text blocks with proper spacing */
.section-blurb p,
.project-blurb p,
.timeline-desc p,
.about-bio p {
  margin-bottom: 14px;
}
.section-blurb p:last-child,
.project-blurb p:last-child,
.timeline-desc p:last-child,
.about-bio p:last-child { margin-bottom: 0; }

/* When a blurb contains centered or right-aligned content, the parent
   text container drops its max-width so the alignment is across the full
   page column rather than within a 720px reading-width gutter. */
.section-text.has-aligned,
.section-text.has-aligned .section-blurb,
.project-blurb.has-aligned {
  max-width: none;
  width: 100%;
}

/* Bold/italic inherit nicely */
.section-blurb strong,
.project-blurb strong,
.timeline-desc strong,
.about-bio strong { color: var(--white); font-weight: 600; }

@media (max-width: 1000px) {
  .masonry { column-count: 2; }
}

@media (max-width: 900px) {
  nav.site-nav { padding: 0 5%; }
  nav.site-nav .nav-links,
  nav.site-nav .nav-socials { display: none; }
  .hamburger { display: flex; }
  /* The site name is long — size it down on mobile so its two lines sit
     comfortably inside the 64px bar instead of touching the edges. */
  .nav-logo { font-size: 13px; line-height: 1.4; padding-right: 12px; }
  /* …and where the name contains a mobile break marker, force the break */
  .nav-logo .mobile-break { display: block; height: 0; }

  .work-header { padding: 110px 5% 40px; }
  .gallery-section { padding: 0 5% 60px; }

  footer.site-footer { grid-template-columns: 1fr; gap: 48px; padding: 60px 5% 40px; }
}

@media (max-width: 600px) {
  .masonry { column-count: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .masonry-item { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ─── Print styles ───────────────────────────────────────────
   Recruiters and hiring managers often print or save-to-PDF. Convert the
   dark, interactive site into clean black-on-white documents: hide nav,
   footer, forms, videos, and hover chrome; force readable colors; reveal
   any scroll-hidden content; avoid awkward page breaks. */
@media print {
  /* Force a light, ink-friendly palette regardless of the site's theme */
  :root {
    --black: #ffffff;
    --white: #111111;
    --light: #222222;
    --mid: #555555;
    --dim: #f0f0f0;
  }
  html, body { background: #fff !important; color: #111 !important; }

  /* Hide interactive / non-content chrome */
  nav.site-nav, .hamburger, .mobile-menu, footer.site-footer,
  .contact-form, .form-success, .hero-dots, .lightbox,
  .rotate-lock, .page-bg-video-layer, video, iframe,
  .btn-send, .btn-gold, .back-link-wrap, .work-back-wrap,
  .tw-back, .nav-socials { display: none !important; }

  /* Reveal anything hidden by scroll animations so it prints */
  .tile, .masonry-item, .project-section, .rv, [style*="opacity: 0"] {
    opacity: 1 !important; transform: none !important;
  }

  /* Let content use the full page width */
  .hero, .mosaic-section, .project-page, .content-col,
  .work-header, .gallery-section, .wrap {
    padding-left: 4% !important; padding-right: 4% !important;
    margin: 0 !important;
  }

  /* Images shouldn't split across pages */
  img, figure, .tile, .masonry-item { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }

  /* Show link URLs after link text so printed pages remain useful */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }

  a { color: #111 !important; text-decoration: underline; }
}
