:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #7a7a7a;
  --line: #e6e6e6;
  --surface: #f2f2f2;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 10.5vw, 213px);
  --gap: 13px;
  --radius: 8px;
}

/* Desktop: side margins are 12% of the screen width on every page */
@media (min-width: 960px) {
  :root { --gutter: min(12vw, 260px); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { padding: 0 var(--gutter); }

/* Header */
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 44px; padding-bottom: 20px;
}
.brand { position: relative; padding-left: .95em; font-family: "Comfortaa", var(--sans); font-weight: 500; font-size: 18px; letter-spacing: 0; }
/* The 4a sun mark, turned 45deg counter-clockwise, sits at the upper left of the wordmark, as in the design reference:
   its stroke box starts 17.9px left of / 13.2px above the S (at 18px type) and its left edge is the page's left edge */
.brand-logo { position: absolute; left: -.103em; top: -.69em; width: 1.86em; height: auto; transform: rotate(-45deg); transform-origin: 50% 94%; pointer-events: none; }
.nav { display: flex; gap: 22px; font-family: "Comfortaa", var(--sans); font-weight: 500; font-size: 14px; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { padding: clamp(56px, 9vw, 130px) 0 clamp(48px, 5vw, 80px); }
.hero h1 {
  font-family: "Comfortaa", var(--sans); font-weight: 500;
  font-size: clamp(26px, 2.7vw, 38px); line-height: 1.3; letter-spacing: 0;
  max-width: 34ch; text-wrap: balance;
}

/* Project grid */
.grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 800px) { .grid { grid-template-columns: 1fr 1fr; } }

/* Tile height is fixed to what it was with the old 5% side margins (7:5 at that width).
   The tiles are now narrower, so the images are cropped left and right and the mockups keep their size. */
:root {
  --tile-h: calc((100vw - 2 * clamp(20px, 5vw, 100px)) * 5 / 7);
}
@media (min-width: 800px) {
  :root { --tile-h: calc((100vw - 2 * clamp(20px, 5vw, 100px) - clamp(12px, 1vw, 18px)) / 2 * 5 / 7); }
}
.tile {
  position: relative; display: block; overflow: hidden;
  height: var(--tile-h); border-radius: var(--radius); background: var(--surface);
}
.tile .art { width: 100%; height: 100%; object-fit: cover; }
.tile .art > svg { width: 100%; height: 100%; }

/* Hover overlay: company name + discipline, tinted with the project colour */
.overlay {
  position: absolute; inset: 0; padding: clamp(20px, 3.6vw, 56px);
  background: color-mix(in srgb, var(--tint) 88%, transparent);
  color: #fff; display: flex; flex-direction: column; gap: 6px;
  opacity: 0; transition: opacity .3s ease;
}
.overlay .name { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
.overlay .tags { font-size: 14px; font-weight: 500; }
.tile:hover .overlay, .tile:focus-visible .overlay { opacity: 1; }

/* Touch devices can't hover: show the name under the image instead */
.caption { display: none; }
@media (hover: none) {
  .overlay { display: none; }
  .caption { display: block; padding: 10px 2px 4px; }
  .caption .name { font-family: var(--serif); font-size: 18px; }
  .caption .tags { color: var(--muted); font-size: 13px; }
  .item { display: block; }
}

/* Footer (identical on every page) */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(32px, 5vw, 64px); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer .row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--ink); }
.socials { display: flex; gap: 14px; align-items: center; }
.socials a { display: inline-flex; padding: 4px; margin: -4px; }
.socials svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.socials a:hover svg { stroke: var(--ink); }
@media (max-width: 700px) {
  .site-footer .row { flex-direction: column; gap: 14px; }
  .socials { justify-content: center; }
}

/* Case study */
.cs-hero { padding: clamp(40px, 7vw, 96px) 0 32px; }
.cs-hero .back { color: var(--muted); font-size: 14px; }
.cs-hero .back:hover { color: var(--ink); }
.cs-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.1; letter-spacing: -0.01em; margin: 20px 0 16px; max-width: 18ch; }
.cs-hero p.sub { color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); max-width: 52ch; }
.cs-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 24px 0; border-block: 1px solid var(--line); margin: 40px 0; }
.cs-facts dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cs-facts dd { margin-top: 4px; }
@media (min-width: 800px) { .cs-facts { grid-template-columns: repeat(4, 1fr); } }
.cs-cover, .cs-figure { border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cs-cover { aspect-ratio: 16 / 9; }
.cs-figure { aspect-ratio: 7 / 5; }
.cs-cover > svg, .cs-figure > svg { width: 100%; height: 100%; }
.cs-block { display: grid; gap: 14px; padding: clamp(36px, 5vw, 72px) 0; }
.cs-block h2 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.cs-block p { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; max-width: 60ch; }
@media (min-width: 900px) { .cs-block { grid-template-columns: 1fr 2fr; gap: 48px; } }
.cs-figures { display: grid; gap: var(--gap); }
@media (min-width: 800px) { .cs-figures.two { grid-template-columns: 1fr 1fr; } }
.cs-figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.next { display: block; padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); }
.next small { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.next h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 64px); letter-spacing: -0.01em; margin-top: 6px; transition: opacity .2s; }
.next:hover h2 { opacity: .55; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .overlay { transition: none; }
}

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

.intro { position: relative; padding: clamp(40px, 6vw, 84px) 0 clamp(40px, 5vw, 64px); }
.intro::before, .intro::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(56px); opacity: 1;
}
/* Glow colours: a deeper pink centre (#F9DCDC) fading out to #FEF5F5, and a much paler, translucent take on #63AE8C (#D8EBE2 = 216, 235, 226) */
.intro::before { left: 4%; top: 6%; width: 46%; height: 72%; background: radial-gradient(circle, #F9DCDC 0%, rgba(252, 232, 232, .85) 45%, rgba(254, 245, 245, .6) 62%, transparent 78%); }
.intro::after  { left: 40%; top: 20%; width: 42%; height: 66%; background: radial-gradient(circle, rgba(216, 235, 226, .8) 0%, rgba(216, 235, 226, .45) 55%, transparent 75%); }
.intro p { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.45; max-width: 66ch; }
.intro p + p { margin-top: 1.7em; }

.about-section { padding-bottom: clamp(28px, 4vw, 56px); }
.about-section h2 { font-family: "Comfortaa", var(--sans); font-style: normal; font-weight: 500; font-size: clamp(18px, 1.7vw, 22px); margin-bottom: 14px; }

.cards { display: grid; grid-template-columns: 1fr; gap: 13px; align-items: start; }
@media (min-width: 600px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } }
/* Three staggered columns of equal height, so the block outlines a clean rectangle */
.cards > .col { display: contents; }
@media (min-width: 960px) {
  .cards { align-items: stretch; }
  .cards > .col { display: flex; flex-direction: column; gap: 13px; }
  .cards > .col > .card { flex: 0.75 0 auto; }
  .cards > .col > .card.tall { flex: 1.3333 0 auto; }
}

.card {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px;
  border: 1px solid var(--line);
  background: linear-gradient(var(--angle, 135deg), var(--a, #f7f6f3), var(--b, var(--a, #f7f6f3)));
  display: grid; place-items: center;
}

/* About footer */

.cs-hero .tags-line { font-size: 14px; font-weight: 500; margin-bottom: 14px; }

/* Real project images */
.tile .art > img { width: 100%; height: 100%; object-fit: cover; }
.cs-cover > img { width: 100%; height: 100%; object-fit: contain; }

/* Photo cards: show the whole photo, framed inside the card */
.card.photo { container-type: size; }
.card.photo > img { position: absolute; inset: 0; margin: auto; height: 86%; width: auto; max-width: 92%; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
/* The photo keeps its own ratio and always fits inside whatever frame the column gives it */
@supports (width: 1cqw) {
  .card.photo > img { aspect-ratio: var(--ar); width: min(92cqw, calc(86cqh * var(--ar))); height: auto; max-width: none; }
}


/* Portrait photos get a tall frame */
.card.tall { aspect-ratio: 3 / 4; }

/* One wide photo spans the full width under the columns */
.card.wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
