/* ---------- Fonts ----------
   Free, open-licensed (SIL OFL) stand-ins for Calibre (Hanken Grotesk) and Signifier (Source Serif 4), hosted
   with the site; IBM Plex Mono comes from Google Fonts. size-adjust scales each one so it takes up the same space as the original it replaces. */
@font-face { font-family: "Body Sans"; font-style: normal; font-weight: 300 700; font-display: swap; size-adjust: 87%; src: url("assets/fonts/hanken-grotesk.woff2") format("woff2"); }
@font-face { font-family: "Body Sans"; font-style: italic; font-weight: 300 700; font-display: swap; size-adjust: 87%; src: url("assets/fonts/hanken-grotesk-italic.woff2") format("woff2"); }
@font-face { font-family: "Accent Serif"; font-style: normal; font-weight: 200 400; font-display: swap; size-adjust: 103%; src: url("assets/fonts/source-serif-4.woff2") format("woff2"); }
@font-face { font-family: "Accent Serif"; font-style: italic; font-weight: 200 400; font-display: swap; size-adjust: 103%; src: url("assets/fonts/source-serif-4-italic.woff2") format("woff2"); }
/* Arial Narrow look: Liberation Sans Narrow, an open-licensed copy drawn to the same shapes and widths. It always loads
   from the site (never from the visitor's computer, where the name "Arial Narrow" can point to a wider font), so
   every computer sees the same narrow type */
@font-face { font-family: "Site Narrow"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/liberation-sans-narrow.woff2") format("woff2"); }
/* Libre Baskerville (SIL OFL): the serif for the homepage headline */
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/libre-baskerville.woff2") format("woff2"); }
@font-face { font-family: "Libre Baskerville"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/libre-baskerville-italic.woff2") format("woff2"); }

/* ---------- Design tokens (from Figma "Frame 2055247257") ----------
   Change a value here to update it everywhere. */
:root {
  /* color */
  --bg: #e4e5d2;
  --ink: #000;
  --type-ink: #2a2a2a;
  --nav-ink: #090909;
  --muted: #939393;
  --about-ink: #817d7a;
  --card-text: #6c6c6c;
  --tag: #adab9b;
  --image-border: #d9d9d9;

  /* type */
  --font-mono: "IBM Plex Mono", "Courier New", monospace; /* IBM Plex Mono Light (300) from Google Fonts */
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Accent Serif", Georgia, serif;
  --font-body: "Body Sans", system-ui, sans-serif;

  /* radius */
  --radius: 2px;

  /* spacing */
  --pad-top: 72px;
  --pad-bottom: 120px;
  --pad-x: 64px;
  --hero-gap: 82px;        /* nav → content */
  --nav-width: 55px;
  --nav-gap: 16px;
  --hero-height: 380px;
  --item-gap: 24px;        /* [n] → text */
  --items-gap: 48px;       /* between hero items */
  --section-gap: 104px;    /* hero → cards */
  --row-gap: 24px;
  --card-media-h: 364px;
}

/* Soft fade between pages, e.g. home → case study (supported browsers) */
@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { position: relative; margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
p, h1, h2 { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.page { position: relative; max-width: 1552px; margin: 0 auto; padding: var(--pad-top) var(--pad-x) var(--pad-bottom); }

/* ---------- Linen paper texture behind the hero ----------
   Recreated in CSS: fine horizontal laid lines, faint vertical chain lines, soft mottling and pale flecks
   on warm cream, fading into the page color below. */
.hero-texture {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--pad-top) + var(--hero-height) + 90px);
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='1' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 .98 7 0 0 0 -6.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgb(150 128 86 / .055) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(150 128 86 / .045) 0 1px, transparent 1px 96px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.005 .018' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .52 0 0 0 0 .32 0 0 0 .45 -.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E"),
    #ede6d2;
  -webkit-mask: linear-gradient(#000 72%, transparent);
          mask: linear-gradient(#000 72%, transparent);
}

/* ---------- Hero: nav | numbered items + about ---------- */
.hero { position: relative; display: flex; gap: var(--hero-gap); align-items: flex-start; }

.nav { flex: none; width: var(--nav-width); display: flex; flex-direction: column; align-items: flex-start; gap: var(--nav-gap); font: 300 14px/normal var(--font-mono); text-transform: uppercase; color: var(--nav-ink); }
.nav a { white-space: nowrap; }
.nav a:hover, .nav a:focus-visible { font-style: italic; }

.hero-content { flex: 1 1 0; min-width: 0; height: var(--hero-height); display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 64px; }
.hero-items { flex: 1 1 auto; width: 100%; max-width: 1049px; align-self: flex-start; display: flex; flex-direction: column; gap: var(--items-gap); }
.hero-row { display: flex; justify-content: space-between; gap: 32px; }
.hero-item { display: flex; gap: var(--item-gap); font: 300 14px/normal var(--font-mono); text-transform: uppercase; color: var(--type-ink); }
.hero-num { flex: none; }

.hero-about { width: 346px; max-width: 100%; display: flex; flex-direction: column; gap: 17px; text-align: right; font: 400 14px/normal var(--font-body); color: var(--about-ink); }

/* ---------- Contents (case-study cards) ---------- */
.contents { position: relative; display: flex; flex-direction: column; gap: var(--row-gap); margin-top: var(--section-gap); scroll-margin-top: 40px; }
.contents-row { display: flex; gap: var(--row-gap); align-items: flex-start; }
.contents-row--center { align-items: center; }

/* Card widths keep Figma's proportions (787 / 613 and 846 / 554 at full width) */
.card--apartments { flex: 0 0 calc((100% - var(--row-gap)) * 787 / 1400); }
.card--notion     { flex: 0 0 calc((100% - var(--row-gap)) * 846 / 1400); }
.card--ibm, .card--microsoft { flex: 1 1 0; }

.card { display: flex; gap: 16px; min-width: 0; padding: 8px; border-radius: var(--radius); }
.card--notion { padding: 0; }
.card--microsoft { gap: 21px; }
.card:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }

.card-info { flex: none; width: 178px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.card--notion .card-info { width: 227px; height: var(--card-media-h); }
.card-title { font: 300 14px/normal var(--font-mono); text-transform: uppercase; color: var(--ink); }
.card--apartments .card-title { font-size: 16px; }
.card-desc { font: 400 14px/normal var(--font-body); color: var(--card-text); }

/* Hover lift, scale and press are springs in motion.js; this adds the soft border-glow */
.card-photo { flex: 1 1 0; min-width: 0; }
.card-media { height: var(--card-media-h); overflow: hidden; border: .5px solid var(--image-border); border-radius: var(--radius); }
.card--apartments .card-media { height: 380px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cursor dot (see cursor-dot.js) ---------- */
.cursor-dot {
  position: fixed; left: 0; top: 0; z-index: 3000; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: #6aa312; pointer-events: none;
  opacity: 0; transition: opacity .2s ease;
}
.cursor-dot.is-visible { opacity: 1; }
.cursor-smoke { position: fixed; inset: 0; z-index: 2999; width: 100vw; height: 100vh; pointer-events: none; }
@media (pointer: coarse) { .cursor-dot { display: none; } }
body.is-soon .cursor-dot, body.is-soon .cursor-smoke { opacity: 0 !important; transition: none; }

/* ---------- "Coming (very) soon" pill for unfinished case studies (see coming-soon.js) ---------- */
[data-soon] { cursor: default; }
/* With a mouse, the pill replaces the pointer entirely while it is over the card */
@media (pointer: fine) { [data-soon], [data-soon] *, [data-cursor], [data-cursor] * { cursor: none; } }
.soon-pill {
  position: fixed; left: 0; top: 0; z-index: 3001; padding: 2px 9px; border-radius: 20px; pointer-events: none;
  background: #000; color: #eae2d6; font: 400 12px/normal var(--font-body); white-space: nowrap;
  opacity: 0; will-change: transform; transition: opacity .15s ease;
}
.soon-pill.is-visible { opacity: 1; }
/* "View project" / "View website" on the home cards (coming-soon.js): the About page's photo caption, a lime square at the
   pointer's tip with the words beside it, in place of the cursor circle */
.cursor-label {
  position: fixed; left: 0; top: 0; z-index: 3001; display: flex; align-items: center; gap: 10px; padding: 2px 8px; pointer-events: none;
  font: 400 14px/normal "Site Narrow", "Arial Narrow", sans-serif; color: #fff; white-space: nowrap;
  opacity: 0; will-change: transform; transition: opacity .2s ease;
}
.cursor-label img { flex: none; display: block; }
.cursor-label.is-dark { color: #000; }
.cursor-label.is-visible { opacity: 1; }
body.is-labelled .cursor-dot, body.is-labelled .cursor-smoke { opacity: 0 !important; transition: none; }
@media (pointer: coarse) { .cursor-label { display: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  :root { --pad-x: 48px; --hero-gap: 48px; }
  .contents-row, .contents-row--center { flex-direction: column; align-items: stretch; }
  .card--apartments, .card--ibm, .card--notion, .card--microsoft { flex: none; }
}
@media (max-width: 860px) {
  :root { --pad-top: 32px; --pad-x: 16px; --pad-bottom: 80px; --section-gap: 64px; --hero-height: auto; }
  .hero-texture { height: 760px; }
  .hero { flex-direction: column; gap: 40px; }
  .nav { width: auto; flex-direction: row; gap: 20px; }
  .hero-content { gap: 40px; }
  .hero-row { flex-direction: column; gap: var(--items-gap); }
  .hero-about { width: auto; text-align: left; align-self: stretch; }
  .card, .card--notion { flex-direction: column; gap: 16px; padding: 0; }
  .card-info, .card--notion .card-info { width: auto; height: auto; gap: 8px; text-align: left; }
  .card-media, .card--apartments .card-media { height: auto; aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Big screens (up to 25"+ monitors): the layout is designed at about 1,550px wide, so wider
   screens scale the whole page up in steps instead of leaving it small in the corner. The cursor, its
   trail and pop-up notes stay unscaled so they sit exactly on the pointer. ---------- */
@media (min-width: 1700px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.1; } }
@media (min-width: 1900px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.22; } }
@media (min-width: 2100px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.35; } }
@media (min-width: 2300px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.48; } }
@media (min-width: 2500px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.6; } }
@media (min-width: 2800px) { body > :not(.cursor-dot, .cursor-smoke, .cs-copied, .soon-pill, .cursor-label, dialog, script) { zoom: 1.8; } }

