/* ============================================================
   PRAKT — photochemical editorial
   paper & ink palette · Fraunces display · IBM Plex Mono labels
   ============================================================ */

:root {
  --paper: #ede7dc;
  --paper-dim: #e3dccd;
  --ink: #161310;
  --ink-soft: #6e6657;
  --accent: #b0492b;
  --line: rgba(22, 19, 16, 0.16);
  --line-light: rgba(237, 231, 220, 0.18);
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

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

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 340;
  font-optical-sizing: auto;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -100px;
  z-index: 85; pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-40px, 30px); }
  34% { transform: translate(30px, -50px); }
  51% { transform: translate(-30px, -20px); }
  68% { transform: translate(50px, 40px); }
  85% { transform: translate(-40px, -40px); }
  100% { transform: translate(0, 0); }
}

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
  display: none;
  opacity: 0; /* revealed by JS on first mousemove */
  align-items: center; justify-content: center;
}
.cursor__label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
}
@media (pointer: fine) {
  html.js .cursor { display: flex; }
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 80;
  background: var(--ink); color: var(--paper);
  display: none;
  align-items: center; justify-content: center;
}
html.js .preloader { display: flex; }

.leader {
  position: relative;
  width: min(58vmin, 420px); height: min(58vmin, 420px);
  display: flex; align-items: center; justify-content: center;
}
.leader__line { position: absolute; background: var(--line-light); }
.leader__line--h { left: -18vw; right: -18vw; top: 50%; height: 1px; }
.leader__line--v { top: -18vh; bottom: -18vh; left: 50%; width: 1px; }
.leader__rings { position: absolute; inset: 0; color: var(--paper); }
.leader__sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(rgba(237, 231, 220, 0.14) 0 55deg, transparent 55deg 360deg);
}
.leader__num {
  font-family: var(--font-serif);
  font-size: clamp(6rem, 24vmin, 11rem);
  font-weight: 400; line-height: 1;
  transform: translateY(0.04em);
}
.preloader__brand {
  position: absolute; bottom: max(env(safe-area-inset-bottom), 1.6rem);
  left: 50%; transform: translateX(-50%);
  opacity: 0.55; white-space: nowrap;
}

/* ---------- header ---------- */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 1.1rem var(--pad);
  color: var(--paper);
  mix-blend-mode: difference;
}
.site-head__logo {
  font-family: var(--font-serif);
  font-size: 1.35rem; font-weight: 500; letter-spacing: 0.06em;
}
.site-head__right { display: flex; align-items: baseline; gap: clamp(1.4rem, 3.5vw, 2.6rem); }
.site-head__nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.site-head__nav a { position: relative; padding: 0.2rem 0; }
.site-head__nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.site-head__nav a:hover::after { transform: scaleX(1); transform-origin: left center; }

.site-head__lang { display: flex; align-items: baseline; gap: 0.4rem; }
.lang-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: currentColor;
  opacity: 0.5; transition: opacity 0.3s ease;
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn[aria-pressed="true"] { opacity: 1; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 560px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--paper);
  overflow: clip;
}
.hero__media { position: absolute; inset: 0; z-index: -1; background: var(--ink); }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__fallback { position: absolute; inset: 0; }
.hero__fallback img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
  filter: saturate(0.82) contrast(1.04) brightness(0.92);
}
.hero__fallback img.is-active { opacity: 1; }
html.webgl .hero__fallback { visibility: hidden; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(22, 19, 16, 0.42), transparent 32%, transparent 55%, rgba(22, 19, 16, 0.62)),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(22, 19, 16, 0.38));
}

.hero__top {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 4.6rem var(--pad) 0;
}
.hero__loc { opacity: 0.75; }

.hero__title {
  font-size: clamp(5.2rem, 23.5vw, 23rem);
  font-weight: 380; line-height: 0.86;
  letter-spacing: -0.015em;
  text-align: center;
  user-select: none;
}

.hero__foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  padding: 0 var(--pad) 1.4rem;
}
.hero__scroll { opacity: 0.75; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.hero__counter { text-align: right; }
.hero__name { display: inline-block; min-width: 18ch; text-align: left; }
.hero__sep { opacity: 0.5; margin: 0 0.4em; }

/* ---------- marquee ---------- */
.marquee {
  overflow: clip;
  border-block: 1px solid var(--line);
  padding: 1.05rem 0;
  background: var(--paper);
}
.marquee__track { display: flex; white-space: nowrap; width: max-content; }
.marquee__track span {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 350; letter-spacing: 0.02em;
  padding-right: 0.5em;
}
.marquee__track i { font-style: normal; color: var(--accent); padding: 0 0.55em; font-size: 0.75em; }
html.js .marquee__track { animation: marquee 26s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- section head ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  color: var(--ink-soft);
}
.section-head--dark { border-color: var(--line-light); color: rgba(237, 231, 220, 0.6); }
.section-head__num::before { content: "( "; }
.section-head__num::after { content: " )"; }

/* ---------- ethos ---------- */
.ethos { padding: clamp(5rem, 14vh, 10rem) var(--pad) clamp(6rem, 16vh, 12rem); }

.ethos__line {
  font-size: clamp(2.5rem, 7vw, 6.8rem);
  font-weight: 350; line-height: 1.04; letter-spacing: -0.01em;
  max-width: 16ch;
  margin: clamp(2.5rem, 7vh, 5rem) 0 clamp(3rem, 8vh, 6rem);
}
.ethos__line em { color: var(--accent); }

.ethos__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  max-width: 1200px;
  margin-left: auto;
}
.ethos__cols p {
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink) 82%, var(--paper));
}

/* team */
.team { margin-top: clamp(5rem, 14vh, 10rem); }
.team__label { color: var(--ink-soft); margin-bottom: 2rem; }
.team__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 980px;
}
.team__media {
  overflow: clip; aspect-ratio: 3 / 4; background: var(--paper-dim);
}
.team__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(1.02);
  transform: scale(1.06);
  transition: filter 0.7s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.team__member:hover .team__media img { filter: grayscale(0); transform: scale(1.005); }
.team__member figcaption {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 0.85rem; gap: 0.5rem;
}
.team__name { font-size: clamp(1.05rem, 1.6vw, 1.4rem); font-weight: 420; }
.team__role { color: var(--ink-soft); }

/* ---------- development ---------- */
.dev { background: var(--paper); }
.dev__pin { overflow: clip; }
.dev__track {
  display: flex; align-items: stretch;
  gap: clamp(3rem, 7vw, 8rem);
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
  width: max-content;
  min-height: 100svh;
}

.dev__intro {
  display: flex; flex-direction: column; justify-content: space-between;
  width: min(78vw, 560px);
  flex-shrink: 0;
}
.dev__intro .section-head { width: 100%; }
.dev__heading {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
  font-weight: 350; line-height: 1.05; letter-spacing: -0.01em;
  max-width: 14ch;
  margin: 2rem 0;
}
.dev__heading em { color: var(--accent); }
.dev__hint { color: var(--ink-soft); }

.dev-card {
  width: min(80vw, 460px);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-self: center;
}
.dev-card__media {
  overflow: clip; aspect-ratio: 4 / 5; background: var(--paper-dim);
}
.dev-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.8) contrast(1.04);
  transform: scale(1.12);
  transition: filter 0.7s ease;
}
.dev-card:hover .dev-card__media img { filter: saturate(1) contrast(1.02); }
.dev-card__meta { color: var(--ink-soft); margin: 1.15rem 0 0.5rem; }
.dev-card__title {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 380; line-height: 1.06; letter-spacing: -0.01em;
}
.dev-card__title em { font-weight: 330; }
.dev-card__desc {
  margin-top: 0.8rem;
  font-size: clamp(0.98rem, 1.15vw, 1.1rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
  max-width: 42ch;
}

.dev__end {
  display: flex; align-items: center;
  padding-right: clamp(2rem, 20vw, 16rem);
  color: var(--ink-soft);
}

/* ---------- contact ---------- */
.contact {
  background: var(--ink); color: var(--paper);
  padding: clamp(5rem, 14vh, 9rem) var(--pad) clamp(4rem, 10vh, 6rem);
}
.contact__cta {
  font-size: clamp(3.2rem, 10.5vw, 10.5rem);
  font-weight: 350; line-height: 0.98; letter-spacing: -0.015em;
  margin: clamp(2.5rem, 8vh, 5.5rem) 0 1.2rem;
}
.contact__cta em { color: color-mix(in srgb, var(--accent) 80%, var(--paper)); }
.contact__note {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: rgba(237, 231, 220, 0.62);
  max-width: 34ch;
}
.contact__mail {
  display: inline-flex; align-items: center; gap: 0.5em;
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  font-weight: 350; font-style: italic;
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 0.12em;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.contact__mail svg { width: 0.85em; height: 0.85em; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.contact__mail:hover { color: color-mix(in srgb, var(--accent) 70%, var(--paper)); border-color: currentColor; }
.contact__mail:hover svg { transform: translateX(0.25em); }
.contact__addr {
  display: block; font-style: normal;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  color: rgba(237, 231, 220, 0.55);
}

/* ---------- footer ---------- */
.site-foot {
  background: var(--ink); color: var(--paper);
  padding: 0 var(--pad);
  overflow: clip;
}
.site-foot__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  border-top: 1px solid var(--line-light);
  padding: 1.4rem 0 0;
}
.site-foot__copy { color: rgba(237, 231, 220, 0.55); }
.site-foot__social { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.site-foot__social a { position: relative; padding: 0.2rem 0; }
.site-foot__social a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.site-foot__social a:hover::after { transform: scaleX(1); transform-origin: left center; }
.site-foot__brand {
  font-size: clamp(5rem, 24vw, 24rem);
  font-weight: 380; line-height: 0.78;
  letter-spacing: -0.015em;
  text-align: center;
  transform: translateY(0.14em);
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 231, 220, 0.32);
  user-select: none;
}

/* ---------- reveal primitives (JS sets initial states) ---------- */
.split-line-mask { overflow: clip; }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .dev__track {
    flex-direction: column; align-items: flex-start;
    width: auto; gap: clamp(3.5rem, 9vh, 5rem);
    min-height: 0;
    padding-block: clamp(4rem, 12vh, 7rem);
  }
  .dev__intro { width: 100%; gap: 1.5rem; }
  .dev__hint { display: none; }
  .dev-card { width: 100%; max-width: 560px; align-self: flex-start; }
  .dev__end { display: none; }
  .ethos__cols { grid-template-columns: 1fr; max-width: 60ch; margin-left: 0; }
}
@media (max-width: 560px) {
  .team__grid { grid-template-columns: 1fr; }
  .hero__tag { max-width: 24ch; }
  .hero__name { min-width: 0; }
  .site-foot__row { flex-direction: column; gap: 0.8rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll { animation: none; }
  html.js .marquee__track { animation: none; }
  .cursor { display: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
