/* ================================================================
   Hello-Archi(R) — Architecture Studio
   base.css  (shared core — loaded on every page, first)
   Tokens, reset, section labels, scroll-progress, sticky header,
   mobile nav, floating CTA + buttons, the shared .hero shell,
   testimonials, the shared journal/article-card components, the
   final CTA, footer + newsletter, reveal animations, shared
   responsive rules, the "Start your project" modal, the Work /
   portfolio filter + card grid, and the shared .proj-back link.
   Page-specific styles live in css/<page>.css, loaded after this.
   Palette: neutral monochrome — near-black / off-white / cool greys
   ================================================================ */

/* ---------- Design tokens ---------- */
:root {
  --black: #0a0a0a;        /* near-pure black */
  --near-black: #141414;
  --white: #f5f5f5;        /* neutral off-white */
  --beige: #d1d1d1;        /* light neutral grey (footer/dark-bg text) */
  --beige-deep: #c4c4c4;   /* hairline borders / dividers */
  --grey: #6e6e6e;         /* muted grey */
  --grey-light: #a0a0a0;   /* secondary grey */
  --green: #2a2a2a;        /* dark-neutral accent (hover states) */
  --green-deep: #1e1e1e;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 90px);
  --maxw: 1500px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  font-family: var(--font-sans);
  background: var(--black);
  color: var(--white);
  font-size: 1rem;          /* 16px — body copy sits in the 15-17px band */
  line-height: 1.55;        /* airy body leading (1.45-1.6) */
  overflow-x: hidden;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
em { font-style: italic; font-family: var(--font-serif); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Small eyebrow labels used throughout — left-aligned, paired with a dot */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.75rem;          /* ~12px — small-label band (11-13px) */
  letter-spacing: 0.08em;      /* subtle tracking */
  text-transform: uppercase;
  color: var(--grey-light);    /* soft grey, not pure white */
  margin-bottom: 2.5rem;
}
/* Small circular dot to the left of every eyebrow label */
.section-label::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ================================================================
   SCROLL PROGRESS INDICATOR (top centre)
   ================================================================ */
.scroll-progress {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  color: var(--white);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.scroll-progress.is-visible { opacity: 1; }
.scroll-progress__value { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.scroll-progress__track {
  width: 80px;
  height: 2px;
  background: rgba(245, 245, 245, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--white);
  transition: width 0.1s linear;
}

/* ================================================================
   SITE HEADER (single sticky header for every page)
   Sits transparently over the hero at the top, then gains a blurred
   dark background + hairline border once the user scrolls (.is-stuck).
   It replaces the old in-hero .hero__top bar, so there is only ever
   one header on screen.
   ================================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: calc(clamp(16px, 2.4vw, 28px) + 5px) var(--gutter) clamp(16px, 2.4vw, 28px);
  color: var(--white);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease),
              border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.site-header.is-stuck {
  padding-block: 19px 20px;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(8px);
  border-bottom-color: rgba(245, 245, 245, 0.08);
}
/* Reuse the hero nav link treatment for a consistent look */
.site-header .hero__nav a { opacity: 0.85; }
.site-header .hero__nav a.is-current { opacity: 1; }
.site-header .hero__nav a.is-current::after { width: 100%; }

/* ---- Mobile hamburger toggle (hidden on desktop) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: none;
  border: none;
  cursor: pointer;
}
/* Positioning is set in the mobile breakpoint where the toggle is shown
   (see @media max-width:760px). It is fixed in BOTH states so opening the
   menu never shifts the icon. */
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile slide-in nav overlay ---- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(10px);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0.45s var(--ease);
}
body.nav-open .mobile-nav { transform: translateX(0); visibility: visible; }
.mobile-nav__close {
  position: absolute;
  top: calc(clamp(16px, 2.4vw, 28px) + 5px);
  right: var(--gutter);
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.mobile-nav a {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--white);
  opacity: 0.85;
  padding: 0.4rem 0;
}
.mobile-nav a.is-current { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }

/* ================================================================
   FLOATING "START A PROJECT" BUTTON (bottom right)
   ================================================================ */
.floating-cta {
  --dock-y: 0px;                /* JS lifts the button by this much to park it in the CTA section */
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 22px;
  background: var(--white);
  color: var(--black);
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), background 0.3s ease;
}
/* Visible & floating: sits at its fixed bottom-centre spot. As the final CTA
   section scrolls up, JS raises --dock-y so this same element rises and parks
   over the section's anchor — one element, no jump, no duplicate. */
.floating-cta.is-visible {
  transform: translateX(-50%) translateY(calc(-1 * var(--dock-y)));
  opacity: 1;
}
/* While docking we follow the scroll every frame, so suppress the transform
   transition (only the look keeps easing). JS adds .is-docking. Docked, the
   button takes on the original in-section look: transparent with a border,
   white text — and fills white on hover, exactly like the old .btn-pill. */
.floating-cta.is-docking {
  background: transparent;
  color: var(--white);
  border: 1px solid currentColor;
  box-shadow: none;
  transition: opacity 0.6s var(--ease), background 0.35s var(--ease),
              color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.floating-cta.is-docking:hover { background: var(--white); color: var(--black); }
.floating-cta span {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  font-size: 1.05em;
  line-height: 0;
  transition: transform 0.4s var(--ease);
}
.floating-cta:hover { background: var(--green); color: var(--white); }
.floating-cta:hover span { transform: rotate(90deg); }

/* Generic pill button */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;            /* compact with generous padding */
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font-family: inherit;
  font-size: 0.88rem;            /* ~14px — CTA text band (13-15px) */
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn-pill span { transition: transform 0.4s var(--ease); }
.btn-pill:hover { background: var(--white); color: var(--black); transform: translateY(-2px); }
.btn-pill:hover span { transform: rotate(90deg); }

/* Brand logo */
.logo {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.logo sup { font-size: 0.5em; top: -0.8em; }
.logo--light { color: var(--white); }
/* Uploaded logo image (replaces the text brand). Scales to the line height of
   whatever wrapper it sits in — header, footer or preloader. */
.logo__img { display: block; height: 1.6em; width: auto; }
.preloader__logo .logo__img { height: 1.4em; }

/* ================================================================
   HERO (shared shell — used by home, studio, work, journal, project)
   Page-specific hero extras (home rotating words + scroll hint, the
   studio/work/journal scroll cue sizing) layer on top via the page
   CSS; the rotating-words rules below are home-only but harmless
   elsewhere.
   ================================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* content sits low; header is the fixed .site-header */
  color: var(--white);
  overflow: hidden;
  padding-block: clamp(24px, 4vw, 48px);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  z-index: -2;
  will-change: transform;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.45) 0%, rgba(10,10,10,0.15) 35%, rgba(10,10,10,0.7) 100%);
  z-index: -1;
}
.hero__nav { display: flex; gap: clamp(14px, 2vw, 34px); }
.hero__nav a {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.85;
  position: relative;
  transition: opacity 0.3s ease;
}
.hero__nav a::after {
  content: '';
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: currentColor;
  transition: width 0.35s var(--ease);
}
.hero__nav a:hover { opacity: 1; }
.hero__nav a:hover::after { width: 100%; }

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;        /* centre everything horizontally */
  text-align: center;
  padding-inline: var(--gutter);
  /* sit the block lower in the image (title pushed down) */
  padding-bottom: clamp(36px, 8vh, 90px);
}
.hero__words {
  display: flex;
  justify-content: center;    /* centred small label above the headline */
  align-items: baseline;
  gap: 0.4em;
  font-size: 0.95rem;         /* ~15px — hero label band (14-16px) */
  letter-spacing: 0.02em;
  margin-bottom: 1.4rem;
  font-weight: 400;           /* regular weight */
  color: var(--white);
}
.hero__word-rotator {
  position: relative;
  display: inline-grid;
  height: 1.4em;
  overflow: hidden;
}
.hero__word {
  grid-area: 1 / 1;
  font-family: var(--font-serif);
  font-style: italic;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.hero__word.is-active { transform: translateY(0); opacity: 1; }
.hero__word.is-leaving { transform: translateY(-110%); opacity: 0; }

.hero__headline {
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 1.1;            /* tight (1.05-1.15) */
  font-weight: 700;           /* large + bold */
  letter-spacing: -0.02em;
  max-width: 620px;           /* narrow editorial measure (500-650px) */
  margin-inline: auto;
}
.hero__headline em { font-size: 1.02em; }

.hero__scroll-hint {
  /* pinned to the right edge of the hero, vertically centred; the label and
     line stack vertically so the whole cue reads top-to-bottom */
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--beige);
  opacity: 0.8;
}
.hero__scroll-hint span:first-child {
  /* keep the label upright but reading vertically down the edge */
  writing-mode: vertical-rl;
}
.hero__scroll-line {
  width: 1px; height: 90px; background: currentColor; position: relative; overflow: hidden;
}
.hero__scroll-line::after {
  content: ''; position: absolute; inset: 0; background: var(--black);
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  60%,100% { transform: translateY(100%); }
}

/* ================================================================
   TESTIMONIALS (shared — home + work)
   ================================================================ */
.testimonials {
  background: var(--black);
  color: var(--white);
  padding-block: clamp(70px, 11vw, 150px);
}
.testimonials__label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--grey-light);
  margin-bottom: 1.6rem;
}
/* Already carries an explicit bullet element — drop the generic dot */
.testimonials__label::before { display: none; }
.testimonials__bullet {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--white);
  flex: none;
}
.testimonials__divider {
  height: 1px;
  background: rgba(245, 245, 245, 0.16);
  margin-bottom: clamp(48px, 7vw, 90px);
}
.testimonials__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(36px, 6vw, 100px);
  align-items: start;
}
.testimonials__heading {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);   /* section title (28-40px) */
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.testimonials__heading span { color: var(--grey-light); }

.testimonial-track {
  position: relative;
  min-height: clamp(200px, 22vw, 260px);
}
.testimonial {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
}
.testimonial.is-active { opacity: 1; transform: translateX(0); pointer-events: auto; position: relative; }
.testimonial.is-prev { transform: translateX(-50px); }
.testimonial__quote {
  font-size: clamp(1.3rem, 2vw, 1.8rem);   /* editorial quote, restrained */
  line-height: 1.34;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.testimonial__author {
  display: block;
  margin-top: 1.6rem;
  color: var(--grey-light);
  font-size: 0.8rem;                        /* ~13px metadata */
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Avatar selector — overlapping circles inside a pill, click to switch */
.testimonial-avatars {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(28px, 4vw, 48px);
  padding: 6px;
  border: 1px solid rgba(245, 245, 245, 0.18);
  border-radius: 999px;
}
.testimonial-avatars button {
  width: 46px;
  height: 46px;
  margin-left: -12px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: #2a2a2a;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(100%);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), filter 0.4s var(--ease);
}
.testimonial-avatars button:first-child { margin-left: 0; }
.testimonial-avatars button.is-active {
  background: var(--tone, #c45a2c);
  filter: grayscale(0%);
  transform: scale(1.08);
  z-index: 2;
}

/* ================================================================
   JOURNAL (shared — home + journal list page)
   ================================================================ */
.journal {
  background: var(--near-black);
  color: var(--white);
  padding-block: clamp(90px, 14vw, 190px);
}
.journal .section-label { color: var(--grey); }
.journal__head { margin-bottom: clamp(40px, 6vw, 80px); }
.journal__head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.journal__headline {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);   /* restrained section title (28-40px) */
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.journal__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(245, 245, 245, 0.5);
  transition: border-color 0.3s ease, opacity 0.3s ease;
}
.journal__more span { display: inline-block; transition: transform 0.35s var(--ease); }
.journal__more:hover { border-color: var(--white); opacity: 0.85; }
.journal__more:hover span { transform: translateX(4px); }
.journal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2vw, 34px);
}
.article-card { display: flex; flex-direction: column; }
.article-card__media {
  display: block;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  filter: grayscale(100%);
  transform: scale(1);
  transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}
.article-card__media:hover { filter: grayscale(0%); transform: scale(1.02); }
.article-card__body { padding-top: 1.4rem; }
.article-card__title {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.article-card__excerpt {
  margin-top: 0.7rem;
  color: var(--grey-light);
  font-size: 0.94rem;            /* ~15px body */
  line-height: 1.5;
}
.article-card__time {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.75rem;            /* ~12px read-time metadata */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ================================================================
   FINAL CTA (split parallax)
   ================================================================ */
.cta {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
  text-align: center;
}
.cta__half {
  position: absolute;
  top: -20%;
  height: 140%;            /* extra overflow so parallax never reveals a gap */
  width: 50%;
  background-size: cover;
  background-position: center;
  z-index: 0;
  will-change: transform;
}
.cta__half--left { left: 0; background-image: url("../images/cta-left.8dd7cd9fd260.jpg"); }
.cta__half--right { right: 0; background-image: url("../images/cta-right.7c95c4d3abda.jpg"); }
.cta__overlay { position: absolute; inset: 0; z-index: 1; background: rgba(10,10,10,0.55); }
.cta__inner { position: relative; z-index: 2; }
/* Reserves the resting height of the sticky button as it parks in this section. */
.cta__btn-anchor { height: 50px; }
.cta__text {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);   /* centred CTA statement, restrained */
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 0 auto clamp(34px, 5vw, 56px);
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: var(--black);
  color: var(--white);
  padding-block: clamp(60px, 9vw, 110px) 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(30px, 4vw, 60px);
  padding-bottom: clamp(28px, 4vw, 48px);
}
.footer__tagline {
  margin-top: 1.2rem;
  max-width: 28ch;
  color: var(--grey-light);
  font-size: 1rem;
  line-height: 1.5;
}
.footer__col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
  margin-bottom: 1.4rem;
  font-weight: 500;
}
.footer__col a,
.footer__col p {
  display: block;
  color: var(--beige);
  font-size: 0.98rem;
  margin-bottom: 0.7rem;
  transition: color 0.3s ease, transform 0.3s ease;
}
.footer__col a:hover { color: var(--white); transform: translateX(4px); }
.footer__social { display: flex; flex-direction: column; }

/* About-the-studio blurb (replaces the old newsletter form) */
.footer__about {
  margin-top: 2.4rem;
  max-width: 38ch;
  color: var(--grey-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 30px;
  border-top: 1px solid rgba(245,245,245,0.14);
  font-size: 0.78rem;          /* ~12px copyright metadata */
  letter-spacing: 0.04em;
  color: var(--grey);
}

/* ================================================================
   REVEAL ANIMATIONS (IntersectionObserver-driven)
   The services-grid stagger is home-only and lives in home.css; the
   journal-grid stagger stays here since the journal grid is shared.
   ================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
/* Stagger children inside the (shared) journal grid */
.journal__grid .reveal.is-in:nth-child(2) { transition-delay: 0.08s; }
.journal__grid .reveal.is-in:nth-child(3) { transition-delay: 0.16s; }
.journal__grid .reveal.is-in:nth-child(4) { transition-delay: 0.24s; }

/* ================================================================
   RESPONSIVE (shared rules)
   ================================================================ */
@media (max-width: 900px) {
  .studio__grid { grid-template-columns: 1fr; gap: 32px; }
  .studio__media { order: -1; height: 320px; min-height: 0; }
  .testimonials__grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 1080px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .journal__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; }
  /* Swap the inline nav for a hamburger + slide-in overlay on phones.
     The toggle is fixed to the viewport in BOTH open and closed states so
     its position never shifts when the menu opens. */
  .hero__nav { display: none; }
  .nav-toggle {
    display: flex;
    position: fixed;
    /* The 42px-tall toggle box centres its bars; the logo is short text sitting
       at the header padding-top. Pull the box up by ~half its own height so the
       bars line up vertically with the logo instead of sitting below it. */
    top: calc(clamp(16px, 2.4vw, 28px) + 5px - 11px);
    right: var(--gutter);
    z-index: 950;
  }
  .site-header.is-stuck { padding-block: 12px; }
  .counters { grid-template-columns: 1fr; gap: 36px; }
  .counter { display: flex; align-items: baseline; gap: 18px; }
  .counter__label { margin-top: 0; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .journal__grid { grid-template-columns: 1fr; }
  .faq__layout { grid-template-columns: 1fr; }
  /* Footer on phones: brand full-width, then Menu + Social share one row,
     Contact full-width below (its address is too long for a narrow column).
     Order in markup is brand, menu, contact, social — so re-order with
     grid placement to get brand / [menu | social] / contact. */
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand    { grid-column: 1 / -1; order: 1; }
  .footer__col--menu   { order: 2; }                    /* left of the pair  */
  .footer__col--social { order: 3; }                    /* right of the pair */
  .footer__col--contact { order: 4; grid-column: 1 / -1; }  /* full-width below */
  /* Stacked full-width halves. They are made wider than the viewport and
     pulled left so the JS sideways parallax (data-parallax-x) never reveals
     an empty edge as they drift. */
  .cta__half { width: 130%; left: -15%; height: 62%; }
  .cta__half--left { right: auto; top: -12%; }
  .cta__half--right { right: auto; top: auto; bottom: -12%; }
  .floating-cta { bottom: 16px; right: 16px; padding: 12px 18px; font-size: 0.8rem; }
  .footer__bottom { flex-direction: column; gap: 10px; align-items: center; }
  /* Tame the largest display type so it stops overflowing narrow screens. */
  .hero__headline { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  /* Keep the vertical cue pinned to the right edge on phones too, just
     tucked a little closer with a shorter line. */
  .hero__scroll-line { height: 60px; }
  .project-slide__title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .pp-hero__title { font-size: clamp(2rem, 8vw, 2.8rem); }
  .proj-photo::before { font-size: 2rem; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ================================================================
   "START YOUR PROJECT" MODAL
   ================================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  background: rgba(8, 8, 7, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    -webkit-backdrop-filter 0.4s var(--ease), visibility 0s linear 0.5s;
}
.modal.is-open {
  visibility: visible;
  background: rgba(8, 8, 7, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    -webkit-backdrop-filter 0.4s var(--ease), visibility 0s linear 0s;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
}
.modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1080px, 100%);
  max-height: calc(100vh - 40px);
  background: #141414;
  border: 1px solid rgba(245, 245, 245, 0.08);
  border-radius: 22px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.modal.is-open .modal__dialog { opacity: 1; }
.modal.is-open .modal__dialog { transform: none; }
.modal__media {
  background-size: cover;
  background-position: center;
  min-height: 100%;
}
.modal__panel {
  position: relative;
  padding: clamp(18px, 2.2vw, 30px);
  color: var(--white);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal__close {
  position: absolute;
  top: 22px; right: 22px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: rgba(245, 245, 245, 0.08);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}
.modal__close:hover { background: rgba(245, 245, 245, 0.2); }
.modal__title {
  font-size: clamp(1.3rem, 2.1vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.modal__call {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  background: #2a2a2a;
  border: 1px solid rgba(245, 245, 245, 0.12);
  border-radius: 12px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.modal__call:hover { background: #333333; transform: translateY(-2px); }
.modal__or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 11px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--grey-light);
}
.modal__or::before,
.modal__or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245, 245, 245, 0.14);
}
.modal__lead {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--grey-light);
  text-align: center;
  margin-bottom: 0.85rem;
}
.modal__form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--beige-deep);
  margin-bottom: 0.3rem;
  margin-top: 0.65rem;
}
.modal__form label:first-child { margin-top: 0; }
.modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal__row label { margin-top: 0; }
.modal__form input,
.modal__form select,
.modal__form textarea {
  width: 100%;
  background: #1e1e1e;
  border: 1px solid rgba(245, 245, 245, 0.1);
  border-radius: 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color 0.3s ease;
}
.modal__form textarea { resize: vertical; min-height: 90px; }
.modal__form input::placeholder,
.modal__form textarea::placeholder { color: var(--grey); }
.modal__form input:focus,
.modal__form select:focus,
.modal__form textarea:focus { outline: none; border-color: rgba(245, 245, 245, 0.45); }
.modal__form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
}
.modal__form select option {        /* native dropdown list — readable on dark UI */
  background: #1e1e1e;
  color: var(--white);
}
.modal__form select option:disabled { color: var(--grey); }
.modal__submit {
  width: 100%;
  margin-top: 0.9rem;
  padding: 11px;
  background: var(--beige);
  border: none;
  border-radius: 12px;
  color: var(--black);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.modal__submit:hover { background: var(--white); transform: translateY(-2px); }
.modal__msg {
  min-height: 1.2em;
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--beige-deep);
}
@media (max-width: 720px) {
  .modal__dialog { grid-template-columns: 1fr; }
  .modal__media { display: none; }
  .modal__row { grid-template-columns: 1fr; }
}

/* ================================================================
   WORK / PORTFOLIO PAGE
   Dark section, horizontal filter bar, two-column project grid.
   The filter bar + cards are shared with the Journal page's chip
   filters (see journal.css), so they live in the shared core.
   ================================================================ */

/* ---- Hero — video background; reuses the index .hero classes ---- */
.work-hero { min-height: 100vh; }           /* fill the full viewport, like the home hero */
/* Full-bleed muted looping video, sat behind the dark overlay */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transform: scale(1.08);   /* base zoom — matches .hero__bg, hides parallax edges */
  will-change: transform;   /* GPU-composite the scroll parallax */
}
/* Active page link shows its underline and full opacity */
.work-hero .hero__nav a.is-current { opacity: 1; }
.work-hero .hero__nav a.is-current::after { width: 100%; }
/* Small bracketed eyebrow above the headline — matches .section-label,
   centred like the rest of the hero content. */
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--beige);
  margin-bottom: 1.4rem;
}

/* ---- Work section shell (dark, generous vertical rhythm) -------- */
.work {
  background: var(--black);
  color: var(--white);
  /* Generous white space all round; hero sits directly above. Reduced
     bottom padding so the dark grid meets the (also dark) testimonials
     section without an oversized seam. */
  padding-block: clamp(48px, 7vw, 100px) clamp(24px, 3.5vw, 56px);
}

/* ---- Filter bar — horizontal, equal spacing, underline on active  */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3.4vw, 48px);
  padding-bottom: clamp(28px, 4vw, 48px);
  margin-bottom: clamp(32px, 4.5vw, 56px);
  border-bottom: 1px solid rgba(245, 245, 245, 0.16);
  /* Fade the whole bar in on load (see @keyframes workFadeUp) */
  opacity: 0;
  transform: translateY(18px);
  animation: workFadeUp 0.8s var(--ease) 0.1s forwards;
}
.filter {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--grey-light);
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}
.filter:hover { color: var(--white); }
/* Animated underline that grows in when a filter becomes active */
.filter::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.filter.is-active {
  color: var(--white);
  font-weight: 600;
}
.filter.is-active::after { transform: scaleX(1); }

/* ---- Project grid — two columns desktop, one column mobile ------ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 2.4vw, 34px);
}

/* ---- Project card ---------------------------------------------- */
.work-card {
  /* Fade-and-rise in on load; JS sets a per-card --delay for the stagger */
  opacity: 0;
  transform: translateY(36px);
  animation: workFadeUp 0.9s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}
.work-card__link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;          /* clip the image zoom on hover */
  border-radius: 6px;
  background: var(--near-black);
}
/* Full-bleed image placeholder */
.work-card__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.001);   /* avoid a hairline gap during scale */
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}
/* Dark gradient so the overlay text stays legible; lightens on hover */
.work-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.78) 0%, rgba(10,10,10,0.12) 55%, rgba(10,10,10,0) 100%);
  transition: opacity 0.6s var(--ease);
}
/* Overlay text — title, city, category */
.work-card__caption {
  position: absolute;
  left: clamp(20px, 2.4vw, 34px);
  right: clamp(20px, 2.4vw, 34px);
  bottom: clamp(22px, 2.6vw, 34px);
  z-index: 2;
  /* Nudged into final position; lifts further on hover */
  transition: transform 0.5s var(--ease);
}
.work-card__index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--beige);
  margin-bottom: 0.7rem;
}
.work-card__title {
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.work-card__meta {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--beige);
}

/* Hover: scale the image up, lighten the overlay, lift the text */
.work-card__link:hover .work-card__media { transform: scale(1.05); }
.work-card__link:hover .work-card__overlay { opacity: 0.72; }
.work-card__link:hover .work-card__caption { transform: translateY(-8px); }
.work-card__link:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* ---- Filtering states ------------------------------------------ */
/* Shared by the Work page (.work-card) and the Journal page (.article-card),
   both driven by the same category-filter logic in base.js.
   The JS toggles two classes only:
     .hidden   — card does not match the active filter (removed from layout)
     .is-shown — card matches; plays the same fade-in as the load (workFadeUp) */
.work-card.hidden,
.article-card.hidden { display: none; }

.work-card.is-shown,
.article-card.is-shown {
  /* Same motion as the on-load entrance, but a DIFFERENT keyframe name
     (cardFilterIn) so the reflow-restart in JS actually retriggers it. If we
     reused `workFadeUp` here, the base .work-card rule keeps that same-named
     animation assigned, so the browser never restarts it on filter. */
  animation: cardFilterIn 0.9s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

/* Empty-state message */
.work__empty {
  margin-top: 2rem;
  color: var(--grey-light);
  font-size: 1rem;
}

/* ---- Keyframes -------------------------------------------------- */
/* On-load entrance. */
@keyframes workFadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Filter fade-in — IDENTICAL motion to workFadeUp, but a separate name so it
   restarts when JS re-adds .is-shown (the base .work-card rule still owns
   workFadeUp, which would otherwise block a restart). */
@keyframes cardFilterIn {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ------------------------------------------------- */
@media (max-width: 760px) {
  /* Single column grid (the hero-style nav hides itself, as on the home page) */
  .work-grid { grid-template-columns: 1fr; }
  .work-card__link { aspect-ratio: 3 / 2.4; }
}

/* Respect reduced-motion: show everything immediately, no transforms */
@media (prefers-reduced-motion: reduce) {
  .filters,
  .work-card,
  .article-card,
  .work-card.is-shown,
  .article-card.is-shown {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ================================================================
   SHARED LINK — "back / view other" underline with rotating "+"
   Used by the project detail page (.proj-overview__footrow) AND the
   article page (.article__footrow), so it lives in the shared core.
   ================================================================ */
.proj-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  border-bottom: 1px solid rgba(245, 245, 245, 0.4);
  padding-bottom: 4px;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}
.proj-back span { display: inline-block; transition: transform 0.35s var(--ease); }
.proj-back:hover { border-color: var(--white); opacity: 0.85; }
.proj-back:hover span { transform: rotate(90deg); }
