/* ═══════════════════════════════════════════════════════════
   STRUKTUR® — drafting-table brutalism
   paper / ink / signal
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #F2EFE6;
  --ink: #16140F;
  --signal: #FF4D00;
  --hairline: rgba(22, 20, 15, 0.14);
  --hairline-strong: rgba(22, 20, 15, 0.32);
  --gutter: clamp(16px, 2.5vw, 36px);
  --bar-h: 52px;
  --display: "Archivo", sans-serif;
  --mono-f: "Fragment Mono", monospace;
  --serif-f: "Instrument Serif", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

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

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

.mono { font-family: var(--mono-f); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.serif { font-family: var(--serif-f); font-style: italic; font-weight: 400; }

/* ── paper grain ─────────────────────────────── */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.75;
  background-image: url("noise.png");
  background-size: 128px 128px;
}

/* ── 12-col grid overlay ─────────────────────── */
.grid-overlay {
  position: fixed;
  inset: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s;
}
.grid-overlay__col { border-left: 1px solid var(--hairline); }
.grid-overlay__col:last-child { border-right: 1px solid var(--hairline); }
.grid-overlay { opacity: 0.55; }
body.grid-on .grid-overlay { opacity: 1; }
body.grid-on .grid-overlay__col { background: rgba(255, 77, 0, 0.05); border-color: rgba(255, 77, 0, 0.35); }

/* ── custom drafting cursor ──────────────────── */
.cursor { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.cursor__h, .cursor__v { position: absolute; background: var(--hairline-strong); }
.cursor__h { left: 0; right: 0; height: 1px; top: var(--cy, 50%); }
.cursor__v { top: 0; bottom: 0; width: 1px; left: var(--cx, 50%); }
.cursor__dot {
  position: absolute; width: 10px; height: 10px;
  left: var(--cx, 50%); top: var(--cy, 50%);
  translate: -50% -50%;
  border: 1.5px solid var(--signal);
  rotate: 45deg;
  transition: width 0.2s, height 0.2s, rotate 0.3s, background 0.2s;
}
body.cursor-hover .cursor__dot { width: 26px; height: 26px; rotate: 0deg; background: rgba(255, 77, 0, 0.15); }
.cursor__label {
  position: absolute;
  left: var(--cx, 50%); top: var(--cy, 50%);
  translate: 14px 12px;
  font-family: var(--mono-f);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.65;
  white-space: nowrap;
}

/* ── bars ────────────────────────────────────── */
.bar {
  position: fixed; left: 0; right: 0;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}
.bar--top { top: 0; border-bottom: 1px solid var(--hairline-strong); }
.bar--bottom { bottom: 0; border-top: 1px solid var(--hairline-strong); font-size: 10px; }
.bar--bottom__hint b { color: var(--signal); }

.bar__logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 800; font-stretch: 115%;
  letter-spacing: 0.02em; font-size: 15px;
}
.bar__logo sup { font-size: 8px; color: var(--signal); }

.bar__nav { display: flex; gap: clamp(14px, 3vw, 40px); }
.bar__nav a {
  color: var(--ink); text-decoration: none;
  font-family: var(--mono-f); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  position: relative;
}
.bar__nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.7, 0, 0.3, 1);
}
.bar__nav a:hover::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .bar__nav { gap: 12px; }
  .bar__nav a { font-size: 9.5px; letter-spacing: 0.04em; }
  .bar__meta { display: none; }
  .bar--bottom__hint { display: none; }
}
@media (max-width: 460px) {
  .bar__nav a:nth-child(3) { display: none; }
}

/* ── fig tags & annotations ──────────────────── */
.fig-tag {
  display: flex; align-items: center; gap: 12px;
  color: var(--signal);
  margin-bottom: clamp(32px, 5vh, 64px);
}
.fig-tag i { flex: 0 0 clamp(40px, 8vw, 120px); height: 1px; background: currentColor; }
.fig-tag--light { color: var(--signal); }
.anno { position: absolute; line-height: 1.7; opacity: 0.8; }
.anno__mark { color: var(--signal); }

/* ══════════ HERO ══════════ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  padding: var(--bar-h) var(--gutter);
}
.anno--tl { top: calc(var(--bar-h) + 24px); left: var(--gutter); }
.anno--tr { top: calc(var(--bar-h) + 24px); right: var(--gutter); text-align: right; }
@media (max-width: 720px) { .anno--tr { display: none; } }

.hero__title {
  font-size: clamp(3rem, 12.5vw, 13rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.92;
  letter-spacing: -0.015em;
  display: flex;
  user-select: none;
}
.hero__letter {
  display: inline-block;
  animation: letter-in 1.1s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms + 150ms);
}
.hero__letter:nth-child(1) { --i: 3; } .hero__letter:nth-child(2) { --i: 1; }
.hero__letter:nth-child(3) { --i: 6; } .hero__letter:nth-child(4) { --i: 2; }
.hero__letter:nth-child(5) { --i: 7; } .hero__letter:nth-child(6) { --i: 0; }
.hero__letter:nth-child(7) { --i: 5; } .hero__letter:nth-child(8) { --i: 4; }
@keyframes letter-in {
  0% { opacity: 0; font-weight: 100; font-stretch: 62%; transform: translateY(0.35em); }
  100% { opacity: 1; font-weight: 900; font-stretch: 125%; transform: translateY(0); }
}
.hero__letter:hover { color: var(--signal); transition: color 0.15s; }

/* dimension lines */
.hero__dim { position: absolute; display: flex; align-items: center; gap: 10px; color: var(--ink); opacity: 0; animation: fade-in 0.8s 1.4s both; }
.hero__dim i { flex: 1; height: 1px; background: var(--hairline-strong); position: relative; }
.hero__dim i::before, .hero__dim i::after {
  content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: var(--hairline-strong);
}
.hero__dim i::before { left: 0; } .hero__dim i::after { right: 0; }
.hero__dim--w { left: calc(var(--gutter) * 2); right: calc(var(--gutter) * 2); top: 22%; }
.hero__dim--h {
  top: 20%; bottom: 20%; right: calc(var(--gutter) + 8px);
  flex-direction: column; width: 14px;
}
.hero__dim--h i { width: 1px; height: auto; flex: 1; }
.hero__dim--h i::before, .hero__dim--h i::after { left: -4px; top: auto; width: 9px; height: 1px; }
.hero__dim--h i::before { top: 0; } .hero__dim--h i::after { bottom: 0; }
.hero__dim--h span { writing-mode: vertical-rl; }
@media (max-width: 720px) { .hero__dim--h { display: none; } }

.hero__sub {
  margin-top: clamp(20px, 4vh, 44px);
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  font-weight: 300;
  text-align: center;
  line-height: 1.25;
}
.hero__sub-line { display: block; overflow: hidden; }
.hero__sub-line { animation: rise 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.hero__sub-line:nth-child(1) { animation-delay: 0.9s; }
.hero__sub-line:nth-child(2) { animation-delay: 1.05s; }
.hero__sub em { color: var(--signal); font-size: 1.12em; }
@keyframes rise { from { opacity: 0; transform: translateY(1.2em); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hero__foot {
  position: absolute; bottom: calc(var(--bar-h) + 22px);
  left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between; align-items: center;
  animation: fade-in 0.8s 1.6s both;
}
.hero__foot-arrow { color: var(--signal); font-size: 16px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ══════════ MARQUEE ══════════ */
.marquee {
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  overflow: hidden;
  padding: 18px 0;
  background: var(--ink); color: var(--paper);
  position: relative; z-index: 2;
}
.marquee__track { display: flex; white-space: nowrap; animation: marquee 28s linear infinite; }
.marquee__track span {
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 700; font-stretch: 115%;
  letter-spacing: 0.04em;
  padding-right: 0.5em;
}
.marquee__track .serif { color: var(--signal); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ══════════ SECTIONS SHARED ══════════ */
section, footer.contact { padding: clamp(80px, 14vh, 160px) var(--gutter); position: relative; z-index: 2; }

.section-title {
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 900; font-stretch: 122%;
  line-height: 0.95; letter-spacing: -0.01em;
  text-transform: uppercase;
}
.section-title .serif { text-transform: none; color: var(--signal); font-weight: 400; }

/* ══════════ MANIFESTO ══════════ */
.manifesto { max-width: 1200px; margin: 0 auto; }
.manifesto__text {
  font-size: clamp(1.55rem, 4.7vw, 4.2rem);
  font-weight: 640; font-stretch: 108%;
  line-height: 1.14;
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.manifesto__text .line { display: block; overflow: hidden; }
.manifesto__text .line > * , .manifesto__text .line { }
.reveal-lines .line {
  clip-path: inset(0 0 100% 0);
  transform: translateY(0.3em);
  transition: clip-path 0.9s cubic-bezier(0.2, 0.9, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.reveal-lines.in-view .line { clip-path: inset(0 0 -10% 0); transform: translateY(0); }
.reveal-lines .line:nth-child(2) { transition-delay: 0.1s; }
.reveal-lines .line:nth-child(3) { transition-delay: 0.2s; }
.reveal-lines .line:nth-child(4) { transition-delay: 0.3s; }
.reveal-lines .line:nth-child(5) { transition-delay: 0.4s; }
.manifesto__text .sig { color: var(--signal); }
.manifesto__text .strike { position: relative; }
.manifesto__text .strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 54%;
  height: 3px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s 0.9s cubic-bezier(0.7, 0, 0.3, 1);
}
.in-view ~ * .strike::after, .manifesto.struck .strike::after { transform: scaleX(1); }
.manifesto__note { margin-top: clamp(40px, 6vh, 80px); margin-left: auto; width: fit-content; line-height: 1.8; text-align: right; }

/* ══════════ WORK / PLATES ══════════ */
.work__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: clamp(40px, 7vh, 80px);
  gap: 24px; flex-wrap: wrap;
}
.plates {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 48px);
}
@media (max-width: 860px) { .plates { grid-template-columns: 1fr; } }
.plate:nth-child(even) { transform: translateY(clamp(20px, 5vh, 64px)); }
@media (max-width: 860px) { .plate:nth-child(even) { transform: none; } }

.plate__link { display: block; color: inherit; text-decoration: none; }
.plate__art {
  border: 1px solid var(--hairline-strong);
  background: var(--paper);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.plate__art svg { width: 100%; height: 100%; display: block; }
.plate__art::after {
  content: "PL. " attr(data-no);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--mono-f); font-size: 12px; letter-spacing: 0.2em;
  color: var(--paper);
  background: color-mix(in srgb, var(--signal) 92%, black);
  opacity: 0;
  transition: opacity 0.35s;
}
.plate__link:hover .plate__art { transform: translate(-6px, -6px); box-shadow: 6px 6px 0 var(--ink); }
.plate__link:hover .plate__art::after { opacity: 0; }

.plate__meta { padding: 18px 2px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.plate__no { color: var(--signal); padding-top: 6px; }
.plate__title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 850; font-stretch: 118%;
  text-transform: uppercase;
  grid-column: 2;
}
.plate__desc { grid-column: 2; font-weight: 300; font-size: 15px; line-height: 1.5; max-width: 42ch; opacity: 0.85; }
.plate__tags { grid-column: 2; margin-top: 8px; opacity: 0.6; }

/* plate art motion */
.nordlys-bars rect { transform-origin: bottom; transform: scaleY(0.6); transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1); }
.plate.in-view .nordlys-bars rect { transform: scaleY(1); }
.plate__link:hover .nordlys-bars rect:nth-child(odd) { transform: scaleY(0.75); }
.kvist-dot { animation: kvist-slide 4s ease-in-out infinite alternate; }
@keyframes kvist-slide { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
.ombruk-orbit { transform-origin: 200px 150px; animation: spin 22s linear infinite; }
.plate__link:hover .ombruk-orbit { animation-duration: 6s; }
@keyframes spin { to { transform: rotate(360deg); } }
.takt-path { stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 1.6s ease-out; }
.plate.in-view .takt-path { stroke-dashoffset: 0; }
.plate__link:hover .takt-path--sig { animation: takt-pulse 0.8s ease-in-out infinite alternate; }
@keyframes takt-pulse { from { stroke-width: 4; } to { stroke-width: 10; } }

/* ══════════ PROCESS ══════════ */
.process .section-title { margin-bottom: clamp(40px, 7vh, 80px); }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline-strong);
  border-left: 1px solid var(--hairline-strong);
}
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step {
  border-right: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  padding: clamp(24px, 3vw, 40px);
  min-height: 300px;
  display: flex; flex-direction: column; gap: 16px;
  transition: background 0.3s;
  position: relative;
}
.step:hover { background: rgba(22, 20, 15, 0.035); }
.step__no { color: var(--signal); font-size: 13px; }
.step__icon { width: 64px; height: 64px; color: var(--ink); }
.step__icon .draw { stroke-dasharray: 300; stroke-dashoffset: 300; }
.step.in-view .step__icon .draw { animation: draw-in 1.2s cubic-bezier(0.5, 0, 0.3, 1) forwards; animation-delay: calc(var(--d, 0) * 1s + 0.2s); }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.step__icon .pop { transform: scale(0); transform-origin: center; }
.step.in-view .step__icon .pop { animation: pop-in 0.5s 1s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
@keyframes pop-in { to { transform: scale(1); } }
.step__title { font-size: 1.5rem; font-weight: 850; font-stretch: 115%; text-transform: uppercase; margin-top: auto; }
.step__desc { font-weight: 300; font-size: 14.5px; line-height: 1.55; opacity: 0.85; }

/* ══════════ CAPABILITIES ══════════ */
.caps__list { list-style: none; border-top: 1px solid var(--hairline-strong); }
.caps__row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: clamp(18px, 3vh, 30px) 4px;
  border-bottom: 1px solid var(--hairline-strong);
  transition: padding-left 0.35s cubic-bezier(0.2, 0.9, 0.2, 1), background 0.35s;
  position: relative;
}
.caps__row:hover { padding-left: clamp(16px, 3vw, 48px); background: rgba(22, 20, 15, 0.03); }
.caps__row::before {
  content: "→"; position: absolute; left: 4px; color: var(--signal);
  opacity: 0; transition: opacity 0.3s;
  font-family: var(--mono-f);
}
.caps__row:hover::before { opacity: 1; }
.caps__no { color: var(--signal); }
.caps__name { font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-weight: 750; font-stretch: 112%; text-transform: uppercase; letter-spacing: -0.005em; }
.caps__hint { font-size: clamp(1rem, 1.8vw, 1.4rem); opacity: 0; transform: translateX(-10px); transition: opacity 0.35s, transform 0.35s; color: var(--signal); }
.caps__row:hover .caps__hint { opacity: 1; transform: translateX(0); }
@media (max-width: 560px) { .caps__hint { display: none; } .caps__row { grid-template-columns: 56px 1fr; } }

/* ══════════ CONTACT ══════════ */
.contact {
  background: var(--ink);
  color: var(--paper);
  padding-bottom: calc(var(--bar-h) + 60px);
}
.contact__lead { font-size: clamp(1.4rem, 3vw, 2.2rem); opacity: 0.9; margin-bottom: 16px; }
.contact__cta {
  display: block;
  width: fit-content;
  color: transparent;
  -webkit-text-stroke: 2px var(--paper);
  text-decoration: none;
  font-size: clamp(3.2rem, 11vw, 11rem);
  font-weight: 900; font-stretch: 125%;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: color 0.35s, -webkit-text-stroke-color 0.35s;
  margin: 0 0 clamp(48px, 8vh, 100px);
}
.contact__cta:hover { color: var(--signal); -webkit-text-stroke-color: var(--signal); }
.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  border-top: 1px solid rgba(242, 239, 230, 0.25);
  padding-top: 32px;
  line-height: 1.9;
}
@media (max-width: 720px) { .contact__grid { grid-template-columns: 1fr; } }
.contact__label { display: block; color: var(--signal); margin-bottom: 6px; }
.contact__grid a { color: var(--paper); text-decoration: none; border-bottom: 1px solid rgba(242, 239, 230, 0.4); }
.contact__grid a:hover { border-color: var(--signal); color: var(--signal); }
.contact__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: clamp(48px, 8vh, 90px);
  opacity: 0.55; font-size: 10px;
}

/* ── reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
