/* ============================================================
   HORIN — DEFORMED IN CONCRETE
   monochrome editorial / brutalist, Benzin family
   ============================================================ */

@font-face {
  font-family: 'Benzin';
  src: url('../fonts/Benzin-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Benzin';
  src: url('../fonts/Benzin-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Benzin';
  src: url('../fonts/Benzin-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Benzin';
  src: url('../fonts/Benzin-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --paper: #f4f4f2;
  --mid: #8a8a86;
  --hairline: rgba(10, 10, 10, 0.18);
  --hairline-inv: rgba(244, 244, 242, 0.22);
  --pad: clamp(20px, 3.4vw, 52px);
  --header-h: 92px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

html, body { height: 100%; }

body {
  font-family: 'Benzin', 'Arial Narrow', sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; height: 100vh; }

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

a { color: inherit; text-decoration: none; }

/* ---------- background gradient (driven by JS on index) ---------- */

#bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--paper) 0%, #d9d9d6 100%);
}
/* dark layer crossfades over the light one — opacity is GPU-composited,
   no full-screen repaint while scrolling */
#bg-dark {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #111111 0%, #030303 100%);
  opacity: 0;
  will-change: opacity;
}

/* film grain — concrete dust */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- canvas ---------- */

#scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 26px var(--pad) 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
}
.site-header.is-on { opacity: 1; }
.site-header > * { pointer-events: auto; }

.h-project {
  justify-self: start;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.h-project small {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: none;
  margin-top: 3px;
  opacity: 0.75;
}

.h-logo {
  justify-self: center;
  display: block;
  width: 56px;
  height: 56px;
}
.h-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: filter 0.6s var(--ease-io);
}

.h-brand {
  justify-self: end;
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
}
.h-brand .h-nav {
  display: block;
  margin-top: 5px;
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
  transition: opacity 0.25s;
  position: relative;
}
.h-brand .h-nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -3px;
  border-bottom: 1px solid currentColor;
  transition: right 0.4s var(--ease-out);
}
.h-brand .h-nav:hover { opacity: 1; }
.h-brand .h-nav:hover::after { right: 0; }

/* dark-zone inversion */
.site-header { color: var(--ink); transition: opacity 0.7s var(--ease-out), color 0.6s var(--ease-io); }
.site-header.is-inverse { color: var(--paper); }
.site-header.is-inverse .h-logo img { filter: invert(1); }

/* ---------- preloader ---------- */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-io);
}
#preloader.is-done { opacity: 0; pointer-events: none; }

.pl-logo {
  position: relative;
  width: min(34vmin, 230px);
  aspect-ratio: 1200 / 1180;
  will-change: transform;
}
.pl-layer {
  position: absolute;
  inset: 0;
  -webkit-mask-image: url('../logo/logo.webp');
  mask-image: url('../logo/logo.webp');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.pl-ghost { background: var(--ink); opacity: 0.13; }
.pl-fill-wrap { overflow: hidden; }
.pl-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: var(--ink);
  transition: height 0.35s var(--ease-out);
}

.pl-count {
  position: absolute;
  left: 50%;
  top: calc(50% + min(20vmin, 140px));
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

/* fly-up phase: JS sets --fly-x / --fly-y / --fly-s */
.pl-logo.is-flying {
  transition: transform 0.9s var(--ease-io);
  transform: translate(var(--fly-x), var(--fly-y)) scale(var(--fly-s));
}
#preloader.is-flying .pl-count { opacity: 0; transition: opacity 0.3s; }
#preloader.is-flying { background: transparent; }

/* ---------- scroll spacer ---------- */

#scroll-space { height: 880vh; pointer-events: none; }

/* ---------- hero (start of scroll) ---------- */

.hero {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: calc(var(--header-h) + clamp(18px, 4vh, 48px)) var(--pad) 0;
  pointer-events: none;
  opacity: 0;
}
.hero.is-ready { opacity: 1; }

.hero h1 {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(34px, 7.2vw, 110px);
  line-height: 0.94;
  letter-spacing: 0.005em;
  max-width: 12ch;
}
.hero .hero-sub {
  margin-top: 18px;
  font-size: clamp(11px, 1.05vw, 14px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  display: flex;
  gap: 2.2em;
}

.scroll-hint {
  position: absolute;
  right: var(--pad);
  bottom: clamp(28px, 5vh, 64px);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.55;
  writing-mode: vertical-rl;
}
.scroll-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 46px;
  background: currentColor;
  margin: 12px auto 0;
  animation: hint-drop 1.8s var(--ease-io) infinite;
  transform-origin: top;
}
@keyframes hint-drop {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- chapter text blocks ---------- */

.chapter {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  pointer-events: none;
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
}

.ch-inner {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 30px);
  max-width: 760px;
  margin: 0 auto;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

.chapter { --chOff: 0; }

.ch-vertical {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(40px, 7.4vmin, 84px);
  line-height: 0.82;
  letter-spacing: 0.01em;
  writing-mode: vertical-rl;
  transform: rotate(180deg) translateY(calc(var(--chOff) * -1.4px));
  flex: 0 0 auto;
  will-change: transform;
}

.ch-body {
  padding-top: 0.2em;
  transform: translateY(calc(var(--chOff) * 1px));
  will-change: transform;
}

.ch-kicker {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1.6em;
  font-variant-numeric: tabular-nums;
}

.ch-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(30px, 5.6vmin, 64px);
  line-height: 0.95;
  margin-bottom: 0.55em;
}

.ch-text {
  font-weight: 400;
  font-size: clamp(13.5px, 1.6vmin, 17px);
  line-height: 1.75;
  max-width: 46ch;
  opacity: 0.92;
}

/* word-level reveal */
.ch-title .w, .ch-vertical .w {
  display: inline-block;
  will-change: transform, opacity;
}

/* ---------- outro / CTA ---------- */

.outro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  color: var(--paper);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.outro.is-live { pointer-events: auto; }

.outro .o-kicker {
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.6;
}

.outro .o-link {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(38px, 7.5vw, 110px);
  line-height: 1;
  position: relative;
  transition: letter-spacing 0.6s var(--ease-out);
}
.outro .o-link:hover { letter-spacing: 0.06em; }
.outro .o-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  border-bottom: 2px solid currentColor;
  transition: right 0.5s var(--ease-out);
}
.outro .o-link:hover::after { right: 0; }

.outro .o-foot {
  position: absolute;
  bottom: 30px;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
}

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(4, 4, 4, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-io), visibility 0s 0.45s;
  cursor: zoom-out;
}
#lightbox.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease-io);
}
#lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  opacity: 0;
  transform: scale(0.965);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
#lightbox img.is-loaded { opacity: 1; transform: none; }

.lb-num {
  position: absolute;
  top: 28px;
  left: var(--pad);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--paper);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.lb-close {
  position: absolute;
  top: 28px;
  right: var(--pad);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.7;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-page {
  background: linear-gradient(180deg, #101010 0%, #060606 100%);
  color: var(--paper);
  min-height: 100vh;
}
.contact-page::before {
  /* giant watermark logo */
  content: '';
  position: fixed;
  right: -12vmax;
  bottom: -14vmax;
  width: 64vmax;
  height: 64vmax;
  background: url('../logo/logo.webp') center / contain no-repeat;
  filter: invert(1);
  opacity: 0.05;
  pointer-events: none;
}
.contact-page .site-header { opacity: 1; color: var(--paper); }
.contact-page .site-header .h-logo img { filter: invert(1); }

.contact-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 30px) var(--pad) 60px;
}

.c-grid {
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 44px);
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
}

.c-vertical {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(44px, 9.5vmin, 110px);
  line-height: 0.82;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  flex: 0 0 auto;
  user-select: none;
  animation: c-rise 1.1s var(--ease-out) 0.15s backwards;
}
@keyframes c-rise {
  from { opacity: 0; transform: rotate(180deg) translateY(-40px); }
  to { opacity: 1; transform: rotate(180deg) translateY(0); }
}

.c-form { flex: 1; min-width: 0; }

.c-intro {
  font-size: clamp(12px, 1.3vw, 15px);
  line-height: 1.7;
  opacity: 0.7;
  max-width: 52ch;
  margin-bottom: clamp(26px, 4.5vh, 52px);
  animation: f-in 0.9s var(--ease-out) 0.3s backwards;
}

.f-row {
  position: relative;
  border-bottom: 1px solid var(--hairline-inv);
  padding: 20px 0 14px;
  animation: f-in 0.9s var(--ease-out) backwards;
  transition: border-color 0.4s;
}
.f-row:nth-of-type(1) { animation-delay: 0.4s; }
.f-row:nth-of-type(2) { animation-delay: 0.5s; }
.f-row:nth-of-type(3) { animation-delay: 0.6s; }
.f-row:nth-of-type(4) { animation-delay: 0.7s; }
.f-row.is-active { border-color: var(--paper); }
@keyframes f-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.f-num {
  position: absolute;
  left: 0;
  top: 26px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  opacity: 0.4;
  transition: opacity 0.3s;
  font-variant-numeric: tabular-nums;
}
.f-row.is-active .f-num, .f-row.is-filled .f-num { opacity: 1; }

.f-label {
  display: block;
  padding-left: 44px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 6px;
  transition: opacity 0.3s, letter-spacing 0.4s var(--ease-out);
}
.f-row.is-active .f-label { opacity: 1; letter-spacing: 0.42em; }

.f-row input,
.f-row textarea {
  width: 100%;
  padding-left: 44px;
  background: none;
  border: none;
  outline: none;
  color: var(--paper);
  font-family: 'Benzin', sans-serif;
  font-weight: 600;
  font-size: clamp(18px, 2.6vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  caret-color: var(--paper);
}
.f-row textarea {
  resize: none;
  min-height: 1.5em;
  line-height: 1.35;
  text-transform: none;
  font-weight: 400;
  font-size: clamp(15px, 2vw, 22px);
}
.f-row input::placeholder,
.f-row textarea::placeholder {
  color: var(--paper);
  opacity: 0.18;
  transition: opacity 0.3s;
}
.f-row.is-active input::placeholder,
.f-row.is-active textarea::placeholder { opacity: 0.08; }

/* topic pills */
.f-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 44px;
}
.f-pill {
  font-family: 'Benzin', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: none;
  border: 1px solid var(--hairline-inv);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.f-pill:hover { border-color: var(--paper); transform: translateY(-2px); }
.f-pill.is-on { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.f-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(28px, 5vh, 54px);
  animation: f-in 0.9s var(--ease-out) 0.8s backwards;
}

.f-submit {
  position: relative;
  font-family: 'Benzin', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: none;
  border-radius: 100px;
  padding: 22px 46px;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.25s var(--ease-out);
}
.f-submit .s-arrow { display: inline-block; transition: transform 0.35s var(--ease-out); margin-left: 0.8em; }
.f-submit:hover .s-arrow { transform: translateX(6px); }

.f-note { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.4; text-align: right; line-height: 1.8; }

/* success overlay */
.c-success {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease-io), visibility 0s 0.7s;
}
.c-success.is-on { opacity: 1; visibility: visible; transition: opacity 0.7s var(--ease-io); }

.cs-logo {
  position: relative;
  width: min(26vmin, 170px);
  aspect-ratio: 1200 / 1180;
}
.cs-logo .pl-fill { transition: height 1.4s var(--ease-io); }

.cs-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(26px, 4.6vw, 56px);
  text-align: center;
  line-height: 1;
}
.cs-sub { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.6; }
.cs-back {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  :root { --header-h: 76px; }

  .site-header { padding-top: 18px; }
  .h-project { font-size: 10.5px; }
  .h-project small { font-size: 9.5px; }
  .h-logo { width: 42px; height: 42px; }
  .h-brand { font-size: 12.5px; }

  .hero h1 { font-size: clamp(28px, 9.2vw, 64px); }
  .scroll-hint { display: none; }

  .ch-inner { flex-direction: column; gap: 22px; }
  .ch-vertical {
    writing-mode: horizontal-tb;
    transform: translateY(calc(var(--chOff) * -1px));
    font-size: clamp(34px, 9.6vw, 52px);
    line-height: 0.9;
  }
  .ch-text { font-size: 13.5px; line-height: 1.7; }

  .hero .hero-sub { flex-direction: column; gap: 0.7em; }

  .c-grid { flex-direction: column; gap: 14px; }
  .c-vertical {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: clamp(30px, 9vw, 44px);
    animation-name: f-in;
  }
  .contact-main { padding-top: calc(var(--header-h) + 14px); padding-bottom: 28px; }
  .c-intro { margin-bottom: 14px; }
  .f-row { padding: 13px 0 10px; }
  .f-num { top: 18px; }
  .f-actions { flex-direction: column; align-items: flex-start; margin-top: 18px; }
  .f-submit { padding: 17px 36px; }
  .f-note { text-align: left; }
}

/* short laptop screens: fit the whole contact form in one viewport */
@media (min-width: 821px) and (max-height: 800px) {
  .contact-main { padding-top: calc(var(--header-h) + 8px); padding-bottom: 22px; }
  .c-vertical { font-size: clamp(36px, 11vh, 84px); }
  .c-intro { margin-bottom: 14px; font-size: 12px; }
  .f-row { padding: 11px 0 9px; }
  .f-num { top: 15px; }
  .f-label { margin-bottom: 3px; }
  .f-row input { font-size: clamp(16px, 2.1vw, 22px); }
  .f-row textarea { font-size: clamp(13px, 1.7vw, 17px); }
  .f-pill { padding: 7px 15px; font-size: 10px; }
  .f-actions { margin-top: 16px; }
  .f-submit { padding: 15px 34px; }
}
