/* ============================================================
   DW PROJEKTAI — aluminium windows, doors and façades
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --ink:        #0C0E11;
  --ink-2:      #12151A;
  --ink-3:      #191D23;
  --line-dark:  #262B33;
  --paper:      #FBFAF8;
  --paper-2:    #F1EEE9;
  --line:       #DDD8D0;
  --bronze:     #C9A87C;
  --bronze-dim: #A5794A;
  --on-dark:    #E9E7E3;
  --on-dark-2:  #8C9199;
  --on-dark-3:  #565C66;
  --on-light:   #23262B;
  --on-light-2: #6E7176;

  /* Avenir is a licensed Monotype face — not a webfont. Real Avenir is used
     where the machine has it (macOS ships Avenir Next); Mulish is the
     freely-available stand-in everywhere else. Buy a web licence before this
     goes public if you want the genuine article served. */
  --sans: 'Avenir Next', 'Avenir', 'Avenir Next LT Pro', 'Mulish',
          'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --track-eyebrow: 0.22em;
  --track-label:   0.14em;
  --track-display: 0.005em;

  --gutter: clamp(1.25rem, 4.5vw, 5rem);
  --maxw: 1560px;
  /* the header band the video sits below — see #stage */
  --nav-h: clamp(56px, 8vh, 84px);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, .02, .28, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--sans);
  font-size: clamp(0.92rem, 0.87rem + 0.19vw, 1.04rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }   /* beats display:grid/flex on the same node */
::selection { background: var(--bronze); color: #0C0E11; }

/* ---------- typography primitives ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.55rem + 0.14vw, 0.7rem);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--on-dark-2);
  font-weight: 400;
}
.eyebrow--bronze { color: var(--bronze); }

.display {
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.018em;
  text-transform: uppercase;
}

.h-section {
  font-size: clamp(2rem, 1.1rem + 4vw, 4.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.014em;
}

.lede {
  font-size: clamp(1rem, 0.9rem + 0.52vw, 1.42rem);
  line-height: 1.52;
  letter-spacing: -0.004em;
  font-weight: 400;
}

.cap {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--on-dark-3);
  line-height: 1.5;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* rule */
.rule { height: 1px; background: var(--line-dark); width: 100%; transform-origin: left; }
.on-light .rule { background: var(--line); }

/* ============================================================
   PRELOADER
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink);
  display: flex; align-items: flex-end; justify-content: space-between;
  /* extra bottom room so the counter's baseline clears the progress rule */
  padding: var(--gutter) var(--gutter) calc(var(--gutter) + 1.6rem);
  transition: transform 1s var(--ease);
}
#loader.done { transform: translate3d(0, -101%, 0); }
#loader .l-word {
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--on-dark-3);
}
#loader .l-count {
  font-size: clamp(3rem, 14vw, 11rem);
  font-weight: 600; letter-spacing: -0.028em; line-height: 0.8;
  color: var(--on-dark); font-variant-numeric: tabular-nums;
}
#loader .l-bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) - 1px);
  height: 1px; background: var(--line-dark);
}
#loader .l-bar i { display: block; height: 100%; width: 0; background: var(--bronze); }

/* ============================================================
   CURSOR
   ============================================================ */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 190;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(233,231,227,.5); border-radius: 50%;
  pointer-events: none; opacity: 0;
  transition: opacity .3s, background-color .35s var(--ease), border-color .35s var(--ease);
  will-change: transform;
}
#cursor::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 3px; height: 3px; border-radius: 50%; background: var(--on-dark);
  transition: opacity .3s;
}
#cursor.is-on { opacity: 1; }
/* Hide the OS pointer only once JS has actually put ours on screen — if the
   script never runs the native cursor must stay. */
body.custom-cursor, body.custom-cursor * { cursor: none !important; }
#cursor.is-hot { background: rgba(201,168,124,.14); border-color: var(--bronze); }
#cursor.is-hot::after { opacity: 0; }
#cursor.on-light-zone { border-color: rgba(35,38,43,.45); }
#cursor.on-light-zone::after { background: var(--on-light); }
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  padding: clamp(1rem, 2.2vw, 1.75rem) var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  mix-blend-mode: normal;
  transition: transform .6s var(--ease), background-color .5s, backdrop-filter .5s;
}
#nav.hidden { transform: translate3d(0, -110%, 0); }
#nav.solid { background: rgba(12,14,17,.72); backdrop-filter: blur(14px) saturate(1.2); }
#nav.on-light-zone.solid { background: rgba(251,250,248,.78); }
#nav.on-light-zone, #nav.on-light-zone a, #nav.on-light-zone button { color: var(--on-light); }
#nav.on-light-zone .n-mark small { color: var(--on-light-2); }

.n-mark { justify-self: center; text-align: center; line-height: 1; position: relative; }
/* two renderings of the mark — the light one over dark sections, the black one
   over the catalogue band. Both are laid out; only one is painted. */
.n-mark picture { display: block; }
.n-mark picture + picture { position: absolute; top: 0; left: 0; right: 0; }
.n-mark img {
  width: clamp(124px, 13vw, 178px); height: auto; margin-inline: auto;
  transition: opacity .45s var(--ease);
}
.n-mark .mark-dark { opacity: 0; }
#nav.on-light-zone .n-mark .mark-light { opacity: 0; }
#nav.on-light-zone .n-mark .mark-dark { opacity: 1; }
.n-mark small {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: 0.53rem;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--on-dark-3);
}
.n-side { display: flex; align-items: center; gap: 1.6rem; }
.n-side.right { justify-self: end; }
.n-link {
  font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: var(--track-label); text-transform: uppercase;
  position: relative; padding-bottom: 3px;
}
.n-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.n-link:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 780px) { .n-side .desk { display: none; } }

/* burger */
.burger { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.burger i { display: block; height: 1px; background: currentColor; transition: transform .5s var(--ease), width .5s var(--ease); }
.burger i:nth-child(2) { width: 14px; }
.burger:hover i:nth-child(2) { width: 22px; }
body.menu-open .burger i:nth-child(1) { transform: translateY(3px) rotate(45deg); }
body.menu-open .burger i:nth-child(2) { transform: translateY(-3px) rotate(-45deg); width: 22px; }

/* ---------- menu overlay ---------- */
#menu {
  position: fixed; inset: 0; z-index: 110;
  background: var(--ink-2);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .9s var(--ease);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
  pointer-events: none;
}
body.menu-open #menu { clip-path: inset(0 0 0 0); pointer-events: auto; }
#menu ol { max-width: var(--maxw); margin-inline: auto; width: 100%; }
#menu li { overflow: hidden; border-bottom: 1px solid var(--line-dark); }
#menu li:first-child { border-top: 1px solid var(--line-dark); }
#menu ol a {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding: clamp(.6rem, 1.8vw, 1.4rem) 0;
  font-size: clamp(1.8rem, 6vw, 4.5rem); font-weight: 600;
  letter-spacing: -0.016em; text-transform: uppercase; line-height: 1;
  transform: translate3d(0, 105%, 0);
  transition: transform .8s var(--ease), color .4s;
}
body.menu-open #menu ol a { transform: translate3d(0, 0, 0); }
#menu ol li:nth-child(1) a { transition-delay: .12s; }
#menu ol li:nth-child(2) a { transition-delay: .18s; }
#menu ol li:nth-child(3) a { transition-delay: .24s; }
#menu ol li:nth-child(4) a { transition-delay: .30s; }
#menu ol li:nth-child(5) a { transition-delay: .36s; }
#menu ol a:hover { color: var(--bronze); }
#menu .m-foot a:hover { color: var(--bronze); }
#menu ol a em {
  font-family: var(--mono); font-style: normal;
  font-size: 0.66rem; letter-spacing: 0.18em; color: var(--on-dark-3);
}
#menu .m-foot {
  max-width: var(--maxw); margin: clamp(2rem,5vw,4rem) auto 0; width: 100%;
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between;
}

/* ============================================================
   SMOOTH SCROLL SHELL
   ============================================================ */
#smooth-wrapper { position: fixed; inset: 0; overflow: hidden; z-index: 1; }
#smooth-content { will-change: transform; }
body.no-smooth #smooth-wrapper { position: static; overflow: visible; }
body.no-smooth #smooth-content { transform: none !important; }

/* ============================================================
   HERO — fixed video stage behind the scrolling shell
   ============================================================ */
/* The footage carries Aluprof's watermark hard in its top-right corner.
   Rather than crop their mark off, the video starts below a solid header
   band — the nav gets its own ground and the watermark stays intact. */
#stage {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 0; overflow: hidden;
  background: #06070A;
}
#stage::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: rgba(233,231,227,.16); z-index: 4;
}
#stage video, #stage .stage-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; will-change: transform;
}
#stage .veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(8,10,13,.72) 0%, rgba(8,10,13,.28) 32%, rgba(8,10,13,.42) 68%, rgba(8,10,13,.9) 100%),
    linear-gradient(to right, rgba(8,10,13,.62) 0%, rgba(8,10,13,0) 62%);
}
/* faint film grain, keeps the flat gradients from banding */
#stage .grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .045; mix-blend-mode: overlay; pointer-events: none;
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-3%, -2%); }
  80% { transform: translate(4%, 2%); }
}

#hero {
  position: relative; z-index: 2;
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--gutter) * 1.2) 0;
}
#hero .hero-inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.h-top { position: absolute; top: clamp(5.5rem, 13vh, 9rem); left: 0; right: 0; }
.h-top .shell { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }

.hero-title { margin-bottom: clamp(1.5rem, 4vh, 3rem); }
.hero-title .line { overflow: hidden; display: block; }
.hero-title .line > span {
  display: block;
  /* Sized against both axes: four fixed lines can overflow a short laptop
     screen if width alone drives the size. */
  font-size: clamp(2.3rem, min(11vw, 15.5vh), 10.5rem);
  letter-spacing: -0.022em;
  /* four deliberate lines — never let the browser choose the breaks */
  white-space: nowrap;
  transform: translate3d(0, 105%, 0);
}
.hero-title .line:last-child > span { -webkit-text-stroke: 1px rgba(233,231,227,.55); color: transparent; }
@supports not (-webkit-text-stroke: 1px red) { .hero-title .line:last-child > span { color: var(--on-dark-2); } }

.h-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  padding-top: 1.1rem; border-top: 1px solid rgba(233,231,227,.18);
}
.h-foot .h-credit { max-width: 42ch; }
@media (max-width: 660px) {
  .h-foot { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .h-foot .h-credit { max-width: 34ch; }
}
.h-scroll { display: flex; align-items: center; gap: .7rem; white-space: nowrap; }
.h-scroll .track { position: relative; width: 46px; height: 1px; background: rgba(233,231,227,.25); overflow: hidden; }
.h-scroll .track i { position: absolute; inset: 0; background: var(--bronze); animation: sweep 2.4s var(--ease-io) infinite; }
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ============================================================
   SECTIONS — shared
   ============================================================ */
.sec { position: relative; z-index: 3; background: var(--ink); }
.sec--pad { padding: clamp(5rem, 13vh, 11rem) 0; }
.sec--light { background: var(--paper); color: var(--on-light); }
.sec--light .eyebrow { color: var(--on-light-2); }
.sec--light .cap { color: var(--on-light-2); }
.sec--tint { background: var(--ink-2); }

.sec-head { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.4rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 22ch minmax(0,1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
}
.sec-head .idx { display: flex; gap: .8rem; align-items: baseline; }

/* masked line reveal (JS adds .in) */
.mask { overflow: hidden; display: block; }
.mask > span { display: block; transform: translate3d(0, 105%, 0); transition: transform 1.05s var(--ease); }
.in .mask > span, .mask.in > span { transform: translate3d(0, 0, 0); }
.mask:nth-child(2) > span { transition-delay: .08s; }
.mask:nth-child(3) > span { transition-delay: .16s; }
.mask:nth-child(4) > span { transition-delay: .24s; }

/* simple fade-rise */
.rise { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rise.in { opacity: 1; transform: none; }
.rise[data-d="1"] { transition-delay: .09s; }
.rise[data-d="2"] { transition-delay: .18s; }
.rise[data-d="3"] { transition-delay: .27s; }
.rise[data-d="4"] { transition-delay: .36s; }
.rise[data-d="5"] { transition-delay: .45s; }

/* Clip reveal for imagery.
   NB: never put data-reveal on one of these — a clipped element has zero
   intersection area, so IntersectionObserver would never fire on it.
   Observe the parent; the callback cascades .in down. */
.reveal { clip-path: inset(0 0 100% 0); transition: clip-path 1.25s var(--ease); }
.reveal.in { clip-path: inset(0 0 0 0); }
.reveal img, .reveal video { transform: scale(1.16); transition: transform 1.6s var(--ease); }
.reveal.in img, .reveal.in video { transform: scale(1); }

/* line draw */
.draw { transform: scaleX(0); transition: transform 1.1s var(--ease); transform-origin: left; }
.draw.in { transform: scaleX(1); }

/* ============================================================
   STATEMENT
   ============================================================ */
#statement .stmt {
  font-size: clamp(1.28rem, 0.86rem + 1.95vw, 2.9rem);
  line-height: 1.28; letter-spacing: -0.012em; font-weight: 400;
  max-width: 22ch; margin-inline: auto; text-align: center;
  text-wrap: balance;
}
@media (min-width: 700px) { #statement .stmt { max-width: 26ch; } }
#statement .stmt w { display: inline-block; color: var(--on-dark-3); transition: color .5s linear; }
#statement .stmt w.lit { color: var(--on-dark); }
#statement .stmt b { font-weight: 400; }
#statement .stmt w.acc.lit { color: var(--bronze); }
#statement .after {
  margin: clamp(2.5rem, 6vw, 4.5rem) auto 0; max-width: 58ch; text-align: center;
  color: var(--on-dark-2); font-size: clamp(.95rem, .9rem + .25vw, 1.1rem);
}

/* ============================================================
   LEDGER
   ============================================================ */
.ledger { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line-dark); }
@media (min-width: 860px) { .ledger { grid-template-columns: repeat(4, 1fr); } }
.ledger li {
  padding: clamp(1.5rem, 3vw, 2.6rem) clamp(1rem, 2vw, 2rem) clamp(1.5rem, 3vw, 2.4rem) 0;
  border-bottom: 1px solid var(--line-dark);
}
@media (min-width: 860px) {
  .ledger li { border-bottom: 0; border-right: 1px solid var(--line-dark); }
  .ledger li:last-child { border-right: 0; }
}
.ledger .n {
  font-size: clamp(2.5rem, 1.2rem + 4.4vw, 5.2rem); font-weight: 600;
  letter-spacing: -0.028em; line-height: .9; font-variant-numeric: tabular-nums;
  display: block; margin-bottom: .85rem;
}
.ledger .n sup { font-size: .34em; vertical-align: super; letter-spacing: 0; color: var(--bronze); font-weight: 400; }
.ledger p { color: var(--on-dark-2); font-size: .84rem; line-height: 1.5; max-width: 24ch; }

/* ============================================================
   SYSTEMS — numbered expanding rows
   ============================================================ */
.sysgrid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
@media (min-width: 1040px) { .sysgrid { grid-template-columns: 1fr minmax(340px, 38%); align-items: start; } }

.sysrows { border-top: 1px solid var(--line-dark); }
.sysrow { border-bottom: 1px solid var(--line-dark); }
.sysrow .bar {
  width: 100%; display: grid; grid-template-columns: 3.5rem minmax(0,1fr) auto;
  gap: 1rem; align-items: center; text-align: left;
  padding: clamp(1.1rem, 2.4vw, 1.9rem) 0;
  transition: padding-left .6s var(--ease), color .4s;
}
.sysrow:hover .bar { padding-left: .8rem; }
.sysrow.open .bar { padding-left: .8rem; }
.sysrow .bar .num { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--on-dark-3); }
.sysrow.open .bar .num, .sysrow:hover .bar .num { color: var(--bronze); }
.sysrow .bar .nm {
  font-size: clamp(1.15rem, .85rem + 1.35vw, 2.15rem); font-weight: 500;
  letter-spacing: -0.03em; line-height: 1.08;
}
.sysrow .bar .nm i { font-style: normal; color: var(--on-dark-3); }
.sysrow.open .bar .nm i { color: var(--on-dark-2); }
.sysrow .sign { position: relative; width: 13px; height: 13px; flex: none; }
.sysrow .sign::before, .sysrow .sign::after {
  content: ''; position: absolute; inset: 0; margin: auto; background: currentColor;
  transition: transform .6s var(--ease), opacity .4s;
}
.sysrow .sign::before { width: 13px; height: 1px; }
.sysrow .sign::after  { width: 1px; height: 13px; }
.sysrow.open .sign::after { transform: scaleY(0); }
.sysrow .body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .75s var(--ease); }
.sysrow.open .body { grid-template-rows: 1fr; }
.sysrow .body > div { overflow: hidden; }
.sysrow .body .inner {
  padding: 0 0 clamp(1.4rem, 3vw, 2.4rem) 3.5rem;
  max-width: 62ch; color: var(--on-dark-2);
  opacity: 0; transform: translateY(12px);
  transition: opacity .6s var(--ease) .12s, transform .6s var(--ease) .12s;
}
.sysrow.open .body .inner { opacity: 1; transform: none; }
@media (max-width: 620px) { .sysrow .body .inner { padding-left: 0; } }
.sysrow .body .specs { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .42rem .7rem; border: 1px solid var(--line-dark); color: var(--on-dark-2);
  border-radius: 2px; white-space: nowrap;
}

.sysview { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--ink-3); }
.sysview img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.08);
  transition: opacity 1s var(--ease), transform 1.6s var(--ease);
}
.sysview img.on { opacity: 1; transform: scale(1); }
.sysview .tag {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 1.6rem 1.15rem 1rem;
  background: linear-gradient(to top, rgba(8,10,13,.92), rgba(8,10,13,0));
}
.sysview .tag .cap { color: rgba(233,231,227,.78); }
@media (max-width: 1039px) { .sysview { aspect-ratio: 16/10; } }

/* ============================================================
   CATALOGUE — light band
   ============================================================ */
.cat-bar {
  display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; align-items: center;
  justify-content: space-between;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.6rem, 3vw, 2.6rem);
}
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 2px;
  color: var(--on-light-2);
  transition: background-color .4s var(--ease), color .4s, border-color .4s;
}
.filter:hover { border-color: var(--on-light); color: var(--on-light); }
.filter.on { background: var(--on-light); border-color: var(--on-light); color: var(--paper); }
.filter em { font-style: normal; opacity: .55; margin-left: .45em; }
/* Profile-system chips. These are not "coming soon" — they open a
   specification instead of a grid, because a profile system has no leaves to
   draw. The dot marks them as a different kind of thing, not an unfinished one. */
.filter.is-sys::after {
  content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--sys-accent, #44637A); margin-left: .6em; vertical-align: middle;
}
.filter.is-sys.on::after { background: var(--paper); }

.cat-count { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--on-light-2); }

/* ---------- profile systems ----------
   The chips open the same card grid the doors use. What differs is that the
   card art is DRAWN, not photographed: a profile system has no leaves. The
   engineering - U-values, EN classes, profile depths - deliberately does not
   appear on the site at all. It is in the brochure each panel links to. */
/* min() on the track floor, not a bare px: a grid item defaults to
   min-width:auto, so a 190px floor forces the track wider than a narrow phone
   and the whole page scrolls sideways. */
.catgrid--sch {
  --sys-accent: #44637A;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
}

.door--sch .ph { align-items: center; width: 100%; }
/* .door .code is defined later in this file at the same specificity, so it wins
   on source order — hence the doubled class rather than a lone modifier */
.door.door--sch .code {
  font-family: var(--sans); font-size: .84rem; letter-spacing: -.004em;
  text-transform: none; font-weight: 600; line-height: 1.32;
}
.door.door--sch .fin { margin-top: .35rem; }
.door--sch .meta { min-height: 4.6em; }

/* portrait symbols must not stretch to the card width, or a door ends up
   wider than the leaf renders sitting next to it */
.sch { width: auto; height: 150px; max-width: 100%; display: block; }
.sch-f, .sch-g { fill: none; stroke: var(--on-light); stroke-width: 2.4; }
.sch-g { stroke-width: 1; opacity: .3; }
.sch-d { fill: none; stroke: var(--on-light); stroke-width: 1.6; }
.sch-s { fill: none; stroke: var(--on-light-2); stroke-width: 1.4; }
.sch-h { stroke: var(--sys-accent, #44637A); stroke-width: 3; stroke-linecap: round; }
.sch-t { stroke: var(--on-light); stroke-width: 2.4; stroke-linecap: square; }
.sch-a { fill: none; stroke: var(--sys-accent, #44637A); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sch-m { fill: var(--sys-accent, #44637A); opacity: .09; }
.door--sch:hover .sch-m { opacity: .16; }
.sch-m, .door--sch .sch-a { transition: opacity .45s var(--ease); }

/* the trailing note under the grid — lede, what else is available, brochure */
.sysfull {
  --sys-accent: #44637A;
  display: grid; gap: 1.2rem; margin-top: clamp(1.8rem, 3.5vw, 3rem);
  padding-top: clamp(1.4rem, 3vw, 2.2rem); border-top: 1px solid var(--line);
}
/* same trap as above — without this the widest child sets the column width */
.sysfull > * { min-width: 0; }
.sysnote-lede { font-size: clamp(1rem, .92rem + .5vw, 1.25rem); line-height: 1.5; max-width: 46ch; }
.sysnote-extras {
  display: grid; gap: .7rem 2rem; list-style: none; max-width: 92ch;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.sysnote-extras li { font-size: .84rem; line-height: 1.55; color: var(--on-light-2); }
.sysnote-extras b { color: var(--on-light); font-weight: 600; }
.sysnote-fine { font-size: .78rem; line-height: 1.55; color: var(--on-light-2); max-width: 68ch; }
.sysfull .arrow-link { justify-self: start; }

/* the drawer shows a drawn configuration instead of a leaf render */
.dw-figure--sch { display: flex; align-items: center; justify-content: center; }
.dw-figure--sch .sch { max-height: none; width: 100%; }

/* Rules are drawn per card rather than by a 1px grid gap over a coloured
   background — a ragged last row would otherwise show as a grey slab. */
.catgrid {
  display: grid; gap: 0; background: var(--paper);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
@media (min-width: 700px) { .catgrid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); } }

.door {
  position: relative; background: var(--paper); padding: 1.4rem 1rem .95rem;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  text-align: center; cursor: pointer;
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), background-color .45s;
}
.door.in { opacity: 1; transform: none; }
.door:hover { background: var(--paper-2); }
.door .ph { height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.door img {
  max-height: 150px; width: auto; object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(35,38,43,.12));
  transition: transform .65s var(--ease), filter .65s var(--ease);
}
.door:hover img { transform: translateY(-6px) scale(1.035); filter: drop-shadow(0 20px 28px rgba(35,38,43,.2)); }
.door .meta { display: block; min-height: 3.1em; }
.door .code {
  display: block;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  color: var(--on-light); font-weight: 500;
}
.door .fin {
  display: block; margin-top: .35rem;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .08em; line-height: 1.4;
  color: var(--on-light-2);
}
.door .sl {
  position: absolute; top: .7rem; right: .7rem;
  font-family: var(--mono); font-size: .5rem; letter-spacing: .12em;
  color: var(--bronze-dim); border: 1px solid currentColor; padding: 1px 4px; border-radius: 2px;
}
.cat-more { display: flex; justify-content: center; margin-top: 2.2rem; }

/* door drawer */
#drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150;
  width: min(560px, 100%); background: var(--paper); color: var(--on-light);
  transform: translate3d(101%, 0, 0);
  transition: transform .85s var(--ease), visibility 0s linear .85s;
  display: flex; flex-direction: column;
  /* hidden until opened — otherwise the shadow bleeds a dark band down the
     right edge of every light section */
  visibility: hidden;
}
body.drawer-open #drawer {
  transform: translate3d(0,0,0); visibility: visible;
  transition: transform .85s var(--ease), visibility 0s;
  box-shadow: -30px 0 80px rgba(8,10,13,.35);
}
#drawer-scrim {
  position: fixed; inset: 0; z-index: 149; background: rgba(8,10,13,.6);
  opacity: 0; pointer-events: none; transition: opacity .6s var(--ease);
  backdrop-filter: blur(3px);
}
body.drawer-open #drawer-scrim { opacity: 1; pointer-events: auto; }
.dw-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: clamp(1.4rem,3vw,2.2rem) clamp(1.4rem,3vw,2.4rem) 1.1rem;
  border-bottom: 1px solid var(--line);
}
.dw-head h3 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 600; letter-spacing: -.016em; line-height: 1; }
.dw-close { width: 34px; height: 34px; position: relative; flex: none; border: 1px solid var(--line); border-radius: 50%; transition: background-color .4s, border-color .4s; }
.dw-close:hover { background: var(--on-light); border-color: var(--on-light); color: var(--paper); }
.dw-close::before, .dw-close::after { content:''; position: absolute; inset: 0; margin: auto; width: 12px; height: 1px; background: currentColor; }
.dw-close::before { transform: rotate(45deg); }
.dw-close::after { transform: rotate(-45deg); }
.dw-body { overflow-y: auto; padding: clamp(1.4rem,3vw,2.4rem); flex: 1; }
.dw-figure { background: var(--paper-2); padding: 2rem; display: flex; justify-content: center; margin-bottom: 1.8rem; }
.dw-figure img { max-height: 340px; width: auto; filter: drop-shadow(0 22px 34px rgba(35,38,43,.18)); }
.dw-spec { border-top: 1px solid var(--line); }
.dw-spec div {
  display: grid; grid-template-columns: 10rem minmax(0,1fr); gap: 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--line);
  font-size: .88rem;
}
.dw-spec dt {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-light-2); padding-top: .25em;
}
.dw-spec dd { margin: 0; }
@media (max-width: 520px) { .dw-spec div { grid-template-columns: 1fr; gap: .3rem; } }
.dw-foot { padding: 1.2rem clamp(1.4rem,3vw,2.4rem); border-top: 1px solid var(--line); }

/* ============================================================
   PIVOT
   ============================================================ */
.pivot { display: grid; gap: clamp(2.2rem, 6vw, 5rem); align-items: center; }
@media (min-width: 900px) { .pivot { grid-template-columns: minmax(0, 300px) minmax(0,1fr); } }
/* the source is only 218px wide — never let it be blown up past that much */
.pivot .vidwrap { position: relative; background: var(--ink-3); overflow: hidden; max-width: 320px; }
.pivot video { width: 100%; height: auto; }
.pivot .vidwrap .frame {
  position: absolute; inset: 10px; border: 1px solid rgba(201,168,124,.28); pointer-events: none;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.pj { position: relative; overflow: hidden; background: var(--ink-3); }
/* Site-record photography, not studio work. Graded back so it sits inside the
   dark palette, and returned to full colour when you actually look at it. */
.pj img {
  width: 100%; height: 100%; object-fit: cover; will-change: transform;
  filter: saturate(.62) contrast(1.06) brightness(.88);
  transition: filter 1s var(--ease);
}
.pj:hover img { filter: saturate(1) contrast(1) brightness(1); }
.pj::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(233,231,227,0);
  transition: box-shadow .6s var(--ease);
}
.pj:hover::after { box-shadow: inset 0 0 0 1px rgba(201,168,124,.4); }
.pj--wide { aspect-ratio: 16/9; }
@media (max-width: 700px) { .pj--wide { aspect-ratio: 4/3; } }
.pj-cap { display: flex; justify-content: space-between; gap: 1.5rem; padding-top: .9rem; flex-wrap: wrap; }
.pj-cap .t { font-size: 1rem; font-weight: 500; letter-spacing: -.01em; }
.pjgrid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); margin-top: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 880px) { .pjgrid { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.pj--tall { aspect-ratio: 3/4; }
.pj--sq { aspect-ratio: 1/1; }
.pj-offset { margin-top: clamp(1.5rem, 6vw, 5rem); }
@media (min-width: 880px) { .pjgrid--b { grid-template-columns: 1fr 1.35fr; } }

/* ============================================================
   PROCESS — draggable strip
   ============================================================ */
.strip-outer { position: relative; }
.strip {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  cursor: grab; padding-bottom: 2px;
  scroll-snap-type: x proximity;
  border-top: 1px solid var(--line-dark);
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.step {
  flex: 0 0 clamp(230px, 27vw, 320px); scroll-snap-align: start;
  padding: clamp(1.5rem,3vw,2.4rem) clamp(1.2rem,2.4vw,2rem) clamp(2.2rem,4vw,3.4rem) 0;
  border-right: 1px solid var(--line-dark);
  position: relative;
}
.step:last-child { border-right: 0; }
.step .sn {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; color: var(--bronze);
  display: block; margin-bottom: clamp(2rem, 5vw, 3.4rem);
}
.step h4 {
  font-size: clamp(1.05rem, .9rem + .5vw, 1.4rem); font-weight: 500;
  letter-spacing: -.02em; margin-bottom: .6rem;
}
.step p { color: var(--on-dark-2); font-size: .86rem; line-height: 1.55; max-width: 30ch; }
.step .dot {
  position: absolute; top: 0; left: 0; width: 5px; height: 5px; margin-top: -3px;
  background: var(--line-dark); border-radius: 50%;
  transition: background-color .5s, transform .5s var(--ease);
}
.step:hover .dot { background: var(--bronze); transform: scale(1.8); }
.strip-hint { display: flex; align-items: center; gap: .8rem; margin-top: 1.6rem; }
.strip-prog { flex: 1; max-width: 220px; height: 1px; background: var(--line-dark); position: relative; }
.strip-prog i { position: absolute; inset: 0 auto 0 0; background: var(--bronze); width: 12%; transition: width .1s linear; }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
#contact .big {
  font-size: clamp(2.4rem, 1rem + 7vw, 8rem); font-weight: 600;
  letter-spacing: -.024em; line-height: .92; text-transform: uppercase;
}
.mailto { display: inline-flex; align-items: baseline; gap: .5rem; position: relative; }
.mailto::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .06em; height: 1px; background: currentColor;
  transform: scaleX(1); transform-origin: right; transition: transform .55s var(--ease);
}
.mailto:hover::after { transform: scaleX(0); }
.contact-grid { display: grid; gap: clamp(1.6rem, 4vw, 3rem); margin-top: clamp(2.6rem, 6vw, 4.5rem); }
@media (min-width: 760px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-grid h5 { font-family: var(--mono); font-size: .62rem; letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--on-dark-3); font-weight: 400; margin-bottom: .8rem; }

footer { background: var(--ink-2); padding: clamp(2.4rem, 5vw, 3.4rem) 0; position: relative; z-index: 3; }
.f-grid { display: flex; flex-wrap: wrap; gap: 1.4rem 2.5rem; justify-content: space-between; align-items: flex-end; }
.f-note { max-width: 56ch; }

/* generic link-arrow button */
.arrow-link {
  display: inline-flex; align-items: center; gap: .8rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: var(--track-label); text-transform: uppercase;
  padding: .95rem 1.5rem; border: 1px solid var(--line-dark); border-radius: 2px;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.sec--light .arrow-link { border-color: var(--line); }
.arrow-link svg { width: 14px; height: 9px; overflow: visible; }
.arrow-link:hover { background: var(--bronze); border-color: var(--bronze); color: #0C0E11; }
.arrow-link svg line, .arrow-link svg polyline { transition: transform .5s var(--ease); }
.arrow-link:hover svg { animation: nudge .55s var(--ease); }
@keyframes nudge { 50% { transform: translateX(5px); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .mask > span, .hero-title .line > span { transform: none !important; }
  .rise { opacity: 1 !important; transform: none !important; }
  .reveal { clip-path: none !important; }
  .reveal img, .reveal video { transform: none !important; }
  .draw { transform: none !important; }
  .door { opacity: 1 !important; transform: none !important; }
  #stage .grain { display: none; }
}
