/* ============================================================
   kauhaus.co — a small design studio
   Bauhaus geometry · Risograph ink · cream stock
   Palette + system locked per docs/HERO_BRIEF.md
   ============================================================ */

:root {
  /* — riso inks (exact, locked) — */
  --paper:   #F2E8D5;   /* munken cream — never pure white */
  --paper-2: #EADCC2;   /* deeper stock for alt blocks */
  --ink:     #1A1A18;   /* riso black */
  --blue:    #3D5588;   /* circles only */
  --yellow:  #FFE800;   /* triangles only */
  --red:     #FF665E;   /* bars / rectangles */
  --pink:    #FF48B0;   /* accent ghost only */
  /* derived overprints (visual reference; produced by multiply where possible) */
  --olive:   #273800;
  --plum:    #7B1E40;
  --coral:   #FF7700;

  /* — type — */
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --sans:    'Space Grotesk', ui-sans-serif, system-ui, sans-serif;

  /* — measure / rhythm — */
  --edge: clamp(1.25rem, 5vw, 5rem);
  --gut:  clamp(1.5rem, 4vw, 3.5rem);
  --maxw: 84rem;

  --line: 1.5px;                 /* hairline rule weight */
  --tease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 0.9; letter-spacing: -0.03em; text-transform: lowercase; }
::selection { background: var(--yellow); color: var(--ink); }

/* paper grain — fixed, multiply, cheap (procedural turbulence) */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9000;
  mix-blend-mode: multiply;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── focus + skip ─────────────────────────────────────────── */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip-link {
  position: fixed; top: 0; left: 0; z-index: 10000;
  background: var(--ink); color: var(--paper);
  padding: 0.6em 1em; font-size: 0.85rem;
  transform: translateY(-120%);
  transition: transform 0.2s var(--tease);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── kicker / section heads ───────────────────────────────── */
.section-head { padding: clamp(3.5rem,9vw,8rem) var(--edge) clamp(1.5rem,4vw,3rem); max-width: var(--maxw); margin-inline: auto; }
.kicker {
  font-size: 0.82rem; letter-spacing: 0.26em;
  display: inline-flex; align-items: center; gap: 0.8em; margin-bottom: 1.1rem;
  font-weight: 500;
}
.kicker__no {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  letter-spacing: 0; color: var(--red);
}
.kicker--invert .kicker__no { color: var(--yellow); }
.section-head h2 { font-size: clamp(2.4rem, 7vw, 5.5rem); max-width: 18ch; }

/* ════════════════════════════════════════════════════════════
   NAV
   ════════════════════════════════════════════════════════════ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.9rem,2vw,1.4rem) var(--edge);
  mix-blend-mode: multiply;
}
.nav__brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.nav__marks { display: inline-flex; align-items: center; gap: 4px; }
.mk { width: 11px; height: 11px; display: block; }
.mk--circle { border-radius: 50%; background: var(--blue); }
.mk--tri { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--yellow); }
.mk--sq { background: var(--red); }
.nav__word { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.nav__links { display: flex; align-items: center; gap: clamp(0.9rem,2.4vw,2rem); font-size: 0.95rem; font-weight: 500; }
.nav__links a { position: relative; padding: 0.2em 0; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--tease);
}
.nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); }
.nav__cta { background: var(--ink); color: var(--paper); padding: 0.5em 1em; }
.nav__cta:hover { background: var(--red); color: var(--ink); }
@media (max-width: 640px) { .nav__links a:not(.nav__cta):not([href="#contact"]) { display: none; } }

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--paper);
  display: flex; align-items: center;
  padding: clamp(5rem,11vh,8rem) var(--edge) clamp(3.5rem,7vh,5.5rem);
  overflow: hidden; isolation: isolate;
}
.hero__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: grid; grid-template-columns: 1.05fr minmax(300px, 0.78fr);
  gap: clamp(2rem, 5vw, 5.5rem); align-items: center;
}

/* — intro / title block — */
.hero__intro { max-width: 36rem; }
.hero__eyebrow {
  font-size: clamp(0.72rem,1.2vw,0.86rem); letter-spacing: 0.22em;
  font-weight: 500; margin-bottom: 0.7rem; color: var(--ink);
}
.hero__word { font-size: clamp(3rem, 8vw, 6.6rem); line-height: 0.84; letter-spacing: -0.035em; color: var(--ink); }
.hero__word-ink { display: inline-block; }
.js .hero__word-ink { clip-path: inset(0 100% 0 0); }
.hero.is-settled .hero__word-ink { clip-path: inset(0 0 0 0); }
.hero__lede { font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 34ch; margin-top: 1.3rem; line-height: 1.5; }
.js .hero__lede { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--tease), transform .6s var(--tease); }
.hero.is-settled .hero__lede { opacity: 1; transform: none; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.js .hero__actions { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--tease) .1s, transform .6s var(--tease) .1s; }
.hero.is-settled .hero__actions { opacity: 1; transform: none; }

/* — the kinetic print panel — */
.hero__poster {
  position: relative; margin: 0; justify-self: end;
  width: 100%; max-width: 520px;
  aspect-ratio: 5 / 6; max-height: 82vh;
  border: var(--line) solid var(--ink);
  background: var(--paper);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity .6s ease; }
.hero__canvas.is-ready { opacity: 1; }
.hero__fallback { position: absolute; inset: 0; z-index: 1; }
.hero__fallback svg { width: 100%; height: 100%; }
.hero.gl-ok .hero__fallback { display: none; }
.hero__corner { position: absolute; width: 15px; height: 15px; z-index: 3; }
.hero__corner--tl { top: -1px; left: -1px; border-top: 2px solid var(--red); border-left: 2px solid var(--red); }
.hero__corner--br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--blue); border-right: 2px solid var(--blue); }
.hero__plate { position: absolute; left: 0; right: 0; bottom: -1.7rem; text-align: center;
  font-size: 0.66rem; letter-spacing: 0.22em; color: var(--ink); opacity: 0.5; }

/* — buttons (hard geometry, no radius) — */
.btn { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; font-size: 0.98rem;
  padding: 0.7em 1.3em; letter-spacing: 0.01em; transition: background .25s var(--tease), color .25s var(--tease), transform .25s var(--tease); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--blue); transform: translate(-2px,-2px); }
.btn--line { border: var(--line) solid var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--yellow); transform: translate(-2px,-2px); }

/* — rotated left-rail tagline + scroll cue — */
.hero__tagline {
  position: absolute; left: clamp(0.6rem,2.5vw,1.6rem); top: 50%; z-index: 4;
  writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg);
  font-size: 0.72rem; letter-spacing: 0.32em; font-weight: 500; color: var(--ink); mix-blend-mode: multiply;
}
.js .hero__tagline { opacity: 0; transition: opacity 0.5s var(--tease) 1.3s; }
.hero.is-settled .hero__tagline { opacity: 1; }
.hero__scroll {
  position: absolute; z-index: 5; right: clamp(0.8rem,2.5vw,1.6rem); bottom: clamp(1.4rem,5vh,3rem);
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.7rem; letter-spacing: 0.28em; font-weight: 500; writing-mode: vertical-rl; mix-blend-mode: multiply;
}
.hero__scroll-bar { width: 1.5px; height: 46px; background: var(--ink); transform-origin: top; animation: scrollpulse 2.2s var(--tease) infinite; }
@keyframes scrollpulse { 0%,100%{ transform: scaleY(0.4); opacity:.4 } 50%{ transform: scaleY(1); opacity:1 } }

/* — hero responsive: stack with the print on top (poster structure) — */
@media (max-width: 880px) {
  .hero { padding-top: clamp(4.5rem,13vh,7rem); }
  .hero__inner { grid-template-columns: 1fr; gap: clamp(2rem,6vw,3rem); justify-items: center; text-align: center; }
  .hero__intro { order: 2; max-width: 40rem; }
  .hero__poster { order: 1; justify-self: center; max-width: min(430px, 86vw); }
  .hero__lede { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__tagline { display: none; }
}
@media (max-width: 420px) { .hero__scroll { display: none; } }

/* ════════════════════════════════════════════════════════════
   MANIFESTO marquee
   ════════════════════════════════════════════════════════════ */
.manifesto { border-block: var(--line) solid var(--ink); overflow: hidden; background: var(--paper); }
.marquee { display: flex; }
.marquee__track { display: flex; flex: none; gap: 0; animation: marquee 28s linear infinite; will-change: transform; }
.marquee__track span {
  font-family: var(--display); font-weight: 800; text-transform: lowercase;
  font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1; padding: 0.32em 0;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.dot { width: 0.5em; height: 0.5em; margin: 0 0.6em; display: inline-block; }
.dot--blue { border-radius: 50%; background: var(--blue); }
.dot--yellow { width: 0; height: 0; border-left: 0.32em solid transparent; border-right: 0.32em solid transparent; border-bottom: 0.55em solid var(--yellow); margin-bottom: 0.1em; }
.dot--red { background: var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ════════════════════════════════════════════════════════════
   PILLARS
   ════════════════════════════════════════════════════════════ */
.pillars__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  max-width: var(--maxw); margin: 0 auto clamp(3rem,8vw,7rem);
  border-top: var(--line) solid var(--ink);
}
.pillar { padding: clamp(2rem,4vw,3.5rem) clamp(1.4rem,3vw,2.6rem); border-bottom: var(--line) solid var(--ink); position: relative; }
.pillar + .pillar { border-left: var(--line) solid var(--ink); }
.pillar__mark { display: block; width: 64px; height: 64px; margin-bottom: 1.6rem; transition: transform .4s var(--tease); }
.pillar--circle .pillar__mark { border-radius: 50%; background: var(--blue); }
.pillar--tri .pillar__mark { width: 0; height: 0; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 64px solid var(--yellow); }
.pillar--sq .pillar__mark { background: var(--red); }
.pillar:hover .pillar__mark { transform: rotate(-8deg) translate(3px,-3px); }
.pillar h3 { font-size: clamp(1.8rem,3.4vw,2.8rem); margin-bottom: 0.6rem; }
.pillar p { max-width: 32ch; color: #4a463c; }
@media (max-width: 760px) {
  .pillars__grid { grid-template-columns: 1fr; }
  .pillar + .pillar { border-left: none; }
}

/* ════════════════════════════════════════════════════════════
   WORK
   ════════════════════════════════════════════════════════════ */
.work { background: var(--paper-2); border-top: var(--line) solid var(--ink); }
.work__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--edge) clamp(3rem,8vw,7rem);
  gap: clamp(1rem,2.5vw,2rem);
}
.card {
  position: relative; min-height: 340px; padding: clamp(1.6rem,3vw,2.4rem);
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--ink); overflow: hidden; isolation: isolate;
  transition: transform .35s var(--tease);
  border: var(--line) solid var(--ink);
}
.card--blue { background: var(--blue); color: var(--paper); }
.card--yellow { background: var(--yellow); }
.card--red { background: var(--red); }
.card--ink { background: var(--ink); color: var(--paper); }
.card:hover { transform: translate(-4px,-4px); }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.card__tag { font-size: 0.76rem; letter-spacing: 0.18em; font-weight: 600; opacity: 0.92; }
.card__glyph { width: 30px; height: 30px; flex: none; position: relative; transition: transform .3s var(--tease); }
.card__glyph::after { content: "↗"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 400; }
.card:hover .card__glyph { transform: translate(3px,-3px); }
.card__title { font-size: clamp(2.6rem,6vw,4.4rem); margin-top: auto; }
.card__desc { max-width: 36ch; margin-top: 0.6rem; font-size: 0.98rem; line-height: 1.45; }
/* riso channel-split on hover (misregistration tell) */
.card__title { transition: text-shadow .3s var(--tease); }
.card--yellow:hover .card__title { text-shadow: 2px 0 var(--red), -2px 0 var(--blue); }
.card--red:hover .card__title { text-shadow: 2px 0 var(--yellow), -2px 0 var(--ink); }
.card--blue:hover .card__title { text-shadow: 2px 0 var(--pink), -2px 0 var(--yellow); }
.card--ink:hover .card__title { text-shadow: 2px 0 var(--pink), -2px 0 var(--yellow); }
@media (max-width: 720px) { .work__grid { grid-template-columns: 1fr; } .card { min-height: 280px; } }

/* ════════════════════════════════════════════════════════════
   STUDIO
   ════════════════════════════════════════════════════════════ */
.studio {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem,5vw,5rem);
  align-items: center;
  max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem,10vw,9rem) var(--edge);
}
.studio__mark { display: flex; gap: 1rem; align-items: flex-end; height: 140px; }
.sm { display: block; }
.sm--circle { width: 92px; height: 92px; border-radius: 50%; background: var(--blue); }
.sm--tri { width: 0; height: 0; border-left: 46px solid transparent; border-right: 46px solid transparent; border-bottom: 92px solid var(--yellow); }
.sm--sq { width: 70px; height: 70px; background: var(--red); }
.studio__lede { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem,4vw,3.2rem); line-height: 0.95; text-transform: lowercase; margin-bottom: 1.2rem; }
.studio__text { font-size: clamp(1.05rem,1.6vw,1.3rem); max-width: 48ch; line-height: 1.6; color: #3a3730; }
.studio__text em { font-style: normal; color: var(--blue); font-weight: 600; }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr; } .studio__mark { height: auto; } }

/* ════════════════════════════════════════════════════════════
   SERVICES
   ════════════════════════════════════════════════════════════ */
.services { border-top: var(--line) solid var(--ink); }
.services__list { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--edge) clamp(3rem,8vw,7rem); }
.svc { display: grid; grid-template-columns: clamp(3rem,8vw,7rem) 1fr; gap: clamp(1rem,3vw,2.5rem); align-items: start;
  padding: clamp(1.6rem,3.5vw,2.6rem) 0; border-top: var(--line) solid var(--ink); }
.svc:last-child { border-bottom: var(--line) solid var(--ink); }
.svc__no { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem,6vw,4rem); line-height: 0.8; color: var(--red); }
.svc:nth-child(2) .svc__no { color: var(--blue); }
.svc:nth-child(3) .svc__no { color: var(--ink); }
.svc h3 { font-size: clamp(1.5rem,3vw,2.4rem); margin-bottom: 0.4rem; }
.svc p { max-width: 56ch; color: #4a463c; }

/* ════════════════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════════════════ */
.contact {
  background: var(--ink); color: var(--paper); position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 0.7fr; align-items: center;
  padding: clamp(4rem,12vw,10rem) var(--edge);
}
.contact .kicker { color: var(--paper); }
.contact__title { font-size: clamp(3rem,12vw,9rem); line-height: 0.84; color: var(--paper); margin: 0.4rem 0 1.6rem; }
.contact__mail { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem,4vw,2.6rem); color: var(--yellow); position: relative; }
.contact__mail::after { content:""; position:absolute; left:0; bottom:-4px; width:100%; height:3px; background: var(--yellow); transform: scaleX(0); transform-origin:left; transition: transform .35s var(--tease); }
.contact__mail:hover::after { transform: scaleX(1); }
.contact__note { margin-top: 1.2rem; opacity: 0.7; font-size: 0.95rem; }
.contact__art { position: relative; height: 280px; }
.contact__art .ca { position: absolute; mix-blend-mode: normal; }
.ca--circle { width: 196px; height: 196px; border-radius: 50%; background: var(--blue); right: 8%; top: 8px; }
.ca--tri { width: 0; height: 0; border-left: 64px solid transparent; border-right: 64px solid transparent; border-bottom: 118px solid var(--yellow); right: 20%; top: 118px; }
.ca--bar { width: 82%; height: 8px; background: var(--red); right: 0; top: 52%; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } .contact__art { display: none; } }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem;
  max-width: var(--maxw); margin: 0 auto; padding: clamp(2rem,5vw,3.5rem) var(--edge);
}
.footer__word { font-family: var(--display); font-weight: 800; font-size: clamp(2rem,5vw,3rem); }
.footer__meta { font-size: 0.85rem; opacity: 0.8; }
.footer__colophon { font-size: 0.8rem; opacity: 0.74; letter-spacing: 0.04em; }

/* nav backdrop once scrolled (legibility over content) */
.nav--scrolled { background: rgba(242,232,213,0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: var(--line) solid rgba(26,26,24,0.12); mix-blend-mode: normal; }

/* section reveals (added by JS; no-JS shows everything) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--tease) var(--reveal-delay,0ms), transform .7s var(--tease) var(--reveal-delay,0ms); will-change: opacity, transform; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ════════════════════════════════════════════════════════════
   REDUCED MOTION — everything settles instantly, nothing loops
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .hero__scroll-bar { animation: none; transform: scaleY(1); }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero__word-ink { clip-path: inset(0 0 0 0); }
  .hero__lede, .hero__actions { opacity: 1; transform: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
