/* ==========================================================================
   RUNIT × GEHAUS · Portfolio
   Runit palette, Runit display face. Dark, minimal, card-led.
   The page stays short: every image lives in the viewer, not in the scroll.
   ========================================================================== */

@font-face {
  font-family: "adineue PRO KZ";
  src: url("../fonts/adineue-pro-kz-light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Core Sans A";
  src: url("../fonts/CoreSansA35Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Core Sans A";
  src: url("../fonts/CoreSansA45Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Core Sans A";
  src: url("../fonts/CoreSansA55Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* Runit brand, exact */
  --green:  #32D17E;
  --ink:    #1C1E1C;
  --gray:   #E0E1DD;
  --teal:   #175E54;

  --ground: #141613;
  --card:   #1F211E;
  --raise:  #262825;
  --mute:   #85887F;
  --soft:   #AFB2A9;

  --line:      rgba(224, 225, 221, .11);
  --line-soft: rgba(224, 225, 221, .06);

  --f-display: "adineue PRO KZ", "Core Sans A", -apple-system, system-ui, sans-serif;
  --f-sans:    "Core Sans A", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --wrap: 1360px;
  --pad:  clamp(20px, 4.6vw, 72px);
  --gap:  clamp(10px, 1.2vw, 18px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--gray);
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: clamp(14px, .3vw + 13px, 16px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
::selection { background: var(--green); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.skip {
  position: fixed; top: -80px; left: 14px; z-index: 200;
  background: var(--green); color: var(--ink);
  padding: 10px 16px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  transition: top .2s var(--ease);
}
.skip:focus { top: 14px; }

/* --- primitives --------------------------------------------------------- */
.display {
  font-family: var(--f-display);
  font-weight: 300;
  text-transform: lowercase;
  line-height: 1.0;
  letter-spacing: -.015em;
}
.label {
  font-size: clamp(9.5px, .5vw, 10.5px);
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
  line-height: 1.5;
}
.wrap {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

.rv { opacity: 0; transform: translateY(20px); }
.rv.is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .9s var(--ease); }
.rv-d1.is-in { transition-delay: .07s; }
.rv-d2.is-in { transition-delay: .14s; }
.rv-d3.is-in { transition-delay: .21s; }
@media (prefers-reduced-motion: reduce) { .rv, .rv.is-in { opacity: 1; transform: none; transition: none; } }

/* --- header ------------------------------------------------------------- */
.progress {
  position: fixed; inset: 0 auto auto 0; z-index: 90; height: 2px; width: 100%;
  background: var(--green); transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform; pointer-events: none;
}
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: clamp(15px, 1.8vw, 24px) max(var(--pad), env(safe-area-inset-right)) clamp(15px, 1.8vw, 24px) max(var(--pad), env(safe-area-inset-left));
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
}
.site-head.is-stuck {
  background: color-mix(in srgb, var(--ground) 84%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom-color: var(--line);
  padding-block: clamp(11px, 1.2vw, 15px);
}
.lockup { display: flex; align-items: center; gap: clamp(11px, 1.4vw, 18px); }
.lockup__runit { height: clamp(12px, 1.2vw, 15px); width: auto; }
.lockup__x { font-size: 12px; color: var(--mute); transform: translateY(-1px); }
.lockup__gehaus { height: clamp(15px, 1.7vw, 20px); color: var(--gray); }
.lockup__gehaus svg { height: 100%; width: auto; }

.cta {
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  padding: 9px 17px; border: 1px solid var(--line); border-radius: 999px;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
@media (hover: hover) { .cta:hover { background: var(--green); color: var(--ink); border-color: var(--green); } }
.cta:active { background: var(--green); color: var(--ink); border-color: var(--green); }

/* --- hero --------------------------------------------------------------- */
/* Split: type holds the left, one full-height photograph holds the right. The
   image is never shown wider than its source, so it stays sharp. */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 56px);
  align-items: stretch;
  padding-top: clamp(88px, 12vh, 132px);
  padding-bottom: clamp(24px, 4vh, 40px);
}
.hero__text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hero__eyebrow { display: flex; align-items: center; gap: 12px; }
.hero__eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none;
  animation: pulse 3.2s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .hero__eyebrow .dot { animation: none } }

.hero__title {
  font-size: clamp(38px, 5.6vw, 86px);
  margin-block: clamp(22px, 3vh, 36px) clamp(22px, 3vw, 34px);
  text-wrap: balance;
}
.g { color: var(--green); }
.hero__foot {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-top: clamp(16px, 2vw, 24px);
  border-top: 1px solid var(--line);
}
.hero__sub { max-width: 40ch; color: var(--soft); font-size: clamp(14px, .95vw, 16px); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 6px clamp(12px, 1.6vw, 22px); }

.hero__figure { position: relative; overflow: hidden; min-height: 0; background: var(--card); }
.hero__figure img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.2s var(--ease);
}
.hero__figure img.is-loaded { opacity: 1; animation: drift 26s var(--ease) forwards; }
@keyframes drift { to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero__figure img { transform: none; }
  .hero__figure img.is-loaded { animation: none; }
}
.hero__figure::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,22,19,.30) 0%, rgba(20,22,19,0) 26%, rgba(20,22,19,.62) 100%);
}
.hero__cap {
  position: absolute; z-index: 2; left: clamp(14px, 1.4vw, 20px); right: clamp(14px, 1.4vw, 20px);
  bottom: clamp(14px, 1.4vw, 20px);
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.hero__cap .n { color: var(--green); }
.hero__cap .name { color: rgba(224, 225, 221, .88); }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: auto;
    gap: clamp(22px, 4vw, 34px);
    padding-top: clamp(84px, 15vh, 120px);
  }
  .hero__title { font-size: clamp(36px, 8.4vw, 62px); }
  .hero__figure { aspect-ratio: 4 / 5; }
}
@media (max-width: 480px) { .hero__figure { aspect-ratio: 3 / 4; } }

/* --- section head ------------------------------------------------------- */
.section { padding-block: clamp(46px, 6vh, 86px); }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: clamp(22px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(22px, 3vw, 38px);
}
.sec-head h2 { font-size: clamp(24px, 2.8vw, 40px); }
.sec-head p { color: var(--mute); max-width: 46ch; font-size: 13.5px; }

/* --- cards -------------------------------------------------------------- */
.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap);
}
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative; display: block; width: 100%;
  padding: 0; margin: 0; text-align: left; appearance: none;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line-soft);
  transition: border-color .5s var(--ease), background .5s var(--ease);
}
@media (hover: hover) {
  .card:hover { border-color: color-mix(in srgb, var(--green) 42%, transparent); background: var(--raise); }
}
.card:active { border-color: color-mix(in srgb, var(--green) 42%, transparent); background: var(--raise); }

.card__media {
  display: block; position: relative;
  aspect-ratio: 4 / 3; overflow: hidden;
  background-size: cover; background-position: center;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  filter: saturate(.88) brightness(.94);
  transform: scale(1.01);
  transition: opacity .9s var(--ease), transform 1.4s var(--ease), filter .6s var(--ease);
}
.card__media img.is-loaded { opacity: 1; }
@media (hover: hover) { .card:hover .card__media img { transform: scale(1.045); filter: saturate(1.02) brightness(1); } }
/* Just enough shade at the top for the index and count to sit on any photo. */
.card__media::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 34%;
  background: linear-gradient(180deg, rgba(20,22,19,.62) 0%, rgba(20,22,19,0) 100%);
  pointer-events: none;
}

.card__n {
  position: absolute; top: clamp(13px, 1.5vw, 20px); left: clamp(13px, 1.5vw, 20px);
  z-index: 2; color: var(--green); letter-spacing: .22em;
}
.card__count {
  position: absolute; top: clamp(13px, 1.5vw, 20px); right: clamp(13px, 1.5vw, 20px);
  z-index: 2; color: rgba(224, 225, 221, .8);
  display: flex; align-items: center; gap: 8px;
}
.card__count .arrow { display: inline-block; transition: transform .5s var(--ease); }
@media (hover: hover) { .card:hover .card__count .arrow { transform: translate(3px, -3px); } }

.card__body {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: clamp(15px, 1.8vw, 24px) clamp(15px, 1.8vw, 24px) clamp(17px, 2vw, 26px);
}
.card__body > span { display: block; min-width: 0; }
.card__title { display: block; font-size: clamp(19px, 2vw, 30px); line-height: 1.05; }
.card__loc { display: block; margin-top: 7px; }
.card__tag { flex: none; text-align: right; white-space: nowrap; }
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--green); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .6s var(--ease);
}
@media (hover: hover) { .card:hover::after { transform: scaleX(1); } }
.card:active::after { transform: scaleX(1); }
@media (max-width: 480px) { .card__body { flex-direction: column; align-items: flex-start; gap: 10px; } .card__tag { text-align: left; } }

/* --- confidential grid ---------------------------------------------------
   A wrapping grid, not a horizontal scroller: every image sits on the page
   at once. A filmstrip hid most of the set off-screen with no cue that more
   was there; nothing here should read as fewer than it is. */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
}
.tile {
  aspect-ratio: 4 / 3;
  position: relative; overflow: hidden; cursor: zoom-in;
  background-size: cover; background-position: center;
  border: 1px solid var(--line-soft);
}
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; filter: saturate(.6) brightness(.86);
  transition: opacity .8s var(--ease), filter .55s var(--ease), transform 1.1s var(--ease);
}
.tile img.is-loaded { opacity: 1; }
@media (hover: hover) { .tile:hover img { filter: saturate(1) brightness(1); transform: scale(1.04); } }
.tile:active img { filter: saturate(1) brightness(1); }

/* --- contact ------------------------------------------------------------ */
.contact { padding-block: clamp(54px, 8vh, 104px); border-top: 1px solid var(--line); }
.contact__title { font-size: clamp(34px, 6vw, 88px); margin-bottom: clamp(26px, 3.4vw, 46px); }
/* Gehaus is the only channel to the client; Runit sits beside it as a credit.
   On the Runit-only interior design site, .studios--solo drops to one card. */
.studios { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.studios--solo { grid-template-columns: minmax(0, 1fr); }
.studios--solo .studio { max-width: 46ch; }
.studio {
  padding: clamp(24px, 2.8vw, 38px) clamp(20px, 3vw, 48px) clamp(24px, 2.8vw, 38px) 0;
  border-bottom: 1px solid var(--line);
}
.studio + .studio { padding-left: clamp(20px, 3vw, 48px); padding-right: 0; border-left: 1px solid var(--line); }
.studio__mark { height: 19px; margin-bottom: 16px; }
.studio__mark img, .studio__mark svg { height: 100%; width: auto; }
.studio__role { margin-bottom: 18px; }
.studio__name { font-family: var(--f-display); font-weight: 300; text-transform: lowercase; font-size: clamp(20px, 2vw, 28px); line-height: 1.05; letter-spacing: -.012em; }
.studio__title { margin-top: 7px; }
.studio--credit { color: var(--mute); }
.studio--credit .studio__mark { opacity: .55; }
.studio__note { max-width: 34ch; font-size: 13.5px; color: var(--mute); }
.studio__foot { margin-top: clamp(18px, 2.2vw, 28px); padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--soft); }
.links { list-style: none; margin: 14px 0 0; padding: 0; }
.links li { border-top: 1px solid var(--line-soft); }
.links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 10px 0; font-size: 12.5px;
}
.links .k { color: var(--mute); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; }
.links .v { transition: color .3s var(--ease); }
@media (hover: hover) { .links a:hover .v { color: var(--green); } }
@media (max-width: 760px) {
  .studios { grid-template-columns: 1fr; }
  .studio, .studio + .studio { padding-inline: 0; border-left: 0; }
}

.site-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: clamp(20px, 2.4vw, 32px);
}
.site-foot a { color: var(--mute); transition: color .3s var(--ease); }
@media (hover: hover) { .site-foot a:hover { color: var(--green); } }

/* --- viewer ------------------------------------------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 120;
  background: color-mix(in srgb, var(--ground) 93%, transparent);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  display: grid; grid-template-rows: auto 1fr auto;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.lb.is-open { opacity: 1; visibility: visible; }
body.is-locked .site-head { opacity: 0; pointer-events: none; }

.lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: clamp(15px, 2vw, 24px) var(--pad); }
.lb__where { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lb__name { font-family: var(--f-display); font-weight: 300; text-transform: lowercase; font-size: clamp(15px, 1.5vw, 21px); letter-spacing: -.01em; }
.lb__close { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); transition: color .3s var(--ease); }
@media (hover: hover) { .lb__close:hover { color: var(--green); } }

.lb__stage { position: relative; min-height: 0; }
.lb__frame { position: absolute; inset: 0 clamp(12px, 5.5vw, 84px); display: flex; align-items: center; justify-content: center; }
.lb__frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; opacity: 0; transition: opacity .35s var(--ease); }
.lb__frame img.is-ready { opacity: 1; }

.lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: clamp(38px, 4.4vw, 50px); height: clamp(38px, 4.4vw, 50px);
  display: grid; place-items: center; font-size: 17px;
  border: 1px solid var(--line); border-radius: 50%;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
@media (hover: hover) { .lb__nav:hover { background: var(--green); color: var(--ink); border-color: var(--green); } }
.lb__nav--prev { left: clamp(6px, 1.2vw, 20px); }
.lb__nav--next { right: clamp(6px, 1.2vw, 20px); }
@media (max-width: 680px) { .lb__nav { display: none; } }

.lb__foot { padding: clamp(12px, 1.8vw, 22px) var(--pad); display: flex; align-items: center; gap: 16px; }
.lb__dots { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.lb__dot { width: 22px; height: 2px; background: var(--line); border-radius: 2px; transition: background .35s var(--ease); }
.lb__dot.is-on { background: var(--green); }

/* An odd number of projects would leave a hole in the two-column grid: the last
   card spans both columns and takes a wider crop instead. */
.card--wide { grid-column: 1 / -1; }
.card--wide .card__media { aspect-ratio: 21 / 9; }
.card--wide .card__title { font-size: clamp(21px, 2.4vw, 36px); }
@media (max-width: 820px) { .card--wide .card__media { aspect-ratio: 4 / 3; } }

/* ==========================================================================
   Touch sizing: iPhone and iPad
   ========================================================================== */

/* iPad portrait and below: one column of large cards reads better than two
   cramped ones, and the grid tiles grow so they are still worth tapping. */
@media (max-width: 1024px) {
  .strip { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

/* iPhone */
@media (max-width: 640px) {
  :root { --gap: 10px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sec-head p { font-size: 13px; }
  .card__body { flex-direction: column; align-items: flex-start; gap: 9px; }
  .card__tag { text-align: left; }
  .card__media { aspect-ratio: 4 / 3; }
  .card--wide .card__media { aspect-ratio: 4 / 3; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact__title { font-size: clamp(32px, 11vw, 46px); }
  .studio__name { font-size: clamp(21px, 7vw, 28px); }
  /* Tap targets stay at or above 44 px. */
  .links a { padding: 13px 0; }
  .cta { padding: 11px 18px; }
  .site-foot { padding-block: 22px 28px; }
}

/* Viewer on touch: no hover affordances, so the chrome gets out of the way and
   the frame takes the room. Bars clear the notch and the home indicator. */
@media (max-width: 680px) {
  .lb__bar { padding: max(14px, env(safe-area-inset-top)) var(--pad) 12px; }
  .lb__name { font-size: 17px; }
  .lb__where { gap: 4px 12px; }
  .lb__frame { inset: 0 12px; }
  .lb__foot {
    padding: 10px var(--pad) max(14px, env(safe-area-inset-bottom));
    gap: 12px;
  }
  .lb__dot { width: 14px; }
  .lb__close { padding: 6px 0 6px 12px; }
}

/* Landscape phones: the hero would otherwise eat the whole screen. */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 84px; }
  .hero__title { font-size: clamp(30px, 5vw, 46px); }
  .hero__figure { aspect-ratio: 16 / 9; }
}

/* Coarse pointers get bigger hit areas on the strip and cards. */
@media (pointer: coarse) {
  .tile { cursor: default; }
  .card { -webkit-tap-highlight-color: transparent; }
  .tile { -webkit-tap-highlight-color: transparent; }
}

@media (max-width: 900px) { .hero__text { justify-content: flex-start; } }
