/* ============================================================
   SOFTSYSTEMS___HAUS
   Paper. White ground, black hairlines, black monospaced text —
   the plainness of a word processor held to a tighter grid.
   One visual world on purpose: no dark variant, every colour
   painted explicitly so the page holds on any host ground.
   ============================================================ */

:root {
  --paper:   #FFFFFF;
  --ink:     #000000;
  --rule:    #000000;

  /* the cast: what the cube puts on the paper, in place of a glow */
  --cast:    0, 0, 0;
  --cast-a:  0.07;
  --cast-b:  0.032;

  /* project markers, lifted from the deck */
  --sw-chromatic: #E8300B;
  --sw-hills:     #0B2E6B;
  --sw-listening: #FF4A1C;
  --sw-ldj:       #2B0B4D;
  --sw-republic:  #111113;
  --sw-almost:    #FBB03B;
  --sw-moth:      #8C1007;
  --sw-cc:        #E8306E;

  --pad: clamp(18px, 3.4vw, 56px);
  --gut: clamp(12px, 1.6vw, 26px);

  --ff-sans: "Archivo", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "Courier New", Courier, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-mono);
  font-size: 14px;
  line-height: 1.55;
  font-synthesis-weight: none;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #000; color: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---------- split output ---------- */

.sp-line { will-change: transform; }
.sp-word { display: inline-block; will-change: transform; }

/* ---------- type roles ---------- */

.mono {
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.76vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 400;
}

.body {
  font-family: var(--ff-mono);
  font-size: clamp(12.5px, 0.92vw, 14.5px);
  line-height: 1.72;
  max-width: 68ch;
  color: var(--ink);
}

.dim { opacity: 0.62; }

/* ---------- fixed chrome ---------- */

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
  display: block;
}

#cubeHit {
  position: fixed;
  z-index: 61;
  width: 0; height: 0;
  cursor: grab;
  touch-action: none;
}
#cubeHit.grabbing { cursor: grabbing; }

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: var(--pad);
  pointer-events: none;
  transition: opacity 0.7s var(--ease);
}
.masthead a { pointer-events: auto; }

.mark {
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.76vw, 12px);
  letter-spacing: 0.02em;
  line-height: 1.55;
  text-transform: uppercase;
  display: grid;
}

.nav {
  display: flex;
  gap: clamp(12px, 1.6vw, 26px);
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.76vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

@media (max-width: 760px) {
  .mark-sub { display: none; }
  .masthead { gap: 10px; }
  .nav { gap: 10px; }
  .nav a, .mark { font-size: 10px; }
}

.readout {
  position: fixed;
  left: var(--pad);
  bottom: var(--pad);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  background: var(--paper);
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--rule);
  transition: opacity 0.7s var(--ease);
}
.readout .dot {
  width: 8px; height: 8px;
  background: var(--ink);
  border: 1px solid var(--rule);
  flex: none;
}
.readout .pct {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- the gate: a blank sheet the cube rests on ----------
   Painted from the first frame and only lifted once every asset
   has actually arrived, so the page is never glimpsed half-built. */

body.gated { overflow: hidden; }

.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  cursor: default;
}
.gate.on { display: block; }
.gate.ready { cursor: pointer; }
.gate.out {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  pointer-events: none;
}
.gated .masthead,
.gated .readout { opacity: 0; }

.gate-meter {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) + 26px);
  height: 1px;
  background: rgba(0, 0, 0, 0.14);
}
.gate-meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
}

.gate-count {
  position: absolute;
  left: var(--pad);
  bottom: var(--pad);
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.76vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.gate-state {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.76vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.5;
  transition: opacity 0.5s var(--ease);
}
.gate.ready .gate-state { opacity: 1; }

.gate-enter {
  position: absolute;
  inset: 0;
  border: 0;
  background: none;
  font: inherit;
  width: 100%; height: 100%;
  cursor: inherit;
}
.gate-enter:focus-visible { outline: 1px solid var(--ink); outline-offset: -16px; }

/* ---------- the cast the cube throws on the paper ---------- */

.haze {
  position: fixed;
  inset: 0;
  z-index: 59;
  pointer-events: none;
  background:
    /* the lamp's bloom, tight on the corner it strikes */
    radial-gradient(circle var(--gr, 64px) at var(--gx, 50%) var(--gy, 28%),
      rgba(255, 186, 112, 0.62) 0%,
      rgba(255, 172, 94, 0.30) 34%,
      rgba(255, 162, 82, 0.07) 60%,
      rgba(255, 156, 74, 0) 82%),
    /* and what the cube puts back down on the paper */
    radial-gradient(circle var(--hr, 220px) at var(--hx, 50%) var(--hy, 30%),
      rgba(var(--cast), var(--cast-a)) 0%,
      rgba(var(--cast), calc(var(--cast-a) * 0.38)) 44%,
      rgba(var(--cast), 0) 76%),
    radial-gradient(circle var(--hr2, 520px) at var(--hx, 50%) var(--hy2, 38%),
      rgba(var(--cast), var(--cast-b)) 0%,
      rgba(var(--cast), 0) 74%);
}

/* ---------- layout ---------- */

main { position: relative; z-index: 2; }

.wrap {
  padding-inline: var(--pad);
  max-width: 1680px;
  margin-inline: auto;
}

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 88vh;
  min-height: max(88svh, 480px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: clamp(96px, 15vh, 190px) clamp(28px, 5vh, 54px);
}

.wordmark {
  position: relative;
  z-index: 3;
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: clamp(21px, 8.7vw, 152px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
  white-space: nowrap;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  max-width: 100%;
}
.wordmark .ch {
  display: inline-block;
  will-change: transform;
  transform-origin: 50% 60%;
}

.hero-foot {
  position: relative;
  z-index: 3;
  margin-top: clamp(20px, 3.4vh, 44px);
  padding-top: clamp(12px, 1.6vh, 20px);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  align-items: start;
}
.hero-foot .tag {
  grid-column: 1 / span 5;
  font-family: var(--ff-sans);
  font-size: clamp(14px, 1.35vw, 21px);
  letter-spacing: -0.01em;
  margin: 0;
}
.hero-foot .meta { grid-column: 8 / span 3; }
.hero-foot .hint { grid-column: 11 / span 2; text-align: right; }

@media (max-width: 860px) {
  .hero-foot .tag  { grid-column: 1 / span 12; }
  .hero-foot .meta { grid-column: 1 / span 7; margin-top: 18px; }
  .hero-foot .hint { grid-column: 8 / span 5; margin-top: 18px; }
}
@media (max-width: 560px) {
  .hero-foot .meta,
  .hero-foot .hint { grid-column: 1 / span 12; text-align: left; margin-top: 12px; }
}

/* ---------- manifesto ---------- */

.manifesto {
  padding-block: clamp(90px, 18vh, 200px);
  border-top: 1px solid var(--rule);
}
.manifesto .lead {
  grid-column: 3 / span 8;
  font-family: var(--ff-sans);
  font-size: clamp(20px, 2.7vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
}
.manifesto .lead em {
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.manifesto .aside { grid-column: 3 / span 4; margin-top: clamp(34px, 6vh, 78px); }
.manifesto .play  { grid-column: 8 / span 3; margin-top: clamp(34px, 6vh, 78px); text-align: right; }
@media (max-width: 900px) {
  .manifesto .lead, .manifesto .aside { grid-column: 1 / span 12; }
  .manifesto .play { grid-column: 1 / span 12; text-align: left; margin-top: 22px; }
}

/* ---------- R&D index ---------- */

.rnd {
  padding-block: clamp(50px, 9vh, 110px) clamp(70px, 13vh, 150px);
  border-top: 1px solid var(--rule);
}
.rnd-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: clamp(18px, 2.1vw, 34px);
  letter-spacing: -0.018em;
  line-height: 1.1;
}
.rnd-head .dash {
  flex: 1 1 auto;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}
.disciplines { list-style: none; margin: clamp(34px, 7vh, 84px) 0 0; padding: 0; }
.disciplines li {
  border-top: 1px solid var(--rule);
  padding: clamp(10px, 1.3vw, 18px) 0;
  display: grid;
  grid-template-columns: 5ch 1fr auto;
  gap: var(--gut);
  align-items: baseline;
}
.disciplines li:last-child { border-bottom: 1px solid var(--rule); }
.disciplines .n { font-size: 11.5px; }
.disciplines .d {
  font-family: var(--ff-sans);
  font-size: clamp(16px, 2.2vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.05;
  will-change: transform;
}
.disciplines .k { font-size: 11.5px; text-transform: uppercase; }

/* ---------- project ---------- */

.project { padding-block: clamp(70px, 13vh, 160px); border-top: 1px solid var(--rule); }

.p-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  align-items: start;
}
.p-index { grid-column: 1 / span 1; font-size: 11.5px; padding-top: 0.5em; }
.p-ident { grid-column: 2 / span 7; }
.p-scope { grid-column: 10 / span 3; text-align: right; padding-top: 0.5em; }

.swatch {
  width: clamp(15px, 1.4vw, 22px);
  height: clamp(15px, 1.4vw, 22px);
  background: var(--sw);
  border: 1px solid var(--rule);
  display: block;
  margin-bottom: clamp(10px, 1vw, 16px);
  transform-origin: left top;
}

.p-client {
  font-family: var(--ff-mono);
  font-size: clamp(10.5px, 0.78vw, 12px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 8px;
}
.p-title {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: clamp(24px, 4.2vw, 70px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  text-wrap: balance;
}

@media (max-width: 860px) {
  .p-index, .p-ident { grid-column: 1 / span 12; }
  .p-scope { grid-column: 1 / span 12; text-align: left; margin-top: 10px; }
}

.p-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  margin-top: clamp(28px, 5vh, 66px);
}
.p-body .copy  { grid-column: 6 / span 5; }
.p-body .facts { grid-column: 2 / span 3; }
@media (max-width: 860px) {
  .p-body .copy  { grid-column: 1 / span 12; }
  .p-body .facts { grid-column: 1 / span 12; order: 2; margin-top: 22px; }
}

.facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  font-size: 11.5px;
}
.facts dt { text-transform: uppercase; opacity: 0.62; }
.facts dd { margin: 0; }

/* ---------- sketch panel ---------- */

.sketch-panel {
  margin-top: clamp(40px, 8vh, 100px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  align-items: center;
}
.sketch-wrap {
  grid-column: 2 / span 7;
  position: relative;
  border: 1px solid var(--rule);
  padding: clamp(10px, 1.4vw, 22px);
}
.sketch-note { grid-column: 10 / span 3; align-self: end; }
@media (max-width: 860px) {
  .sketch-wrap { grid-column: 1 / span 12; }
  .sketch-note { grid-column: 1 / span 12; margin-top: 16px; }
}
.sketch { width: 100%; height: auto; display: block; overflow: visible; }
.sketch path {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* ---------- plates ---------- */

.plates {
  margin-top: clamp(40px, 8vh, 110px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  align-items: start;
}
.plate { position: relative; }
.plate .frame {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
  clip-path: inset(0% 0% 0% 0%);
}
.plate img { will-change: transform; transform: scale(1.12); }
.plate figcaption {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  text-transform: uppercase;
}

.c-1 { grid-column: 1 / span 4; }
.c-2 { grid-column: 6 / span 7; margin-top: clamp(40px, 11vw, 150px); }
.c-3 { grid-column: 2 / span 5; margin-top: clamp(20px, 5vw, 70px); }
.c-4 { grid-column: 8 / span 5; margin-top: clamp(-40px, -4vw, 0px); }
.c-5 { grid-column: 1 / span 12; }
.c-6 { grid-column: 3 / span 4; margin-top: clamp(30px, 7vw, 96px); }
.c-7 { grid-column: 8 / span 4; margin-top: clamp(60px, 14vw, 190px); }
.c-8 { grid-column: 5 / span 6; }

@media (max-width: 860px) {
  .plates { gap: 26px; }
  .c-1, .c-2, .c-3, .c-4, .c-5, .c-6, .c-7, .c-8 { grid-column: 1 / span 12; margin-top: 0; }
  .c-3, .c-6 { grid-column: 2 / span 10; }
}

/* ---------- bands + technical sheet ---------- */

.band {
  margin-top: clamp(40px, 8vh, 110px);
  overflow: hidden;
  border: 1px solid var(--rule);
  clip-path: inset(0% 0% 0% 0%);
}
.band img { transform: scale(1.1); will-change: transform; }

.drawing {
  margin-top: clamp(36px, 7vh, 90px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding-block: clamp(14px, 2vw, 30px);
}
.drawing img {
  width: auto;
  height: clamp(280px, 56vh, 620px);
  max-width: none;
  padding-inline: var(--pad);
}

/* ---------- interlude ---------- */

.interlude {
  padding-block: clamp(80px, 16vh, 200px);
  border-top: 1px solid var(--rule);
  text-align: center;
}
.interlude h2 {
  margin: 0 auto;
  font-family: var(--ff-sans);
  font-size: clamp(26px, 5.4vw, 92px);
  font-weight: 500;
  letter-spacing: -0.034em;
  line-height: 1.04;
  max-width: 18ch;
  text-wrap: balance;
}

/* ---------- colophon ---------- */

.colophon {
  border-top: 1px solid var(--rule);
  padding-block: clamp(60px, 12vh, 140px) clamp(28px, 6vh, 60px);
}
.colophon .big {
  font-family: var(--ff-sans);
  font-size: clamp(26px, 6.4vw, 106px);
  font-weight: 500;
  letter-spacing: -0.034em;
  line-height: 0.98;
  margin: 0 0 clamp(30px, 6vh, 72px);
}
.colophon .cols {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gut);
  row-gap: 30px;
}
.col-a { grid-column: 1 / span 3; }
.col-b { grid-column: 5 / span 3; }
.col-c { grid-column: 9 / span 4; }
@media (max-width: 860px) { .col-a, .col-b, .col-c { grid-column: 1 / span 6; } }
.colophon ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.colophon li { font-size: 12.5px; }

.contact-line {
  margin-top: clamp(34px, 7vh, 84px);
  padding-top: clamp(18px, 3vh, 30px);
  border-top: 1px solid var(--rule);
}
.contact-line .email {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: clamp(15px, 2.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  word-break: break-word;
}
.contact-line .email::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 6px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.contact-line .email:hover::after,
.contact-line .email:focus-visible::after { transform: scaleX(1); }

.endbar {
  margin-top: clamp(40px, 9vh, 100px);
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.endbar > * { display: inline-block; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .plate img, .band img { transform: none; }
  * { scroll-behavior: auto !important; }
}
