/*
  OBRAZA — styles.css
  ---------------------------------------------------------------
  HOW TO SWAP THINGS:
  • Logo: replace the hero <span class="wordmark__text" data-split> in index.html with
    <img class="wordmark__logo" src="assets/logo.svg" alt="Obraza">. .wordmark__logo is styled below.
  • Formspree ID: index.html → form action="https://formspree.io/f/FORM_ID".
  • Before/after film: index.html → <video id="film"> src + poster.

  Palette is black and white only: --paper, --ink, --rule, --muted. Nothing else.
*/

/* Fonts: Archivo (variable wght + wdth) and IBM Plex Mono from Google Fonts, self-hosted. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100% 115%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/plexmono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/plexmono-500-latin.woff2") format("woff2");
}

:root {
  --paper: #FFFFFF;
  --ink: #0B0B0B;
  --rule: #E6E6E6;
  --muted: #6F6F6F;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 960px;
  --gutter: 20px;
  --pad: clamp(100px, 12vw, 140px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }

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

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

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wrap {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--max);
  margin: 0 auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 16px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: progress; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px 0 56px;
}
.hero__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-top: 22px;
}
.hero__top .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 115%;
  font-variation-settings: "wdth" 115;
  font-size: clamp(3rem, 17vw, 10.75rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
  white-space: nowrap;
}
.wordmark__text { display: inline-block; }
.wordmark__logo { width: 100%; height: auto; }

/* Letter mask spans (created by script.js from [data-split]) */
.wm-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.04em;
  margin-bottom: -0.04em;
}
.wm-char { display: inline-block; will-change: transform; }

.hero__body {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.hero__tag {
  font-size: clamp(1.75rem, 6.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.hero__sub {
  margin-top: 12px;
  max-width: 30ch;
  color: var(--muted);
  font-size: 17px;
}
.hero__body .btn { margin-top: 32px; }

/* ---------- Credibility ---------- */

.cred .wrap > p {
  border-top: 1px solid var(--rule);
  padding: 28px 0;
}
.cred__line { color: var(--muted); line-height: 1.7; }

/* Proof strip: the one place colour is allowed. Stepped: sides at 85%, centre full size. */
.proof {
  display: grid;
  grid-template-columns: 0.85fr 1fr 0.85fr;
  align-items: center;
  gap: 12px;
  padding-bottom: 56px;
}
.proof__mask {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--rule);
}
.proof__mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 560px) {
  .proof { gap: 6px; }
}

/* ---------- Sections ---------- */

.section .wrap {
  border-top: 1px solid var(--rule);
  padding-top: var(--pad);
  padding-bottom: var(--pad);
}

.section__head { margin-bottom: 48px; }

.eyebrow {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow__idx { color: var(--ink); }

.h2 {
  margin-top: 18px;
  font-size: clamp(2.5rem, 10vw, 4.75rem);
  font-weight: 700;
  font-stretch: 108%;
  font-variation-settings: "wdth" 108;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.caption {
  margin-top: 12px;
  color: var(--muted);
}

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

.media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--ink);
}

.series {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 56px;
}

.photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 56px;
}
.photos img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--rule);
}

.lede {
  margin-top: 40px;
  max-width: 40em;
  font-size: 19px;
  line-height: 1.5;
}

/* ---------- Columns (What we do / How it works) ---------- */

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 48px;
}
.col {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.col p { margin-top: 10px; color: var(--muted); max-width: 34ch; }

.steps { margin-bottom: 0; }
.step__n { display: block; margin-bottom: 18px; color: var(--ink); }

/* ---------- About ---------- */

.statement {
  font-size: clamp(1.4rem, 5.4vw, 2.25rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

/* ---------- Contact ---------- */

.form { display: grid; gap: 36px; max-width: 640px; }
.field { display: grid; gap: 8px; }
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.input {
  width: 100%;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { outline: none; border-bottom-width: 2px; padding-bottom: 11px; }
.input:focus-visible { outline: none; }
textarea.input { resize: vertical; min-height: 112px; line-height: 1.45; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}
.form__status { color: var(--ink); text-transform: none; letter-spacing: 0.02em; font-size: 13px; }
.form__status:empty { display: none; }

.direct {
  display: grid;
  gap: 6px;
  margin-top: 64px;
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.direct a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
  user-select: text;
}
.direct a:hover { background-size: 100% 1px; }

/* ---------- Footer ---------- */

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
}
.footer__inner { padding-bottom: 12px; }
.footer__legal {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-bottom: 32px;
  color: var(--muted);
}
.footer__links { display: flex; gap: 20px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover,
.footer__links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.form__note { font-size: 14px; color: var(--muted); }
.form__note a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- Legal pages (privacy.html, terms.html, 404.html) ---------- */

.page-top { padding-top: 22px; }
.page-top .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.page-top a { text-decoration: none; }
.page-top__home {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 115%;
  font-variation-settings: "wdth" 115;
  font-size: 20px;
  letter-spacing: -0.04em;
  text-transform: none;
}
.page-top__back { color: var(--muted); align-self: center; }
.page-top__back:hover { color: var(--ink); }

.legal .wrap {
  padding-top: var(--pad);
  padding-bottom: var(--pad);
}
.legal__title { margin-top: 18px; }
.legal__date { margin-top: 20px; color: var(--muted); }
.legal__body { max-width: 680px; margin-top: 56px; }
.legal__body h2 {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.legal__body h2:first-child { margin-top: 0; }
.legal__body p,
.legal__body ul { margin-top: 14px; }
.legal__body ul { padding-left: 1.1em; list-style: square; }
.legal__body li + li { margin-top: 6px; }
.legal__body a { text-underline-offset: 3px; overflow-wrap: anywhere; }

/* ---------- Larger screens ---------- */

@media (min-width: 600px) {
  .series { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .hero { padding-bottom: 80px; }
  .hero__top { padding-top: 32px; }
  .page-top { padding-top: 32px; }
  .hero__body {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "tag btn" "sub btn";
    align-items: end;
    column-gap: 40px;
  }
  .hero__tag { grid-area: tag; }
  .hero__sub { grid-area: sub; }
  .hero__body > p:last-child { grid-area: btn; }
  .hero__body .btn { margin-top: 0; }
  .cred .wrap > p { padding: 32px 0; }
}

/* =========================================================
   Entry animation — only when <html> has .intro (set inline in <head>)
   Without JS: no .js / .intro → loader hidden, everything visible.
   ========================================================= */

.loader { display: none; }

.intro .loader {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  transition: opacity 0.25s linear;
}
.intro .loader__count {
  position: absolute;
  left: var(--gutter);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s linear;
}
.intro.is-counted .loader__count { opacity: 0; }
.intro.is-revealing .loader { opacity: 0; pointer-events: none; }


/* Letters stay painted behind the opaque loader, then drop into their masks while
   the counter fades, so the rise starts from below. */
.intro.is-counted .wm-char { transform: translateY(110%); }
.intro.is-revealing .wm-char {
  transform: translateY(0);
  transition: transform 0.7s var(--ease);
  transition-delay: calc(var(--i) * 45ms);
}

.intro .hero-fade { opacity: 0; transform: translateY(16px); }
.intro.is-revealing .hero-fade {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(380ms + var(--d) * 120ms);
}

/* ---------- Scroll reveals (JS only) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Proof strip: clip-path wipe up + image settles from 1.15, staggered 120ms. */
.js .proof__mask {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.9s var(--ease);
  transition-delay: calc(var(--s) * 120ms);
}
.js .proof__mask img {
  transform: scale(1.15);
  transition: transform 0.9s var(--ease);
  transition-delay: calc(var(--s) * 120ms);
}
.js .proof.is-in .proof__mask { clip-path: inset(0 0 0 0); }
.js .proof.is-in .proof__mask img { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .proof__mask { clip-path: none; transition: none; }
  .js .proof__mask img { transform: none; transition: none; }
  .btn, .direct a { transition: none; }
}
