/* Shared base: reset, type, nav, buttons, work card, studio section, footer. */
@import url('./tokens.css');

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

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

/* ---------- type ---------- */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 6.1vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.display em,
.h2 em {
  font-style: italic;
}

.h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 5.3vw, 76px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.lede {
  font-size: clamp(17px, 1.67vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--mute);
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 11px;
  line-height: 15px;
  letter-spacing: 0.164em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ---------- button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  height: 39px;
  padding: 0 20px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.164em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(43, 19, 48, 0.55);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(var(--bg) 55%, rgba(238, 237, 241, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand .mark {
  height: 48px;
  width: auto;
}

.brand-name {
  font-family: var(--logo);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a:not(.btn) {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.164em;
  text-transform: uppercase;
}

/* ---------- single-ink logo (any svg/png with alpha, coloured by currentColor) ---------- */
.logo {
  display: inline-block;
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  background: currentColor;
  -webkit-mask: var(--src) left center / contain no-repeat;
  mask: var(--src) left center / contain no-repeat;
}

.logo-text {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 19px;
  line-height: 26px;
  letter-spacing: -0.02em;
}

/* Unnamed (NDA) work: a lock and a plain descriptor in place of a logo */
.logo-locked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.lock {
  width: 1em;
  height: 1em;
  flex: none;
}

/* ---------- work card ----------
   The card is a size container: set its width and everything inside scales with it. */
.card {
  display: block;
  width: var(--card-w, 100%);
  container-type: inline-size;
}

.card-body {
  font-size: 5.096cqw; /* 16px at a 314px card */
  background: var(--card);
  border-radius: 1.375em;
  padding: 0.5em 0.5em 0;
  box-shadow: 0 0.875em 2.75em rgba(43, 19, 48, 0.1);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.card-media {
  position: relative;
  aspect-ratio: 298 / 320;
  border-radius: 0.94em;
  overflow: hidden;
  background: var(--panel);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

/* NDA treatment: fluted panel, no project imagery */
.card-media.is-fluted {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  padding: 0 1.2em;
  text-align: center;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(30, 19, 38, 0.09) 7.143%), var(--panel);
}

.fluted-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.5em;
  letter-spacing: -0.025em;
  line-height: 1.16;
  text-wrap: balance;
}

.fluted-title em {
  display: block;
  font-style: italic;
}

.fluted-lock {
  font-size: 1.15em;
  opacity: 0.7;
}

/* Web + mobile screenshots layered on a tint */
.card-media.is-shots img {
  position: absolute;
  height: auto;
  object-fit: initial;
  box-shadow: 0 0.6em 1.8em rgba(43, 19, 48, 0.16);
}

.card-media.is-shots .shot-web {
  left: 7%;
  top: 11%;
  width: 124%;
  max-width: none;
  border-radius: 0.5em;
}

.card-media.is-shots .shot-mobile {
  right: 7%;
  top: 31%;
  width: 40%;
  border-radius: 1em;
}

.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  height: 4.5em;
  padding: 0 0.6em 0 0.5em;
}

.card-no {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 2.75em;
  line-height: 1;
  letter-spacing: -0.045em;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15em;
  font-family: var(--ui);
  white-space: nowrap;
}

.card-name {
  font-weight: 600;
  font-size: 0.875em;
  line-height: 1.35;
}

.card-kind {
  font-size: 0.75em;
  line-height: 1.35;
  color: var(--mute);
}

@media (hover: hover) {
  .card.is-liftable:hover .card-body {
    transform: translateY(-0.4em);
    box-shadow: 0 1.6em 3.4em rgba(43, 19, 48, 0.16);
  }

  .card.is-liftable:hover .card-media:not(.is-shots) img {
    transform: scale(1.035);
  }

  .card.is-liftable:hover .shot-mobile {
    transform: translateY(-0.5em);
  }
}

/* ---------- iridescent glow behind a stack ---------- */
.glow {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Each blob is a radial gradient shaped like a blurred disc of diameter --glow.
   No filter: blur(), which Chrome sometimes paints in square tiles while it loads. */
.glow i {
  --size: calc(var(--glow, 260px) * 2.1);
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2);
  opacity: 0.38;
  background: radial-gradient(
    circle closest-side,
    color-mix(in srgb, var(--c) 82%, transparent) 0%,
    color-mix(in srgb, var(--c) 70%, transparent) 25%,
    color-mix(in srgb, var(--c) 45%, transparent) 48%,
    color-mix(in srgb, var(--c) 13%, transparent) 71%,
    color-mix(in srgb, var(--c) 3%, transparent) 90%,
    transparent 100%
  );
}

/* Offsets are in glow diameters, so they hold at any size. */
.glow i:nth-child(1) {
  --c: var(--lilac);
  transform: translate(calc(var(--glow, 260px) * -0.52), calc(var(--glow, 260px) * -0.08));
}

.glow i:nth-child(2) {
  --c: var(--mint);
  transform: translate(calc(var(--glow, 260px) * 0.46), calc(var(--glow, 260px) * -0.2));
}

.glow i:nth-child(3) {
  --c: var(--peach);
  transform: translate(calc(var(--glow, 260px) * 0.3), calc(var(--glow, 260px) * 0.52));
}

/* ---------- studio section: scale headline + client grid ---------- */
.studio {
  padding: clamp(72px, 9vw, 128px) var(--gutter);
}

.studio-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.studio-intro p {
  max-width: 420px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 1.53vw, 22px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--mute);
}

.clients {
  margin-top: clamp(56px, 6.7vw, 96px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.client {
  height: 156px;
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.client:nth-child(4n + 1) {
  padding-left: 0;
}

.client:nth-child(4n) {
  border-right: 0;
}

.client-field {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--mute);
}

.client-name {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.023em;
  line-height: 1.2;
}

.client-note {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--mute);
}

/* ---------- footer ---------- */
.foot {
  padding: 40px var(--gutter) 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin: 0 var(--gutter);
  padding-left: 0;
  padding-right: 0;
}

.foot small {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--mute);
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 860px) {
  .clients {
    grid-template-columns: repeat(2, 1fr);
  }

  .client {
    height: 132px;
    padding: 16px 20px 20px;
  }

  .client:nth-child(4n + 1) {
    padding-left: 20px;
  }

  .client:nth-child(2n + 1) {
    padding-left: 0;
  }

  .client:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .client:nth-child(2n) {
    border-right: 0;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .brand .mark {
    height: 40px;
  }

  .brand-name {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
