/* ==========================================================================
   k.vst.works — Koidu Vest
   Editorial portfolio. Self-hosted type, no JavaScript, no third-party calls.
   ========================================================================== */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  --paper: #faf9f6;
  --paper-2: #f2f0ea;
  --paper-3: #eae7df;
  --ink: #121212;
  --ink-2: #3d3a35;
  --muted: #6b6862;
  --line: #e0dcd3;
  --line-2: #cdc8bc;
  --accent: #ae3a1f;

  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;

  --gutter: clamp(20px, 4.5vw, 64px);
  --shell: 1440px;
  --text-col: 62ch;

  --space-section: clamp(3rem, 5vw, 5rem);
  --rule: 1px solid var(--line);
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* ---------- type scale ---------- */
.display,
h1 {
  font-size: clamp(2rem, 1.25rem + 3.2vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 2.05rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-weight: 600;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.26;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-weight: 600;
}

.lead {
  font-size: clamp(1.02rem, 0.97rem + 0.35vw, 1.22rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink-2);
  text-wrap: pretty;
}

.label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.label--accent {
  color: var(--accent);
}

.num {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

/* ---------- layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.text-col {
  max-width: var(--text-col);
}

.text-col > * + * {
  margin-top: 1.1em;
}

.section {
  padding-block: var(--space-section);
}

.section--tight {
  padding-block: clamp(2.25rem, 3.5vw, 3.5rem);
}

.ruled {
  border-top: var(--rule);
}

/* Section header: label + heading left, supporting note right. */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3.5rem);
  align-items: end;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.sec-head__label {
  grid-column: 1 / -1;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: var(--rule);
}

.sec-head p {
  color: var(--muted);
  max-width: 44ch;
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: var(--rule);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.0625rem;
}

.brand small {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* The tagline is the first thing to go when the header gets tight. */
@media (max-width: 48rem) {
  .brand small {
    display: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  font-size: 0.9375rem;
}

.nav a {
  position: relative;
  padding-block: 0.35rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--ink);
}

.nav a[aria-current] {
  color: var(--ink);
}

.nav a[aria-current]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1rem;
  height: 2px;
  background: var(--accent);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(1.75rem, 3vw, 3rem);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  padding-bottom: 1rem;
  margin-bottom: clamp(1.4rem, 2.5vw, 2rem);
  border-bottom: var(--rule);
}

.hero h1 {
  max-width: 17ch;
}

.hero__lead {
  margin-top: clamp(1.1rem, 1.8vw, 1.5rem);
  max-width: 52ch;
}

/* Positioning strip: what she does, in three plain lines. */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  border-top: var(--rule);
}

.strip > div {
  padding: 1.75rem 0 0;
  padding-right: clamp(1rem, 3vw, 3rem);
  border-right: var(--rule);
}

.strip > div:last-child {
  border-right: 0;
  padding-right: 0;
}

.strip > div > .label {
  margin-bottom: 0.7rem;
}

.strip p {
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 30ch;
}

@media (max-width: 52rem) {
  .strip > div {
    border-right: 0;
    border-bottom: var(--rule);
    padding-bottom: 1.5rem;
    padding-right: 0;
  }
  .strip > div:last-child {
    border-bottom: 0;
  }
}

/* ---------- buttons & links ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.5rem;
  margin-top: clamp(1.4rem, 2.5vw, 2rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--accent);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.link .arrow,
.btn .arrow {
  transition: transform 0.2s ease;
}

.link:hover .arrow,
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- project list (homepage + work index) ---------- */
.projects {
  display: grid;
  gap: clamp(2.25rem, 4vw, 3.5rem);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* Alternating emphasis keeps the index from reading as a uniform template. */
.project--wide .project__media {
  aspect-ratio: 16 / 9;
}

.project--tall {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.project--tall .project__media {
  aspect-ratio: 4 / 3;
}

@media (max-width: 54rem) {
  .project--tall {
    grid-template-columns: minmax(0, 1fr);
  }
  .project--tall .project__media {
    aspect-ratio: 16 / 10;
  }
}

.project__media {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  border: var(--rule);
}

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* A looping clip sits over the still, which stays as the layout element and
   as the fallback. Anyone who asked for less motion gets the still instead. */
.project__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .project__video {
    display: none;
  }
}

.project a:hover .project__media img {
  transform: scale(1.025);
}

.project__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.1rem;
  border-bottom: var(--rule);
}

.project__head .num {
  flex: none;
}

.project h3 {
  margin-bottom: 0.5rem;
}

.project__client {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.project__summary {
  color: var(--ink-2);
  max-width: 48ch;
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
}

.roles li {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.project__more {
  margin-top: 1.4rem;
}

/* A card that is not yet a page: same rhythm, no link affordance. */
.project--pending .project__media {
  display: grid;
  place-items: center;
  background: var(--paper-2);
}

/* ---------- grid of small works (case study 05) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.work-grid figure {
  min-width: 0;
}

.work-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper-2);
  border: var(--rule);
}

.work-grid figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: var(--rule);
}

.work-grid figcaption strong {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.work-grid figcaption span {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
}

.work-grid .span-2 {
  grid-column: span 2;
}

@media (max-width: 40rem) {
  .work-grid .span-2 {
    grid-column: auto;
  }
}

/* ---------- case study ---------- */
.cs-hero {
  padding-block: clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 2.5vw, 2.25rem);
}

.cs-hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.3vw, 3.1rem);
  max-width: 20ch;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.cs-hero__lead {
  max-width: 54ch;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.1rem clamp(1.25rem, 2.5vw, 2.25rem);
  padding-top: 1.1rem;
  margin-top: clamp(1.4rem, 2.5vw, 2rem);
  border-top: var(--rule);
}

/* Same definition grid without the leading rule, for use inside a column
   that already has one above it. */
.cs-meta--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.cs-meta dt {
  margin-bottom: 0.45rem;
}

.cs-meta dd {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.cs-meta ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.cs-block {
  padding-block: clamp(2rem, 3.5vw, 3rem);
}

.cs-block__head {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.7rem;
  margin-bottom: clamp(1.1rem, 2vw, 1.6rem);
  border-bottom: var(--rule);
}

@media (max-width: 40rem) {
  .cs-block__head {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }
}

.cs-body {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
}

.cs-body > .text-col {
  grid-column: 2;
}

@media (max-width: 40rem) {
  .cs-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-body > .text-col {
    grid-column: 1;
  }
}

.cs-body ul {
  padding-left: 1.1rem;
}

.cs-body li + li {
  margin-top: 0.45rem;
}

/* ---------- media figures ---------- */
figure.media {
  margin-block: clamp(1.4rem, 2.5vw, 2.25rem);
}

figure.media.media--flush {
  margin-block: 0;
}

figure.media img,
figure.media video {
  width: 100%;
  border: var(--rule);
  background: var(--paper-2);
}

figure.media figcaption {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-top: 0.8rem;
  margin-top: 0.8rem;
  border-top: var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}

figure.media figcaption p {
  max-width: 62ch;
}

figure.media figcaption .credit {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8125rem;
}

@media (max-width: 40rem) {
  figure.media figcaption {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
}

.media-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}

.media-pair figure.media {
  margin-block: 0;
}

/* Full-bleed sequence, edge to edge of the shell. */
.media-run {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(16rem, 1fr);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.75rem;
}

.media-run > * {
  scroll-snap-align: start;
}

/* A row of stills for a card that collects several activations. */
.poster-run {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  background: var(--line);
}

.poster-run img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

@media (max-width: 34rem) {
  .poster-run {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- placement spec grid ----------
   Artwork at wildly different aspect ratios, shown at a common height so the
   set reads as one system rather than a pile of images. */
.spec-set {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.spec-set figure {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.spec-set img {
  width: 100%;
  height: 7rem;
  object-fit: contain;
  background: var(--paper-3);
  border: var(--rule);
  padding: 0.4rem;
}

.spec-set figcaption {
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.spec-brand {
  padding-top: 1.1rem;
  margin-top: 1.1rem;
  border-top: var(--rule);
}

.spec-brand:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

/* ---------- neutral placeholder slot (draft only) ---------- */
.slot {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--paper-2);
  border: 1px dashed var(--line-2);
}

.slot--16x9 {
  aspect-ratio: 16 / 9;
}

.slot--4x3 {
  aspect-ratio: 4 / 3;
}

.slot--21x9 {
  aspect-ratio: 21 / 9;
}

.slot__what {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 34ch;
}

.slot__note {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 44ch;
}

/* ---------- next project ---------- */
.next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-top: var(--rule);
}

.next h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.7rem);
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
}

@media (max-width: 54rem) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-list {
  display: grid;
  gap: 0;
  margin: 0;
  list-style: none;
  padding: 0;
  border-top: var(--rule);
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.1rem;
  border-bottom: var(--rule);
}

.contact-list a {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.18rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  border-bottom: 1px solid transparent;
}

.contact-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- footer ---------- */
.site-foot {
  border-top: var(--rule);
  padding-block: 1.75rem 2.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-foot a:hover {
  color: var(--ink);
}

/* ---------- 404 ---------- */
.state {
  min-height: 60vh;
  display: grid;
  align-content: center;
  gap: 1rem;
}

/* ---------- motion ----------
   Scroll-driven reveal where supported; a no-op everywhere else. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 26%;
    }
    @keyframes reveal {
      from {
        opacity: 0;
        transform: translateY(1.25rem);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- print ---------- */
@media print {
  .site-head,
  .site-foot,
  .actions,
  .skip,
  .next {
    display: none;
  }
  body {
    background: #fff;
    font-size: 11pt;
  }
}
