/* ==========================================================================
   Gorilla Architecture & Designs
   Design tokens and base stylesheet.

   Palette is derived from the firm's own logo (single hue, #405060) and from
   the warm interior light that recurs in their dusk photography (#E8A33D).
   Type: Archivo (display, architectural signage), IBM Plex Sans (body),
   IBM Plex Mono (drawing-sheet annotation for all project metadata).
   ========================================================================== */

:root {
  /* --- Colour ------------------------------------------------------------ */
  --ink:         #16191C;  /* near-black, from the logo line art */
  --ink-soft:    #22272B;
  --slate:       #405060;  /* THE brand hue, sampled from logo.jpg */
  --slate-lift:  #5A7285;
  --paper:       #EDEEEF;  /* cool concrete white, not a warm cream */
  --paper-pure:  #F7F8F8;
  --concrete:    #C9CCCE;
  /* Slate-tinted grey for secondary text. Measured 4.78:1 on --paper —
     #8E9497 was used here first and failed AA at 2.65:1. */
  --concrete-dk: #5F6B73;
  --glow:        #E8A33D;  /* the warm LED wash in their night renders */

  --rule:        rgba(22, 25, 28, 0.14);
  --rule-invert: rgba(237, 238, 239, 0.18);

  /* --- Type -------------------------------------------------------------- */
  --font-display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --step--2: clamp(0.69rem, 0.68rem + 0.06vw, 0.73rem);
  --step--1: clamp(0.83rem, 0.81rem + 0.11vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1:  clamp(1.20rem, 1.14rem + 0.29vw, 1.37rem);
  --step-2:  clamp(1.44rem, 1.34rem + 0.50vw, 1.73rem);
  --step-3:  clamp(1.73rem, 1.56rem + 0.83vw, 2.18rem);
  --step-4:  clamp(2.07rem, 1.81rem + 1.31vw, 2.75rem);
  --step-5:  clamp(2.49rem, 2.08rem + 2.03vw, 3.46rem);
  --step-6:  clamp(2.99rem, 2.38rem + 3.05vw, 4.36rem);
  --step-7:  clamp(3.58rem, 2.68rem + 4.50vw, 5.50rem);

  /* --- Space ------------------------------------------------------------- */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs:  0.75rem;
  --sp-s:   1rem;
  --sp-m:   1.5rem;
  --sp-l:   2.25rem;
  --sp-xl:  3.5rem;
  --sp-2xl: 5.5rem;
  --sp-3xl: 8rem;

  --gutter: clamp(1.25rem, 0.85rem + 2vw, 3.5rem);
  --measure: 62ch;
  --shell: 1560px;

  --dur: 480ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

::selection { background: var(--slate); color: var(--paper-pure); }

.u-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.u-skip {
  position: absolute; top: -100%; left: var(--gutter); z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-xs) var(--sp-s);
  font-family: var(--font-mono); font-size: var(--step--1);
}
.u-skip:focus { top: var(--sp-s); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

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

.band { padding-block: var(--sp-3xl); }
.band--tight { padding-block: var(--sp-2xl); }
.band--ink { background: var(--ink); color: var(--paper); }
.band--slate { background: var(--slate); color: var(--paper-pure); }

/* Eyebrow: mono, letterspaced, with a short leading datum rule.
   Used to label every band — the labelling system is consistent sitewide. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--concrete-dk);
  margin-bottom: var(--sp-m);
}
.eyebrow::before {
  content: "";
  width: clamp(28px, 4vw, 56px);
  height: 2px;
  background: var(--glow);
  flex: none;
}
.band--ink .eyebrow,
.band--slate .eyebrow { color: rgba(237, 238, 239, 0.68); }

/* ==========================================================================
   Header
   ========================================================================== */

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(237, 238, 239, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.masthead--over {
  background: transparent;
  border-bottom-color: var(--rule-invert);
  color: var(--paper);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-m);
  min-height: 76px;
  padding-block: var(--sp-2xs);
}

.brand { display: flex; align-items: center; gap: var(--sp-xs); flex: none; }
.brand__mark { width: 46px; color: currentColor; }
.brand__mark svg { width: 100%; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: 0.005em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--concrete-dk);
  margin-top: 3px;
}
.masthead--over .brand__sub { color: rgba(237, 238, 239, 0.72); }

.nav { margin-inline-start: auto; }
.nav__list { display: flex; align-items: center; gap: clamp(var(--sp-s), 1.8vw, var(--sp-l)); }
.nav__link {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-block: var(--sp-2xs);
  position: relative;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.masthead__tail { display: flex; align-items: center; gap: var(--sp-s); flex: none; }

/* Language switcher — NL | EN */
.lang { display: flex; align-items: center; gap: var(--sp-3xs); font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.1em; }
.lang__item { padding: 4px 6px; color: var(--concrete-dk); text-transform: uppercase; }
.lang__item[aria-current="true"] { color: inherit; font-weight: 600; }
.masthead--over .lang__item { color: rgba(237, 238, 239, 0.6); }
.masthead--over .lang__item[aria-current="true"] { color: var(--paper); }
.lang__sep { color: var(--concrete); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2xs);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85em 1.4em;
  border: 1px solid currentColor;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid:hover { background: var(--slate); border-color: var(--slate); }
.btn--ghost:hover { background: currentColor; }
.btn--ghost:hover span { color: var(--paper); }
.masthead--over .btn--solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.masthead--over .btn--solid:hover { background: var(--glow); border-color: var(--glow); }

.nav-toggle { display: none; }

/* ==========================================================================
   Hero — the thesis: from drawing to key
   ========================================================================== */

.hero {
  position: relative;
  min-height: min(94svh, 900px);
  display: flex;
  align-items: flex-end;
  color: var(--paper);
  overflow: hidden;
  background: var(--ink);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    /* Top scrim: the masthead sits in white text over this, and the sky in
       these renders is close to white. Without it the nav is unreadable. */
    linear-gradient(to bottom, rgba(12, 14, 16, 0.62) 0%, rgba(12, 14, 16, 0.24) 14%, rgba(12, 14, 16, 0) 32%),
    linear-gradient(to top, rgba(12, 14, 16, 0.88) 0%, rgba(12, 14, 16, 0.35) 42%, rgba(12, 14, 16, 0.12) 70%),
    linear-gradient(to right, rgba(12, 14, 16, 0.5) 0%, rgba(12, 14, 16, 0) 55%);
}
.hero__inner { position: relative; width: 100%; padding-block: var(--sp-2xl) var(--sp-xl); }

.hero__title {
  font-size: var(--step-7);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
.hero__title em {
  font-style: normal;
  color: var(--glow);
}
.hero__lede {
  margin-top: var(--sp-m);
  max-width: 46ch;
  font-size: var(--step-1);
  color: rgba(237, 238, 239, 0.86);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-s); margin-top: var(--sp-l); }

/* Datum: the horizontal rule that runs under the hero copy, drawn on load */
.hero__datum {
  margin-top: var(--sp-xl);
  height: 1px;
  background: var(--rule-invert);
  transform-origin: left;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-m) var(--sp-xl);
  margin-top: var(--sp-m);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237, 238, 239, 0.66);
}

/* ==========================================================================
   Render → Reality  (the signature element)
   ========================================================================== */

.twin__head { max-width: var(--measure); margin-bottom: var(--sp-xl); }
.twin__title { font-size: var(--step-4); }
.twin__note { margin-top: var(--sp-s); color: var(--concrete-dk); }
.band--ink .twin__note { color: rgba(237, 238, 239, 0.7); }

.twin {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  user-select: none;
  touch-action: pan-y;
}
.twin__layer { position: absolute; inset: 0; }
.twin__layer img { width: 100%; height: 100%; object-fit: cover; }

/* The "after" layer is clipped by a CSS variable the script drives */
.twin__layer--after { clip-path: inset(0 0 0 var(--split, 50%)); }

.twin__tag {
  position: absolute;
  bottom: var(--sp-m);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(12, 14, 16, 0.72);
  color: var(--paper);
  padding: 0.5em 0.9em;
  backdrop-filter: blur(6px);
}
.twin__tag--before { left: var(--sp-m); }
.twin__tag--after  { right: var(--sp-m); }

.twin__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  background: var(--paper);
  transform: translateX(-1px);
}
.twin__handle::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 54px; height: 54px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: rgba(12, 14, 16, 0.4);
  backdrop-filter: blur(4px);
}
.twin__handle::after {
  content: "‹ ›";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--paper);
}

/* The native range input is the real control — visible to AT, invisible to sight */
.twin__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.twin__range:focus-visible ~ .twin__handle::before { outline: 3px solid var(--glow); outline-offset: 4px; }

/* ==========================================================================
   Work index
   ========================================================================== */

.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-m);
  margin-bottom: var(--sp-xl);
}
.work__title { font-size: var(--step-4); }

.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--sp-l) var(--sp-m);
}

.project { display: block; border-top: 1px solid var(--rule); padding-top: var(--sp-s); }
.project__frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--concrete); }
.project__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 900ms var(--ease), filter 900ms var(--ease);
}
.project:hover .project__frame img { transform: scale(1.045); }

.project__status {
  position: absolute;
  top: var(--sp-xs); left: var(--sp-xs);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4em 0.7em;
  background: rgba(12, 14, 16, 0.74);
  color: var(--paper);
}
.project__status--built { background: var(--glow); color: var(--ink); }

.project__body { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-s); margin-top: var(--sp-s); }
.project__name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
/* Metadata is set in mono throughout — it reads as drawing-sheet annotation */
.project__meta { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.08em; text-transform: uppercase; color: var(--concrete-dk); text-align: right; flex: none; }

/* ==========================================================================
   Process — numbered because it genuinely is a sequence
   ========================================================================== */

.process__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 0;
  margin-top: var(--sp-xl);
  border-top: 1px solid var(--rule-invert);
}
.step { padding: var(--sp-l) var(--sp-m) var(--sp-l) 0; border-right: 1px solid var(--rule-invert); }
.step:last-child { border-right: 0; }
.step__num {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.2em;
  color: var(--glow);
  display: block;
  margin-bottom: var(--sp-s);
}
.step__name { font-size: var(--step-2); margin-bottom: var(--sp-2xs); }
.step__copy { color: rgba(237, 238, 239, 0.7); font-size: var(--step--1); max-width: 34ch; }

/* ==========================================================================
   Services
   ========================================================================== */

.svc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--sp-l); margin-top: var(--sp-xl); }
.svc { border-top: 2px solid var(--ink); padding-top: var(--sp-s); }
.svc__name { font-size: var(--step-2); margin-bottom: var(--sp-2xs); }
.svc__copy { color: var(--concrete-dk); font-size: var(--step--1); max-width: 36ch; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--sp-xl); align-items: start; }
.contact__title { font-size: var(--step-5); max-width: 14ch; }
.contact__lede { margin-top: var(--sp-m); max-width: 42ch; color: rgba(237, 238, 239, 0.8); }

.detail { border-top: 1px solid var(--rule-invert); padding-block: var(--sp-s); display: flex; justify-content: space-between; gap: var(--sp-s); }
.detail__k { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(237, 238, 239, 0.55); }
.detail__v { text-align: right; }
.detail__v a:hover { color: var(--glow); }

/* Placeholder marker — anything the client still owes us is flagged, not faked */
/* Text stays at inherited contrast; only the dashed rule carries the amber,
   which is decoration and so is exempt from the text contrast minimum.
   Amber text measured 1.86:1 on --paper, which is why it is not used here. */
.todo {
  color: inherit;
  border-bottom: 1.5px dashed var(--glow);
  cursor: help;
}

/* ==========================================================================
   Footer — set as an architectural title block
   ========================================================================== */

.colophon { background: var(--ink); color: var(--paper); border-top: 1px solid var(--rule-invert); }
.colophon__block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  border-top: 1px solid var(--rule-invert);
}
.colophon__cell { padding: var(--sp-m); border-right: 1px solid var(--rule-invert); }
.colophon__cell:last-child { border-right: 0; }
.colophon__k { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(237, 238, 239, 0.5); display: block; margin-bottom: var(--sp-2xs); }
.colophon__v { font-size: var(--step--1); }
.colophon__v a:hover { color: var(--glow); }
.colophon__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-s); padding: var(--sp-m) 0; font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(237, 238, 239, 0.5); }

/* ==========================================================================
   Motion — one orchestrated load, restrained scroll reveals
   ========================================================================== */

/* Reveals are scoped under .js-anim, which main.js adds to <html> only once it
   has an observer it can actually drive. Without that class the content is
   simply visible. Never hide content behind a script: if JS is blocked, or
   IntersectionObserver exists but never fires (headless renderers, some
   in-app webviews, link-preview crawlers), an unscoped .reveal{opacity:0}
   leaves the page permanently blank. */
.js-anim .reveal { opacity: 0; transform: translateY(18px); }
.js-anim .reveal.is-in { opacity: 1; transform: none; transition: opacity 900ms var(--ease), transform 900ms var(--ease); }

.hero__title, .hero__lede, .hero__actions, .hero__datum, .hero__meta { animation: rise 1000ms var(--ease) both; }
.hero__lede    { animation-delay: 90ms; }
.hero__actions { animation-delay: 170ms; }
.hero__datum   { animation: draw 900ms var(--ease) 260ms both; }
.hero__meta    { animation-delay: 360ms; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-anim .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .nav__list { gap: var(--sp-s); }
  .masthead__tail .btn { display: none; }
  .step { border-right: 0; border-bottom: 1px solid var(--rule-invert); padding-right: 0; }
  .step:last-child { border-bottom: 0; }
  .colophon__cell { border-right: 0; border-bottom: 1px solid var(--rule-invert); }
}

@media (max-width: 720px) {
  :root { --sp-3xl: 4.5rem; --sp-2xl: 3.5rem; }

  .nav {
    position: fixed;
    inset: 76px 0 auto 0;
    background: var(--ink);
    color: var(--paper);
    padding: var(--sp-m) var(--gutter) var(--sp-l);
    border-bottom: 1px solid var(--rule-invert);
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav__list { flex-direction: column; align-items: flex-start; gap: var(--sp-s); }
  .nav__link { font-size: var(--step-2); font-family: var(--font-display); font-weight: 700; }

  .nav-toggle {
    display: inline-flex;
    margin-inline-start: auto;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: var(--sp-2xs) var(--sp-xs);
    border: 1px solid currentColor;
  }

  .hero { min-height: 88svh; }
  /* Shrink the hero headline so "From drawing" stays on one line on phones. */
  .hero__title { font-size: clamp(2.5rem, 12vw, 3.4rem); letter-spacing: -0.03em; }
  .twin__tag { bottom: var(--sp-2xs); font-size: 0.6rem; }
  .twin__tag--before { left: var(--sp-2xs); }
  .twin__tag--after { right: var(--sp-2xs); }
  .twin__handle::before { width: 42px; height: 42px; }
  .project__body { flex-direction: column; gap: var(--sp-3xs); }
  .project__meta { text-align: left; }
}
