/* Thomas Stockx: tokens from the Thomas Stockx design system */

/* Self-hosted fonts (SIL Open Font License, see assets/fonts/OFL-*.txt).
   Figtree is a variable font covering 400–600; Fraunces is variable on optical size at weight 500. */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/figtree-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: "Figtree"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/figtree-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/fraunces-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: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/fraunces-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --surface-100: #faf6f0;
  --surface-200: #ffffff;
  --surface-300: #f0e9df;
  --line: #ddd3c6;
  --ink: #2b2420;
  --ink-muted: #6e6259;
  --clay: #9f4527;
  --on-clay: #ffffff;
  --clay-soft: #f3ded3;
  --sage: #4c6b55;
  --spark: #e8a317;
  --on-spark: #2b2420;

  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --container: 1120px;
  color-scheme: light;
}

/* Dark theme: follows the system setting unless the visitor picked a theme with the toggle
   (stored as data-theme on <html>). */
:root[data-theme="dark"] {
  --surface-100: #181513;
  --surface-200: #221e1b;
  --surface-300: #2c2723;
  --line: #3d3631;
  --ink: #f2ece4;
  --ink-muted: #b5a99c;
  --clay: #e3906d;
  --on-clay: #1b1512;
  --clay-soft: #3e2a22;
  --sage: #8fb69b;
  --spark: #f2b840;
  --on-spark: #1b1512;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-100: #181513;
    --surface-200: #221e1b;
    --surface-300: #2c2723;
    --line: #3d3631;
    --ink: #f2ece4;
    --ink-muted: #b5a99c;
    --clay: #e3906d;
    --on-clay: #1b1512;
    --clay-soft: #3e2a22;
    --sage: #8fb69b;
    --spark: #f2b840;
    --on-spark: #1b1512;
    color-scheme: dark;
  }
}

/* Images with a light and a dark version */
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}

/* Theme toggle: shows the moon in light mode, the sun in dark mode */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}
.theme-toggle:hover { background: var(--surface-300); border-color: var(--ink-muted); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.theme-toggle[hidden] { display: none; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--clay); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote { margin: 0; }
svg { flex-shrink: 0; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px;
  background: var(--clay); color: var(--on-clay);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  font-weight: 600; z-index: 10;
}
.skip-link:focus { top: var(--space-4); color: var(--on-clay); }

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--space-4); }

/* Type */
.display {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.08; letter-spacing: -1px;
}
.headline {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 3.5vw, 40px); line-height: 1.15; letter-spacing: -0.5px;
}
.title { font-size: 20px; line-height: 26px; font-weight: 600; }
.body-lg { font-size: 17px; line-height: 26px; }
.label { font-size: 14px; line-height: 20px; font-weight: 600; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.2px; }
.figure { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-md);
  font: 600 15px/1 var(--font-sans);
  text-decoration: none; cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}
.btn-primary { background: var(--clay); color: var(--on-clay); border: 0; }
.btn-primary:hover { color: var(--on-clay); filter: brightness(1.08); }
.btn-outline { min-height: 44px; padding: 0 18px; font-size: 14px; background: transparent; color: var(--ink); border: 1px solid var(--ink-muted); }
.btn-outline:hover { color: var(--ink); background: var(--surface-300); }

/* Tags */
.tag {
  display: inline-block; padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.tag-health { background: var(--sage); color: var(--surface-100); }
.tag-finance { background: var(--ink); color: var(--surface-100); }
.tag-agency, .tag-other { background: var(--clay-soft); color: var(--ink); }
.tag-games { background: var(--spark); color: var(--on-spark); }
.tag-research { background: var(--surface-300); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* Card */
.card { background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--radius-md); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: 20px; }
.brand { display: flex; align-items: center; gap: var(--space-4); text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 26px; letter-spacing: -0.25px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); }
.nav-links a:not(.btn) { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-links a:not(.btn):hover { color: var(--clay); }
@media (max-width: 560px) {
  .nav-links a:not(.btn) { display: none; }
  .brand { gap: 12px; }
  .nav-links { gap: var(--space-2); }
}
@media (max-width: 400px) {
  /* The hero's own call to action sits right below on small phones */
  .nav-links .btn-outline { display: none; }
  .brand img { width: 36px; height: 36px; }
  .brand span { font-size: 20px; }
}

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-block: 96px 80px; }
.hero-copy { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.hero-copy .body-lg { max-width: 560px; }
.hello { display: flex; align-items: center; gap: var(--space-4); }
.hello img { width: 72px; height: 72px; border-radius: var(--radius-full); }
.clients-me { display: flex; align-items: center; gap: 20px; padding-bottom: 24px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.clients-me img { width: 96px; height: 96px; border-radius: var(--radius-full); }
/* Desktop: the portrait heads the card on the right. Small screens: the card falls below the fold,
   so the greeting sits above the headline instead and the card starts with the clients. */
.hero-copy .hello-mobile { display: none; }
.hero { flex-wrap: nowrap; }
@media (max-width: 947px) { /* the hero card moves below the copy at the same point the portrait switches */
  .hero { flex-wrap: wrap; }
  .hero-copy .hello-mobile { display: flex; }
  .hero-copy .hero-eyebrow { display: none; }
  .clients-me { display: none; }
}
.hello-name { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 28px; letter-spacing: -0.25px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding-top: var(--space-2); }
.hero-actions .text-link { font-size: 15px; font-weight: 600; color: var(--ink); }
.clients { flex: 1 1 340px; min-width: 0; border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.clients li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 14px 0; border-bottom: 1px solid var(--line); }
.clients li:last-child { border-bottom: 0; }
.clients .text-link { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
@media (max-width: 720px) { .hero { padding-block: 56px 48px; gap: var(--space-10); } }

/* Highlights */
.highlights { background: var(--surface-300); }
.highlights ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6); padding-block: var(--space-10); }
.highlights li { display: flex; flex-direction: column; gap: var(--space-1); }
.highlights .label { font-weight: 400; color: var(--ink-muted); }

/* Sections */
.section { padding-block: 96px 48px; display: flex; flex-direction: column; gap: var(--space-10); }
.section-intro { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.section-intro .body-lg { color: var(--ink-muted); }
@media (max-width: 720px) { .section { padding-block: 64px 32px; } }

/* Featured projects */
.featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-6); }
.project { overflow: hidden; display: flex; flex-direction: column; }
.project-media { height: 240px; background: var(--surface-300); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.project-media .frame { height: 100%; background: #ffffff; border-radius: 10px; overflow: hidden; }
.media-inset { padding: 12px; }
.media-peek { padding: 12px 12px 0; }
.media-peek .frame { border-radius: 10px 10px 0 0; display: flex; justify-content: center; padding-top: 12px; }
.media-peek img { width: 188px; height: auto; align-self: flex-start; }
.media-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; }
.media-game img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); height: 130%; width: auto; max-width: none; }
.media-nda { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-muted); }
.project-body { padding: var(--space-6); display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.project-body .tag { align-self: flex-start; }
.project-body h3 { margin-top: var(--space-1); }
.project-body h3 .muted { font-weight: 500; }
.project-body > p { color: var(--ink-muted); flex-grow: 1; }
.facts { display: flex; gap: var(--space-6); padding-top: 12px; border-top: 1px solid var(--line); }
.facts .caption { color: var(--ink-muted); }
.facts .figure { white-space: nowrap; }

/* Project list */
.all-projects { display: flex; flex-direction: column; gap: var(--space-4); padding-top: 32px; }
.all-projects > .label { font-weight: 400; color: var(--ink-muted); margin-top: calc(var(--space-2) * -1); }
.project-list { border-top: 1px solid var(--line); }
.project-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: var(--space-2) 32px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line);
}
.project-row .when { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.project-row .when span:first-child { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.project-row .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.project-row .what strong { font-size: 17px; line-height: 24px; }
.project-row .what span { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
@media (max-width: 720px) {
  .project-row { grid-template-columns: minmax(0, 1fr); }
  .project-row .when { flex-direction: row; align-items: center; gap: 12px; }
}
.project-list.is-collapsed .project-row:nth-child(n + 9) { display: none; }
.toggle-projects { align-self: flex-start; }
.toggle-projects[hidden] { display: none; }

/* How I work */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-6); counter-reset: step; }
.step { padding: var(--space-6); display: flex; flex-direction: column; gap: 12px; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--clay-soft); color: var(--clay);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.step p { color: var(--ink-muted); }
#how { padding-bottom: 80px; }

/* Testimonials */
.testimonials { padding-top: 0; padding-bottom: 96px; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); }
.quote { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.quote blockquote { flex-grow: 1; }
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.quote figcaption img { width: 48px; height: 48px; border-radius: var(--radius-full); object-fit: cover; }
.quote figcaption div { display: flex; flex-direction: column; }
.quote figcaption strong { font-size: 15px; line-height: 22px; }

/* Contact */
.contact { background: var(--surface-200); border-block: 1px solid var(--line); }
.contact-inner { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: center; padding-block: 96px; }
.contact-intro { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.contact-intro img { width: 128px; height: 128px; border-radius: var(--radius-full); }
.contact-intro .body-lg { max-width: 520px; color: var(--ink-muted); }
.contact-text { display: flex; flex-direction: column; gap: 12px; }
.contact-card { flex: 1 1 400px; min-width: 0; background: var(--surface-100); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; display: flex; flex-direction: column; gap: var(--space-6); }
.contact-card .head { display: flex; flex-direction: column; gap: 12px; }
.contact-card .head p { color: var(--ink-muted); }
.contact-card .btn-primary { align-self: flex-start; max-width: 100%; }
.contact-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); padding-top: 20px; border-top: 1px solid var(--line); }
.contact-links a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; color: var(--ink); font-weight: 600; }
.contact-links a:hover { color: var(--clay); }
@media (max-width: 720px) {
  .contact-inner { padding-block: 64px; }
  .contact-card { padding: var(--space-6); }
}

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-10) 48px; }
.footer-brand { display: flex; align-items: flex-start; gap: var(--space-4); }
.footer-brand img { width: 32px; height: 32px; }
.footer-brand > div { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 22px; }
.footer-brand address { font-style: normal; font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: 0.2px; color: var(--ink-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.footer-links a { color: var(--ink-muted); }
.footer-links a:hover { color: var(--ink); }

/* Secondary tag: how the work came in (via an agency), quieter than the sector tag */
.tag-via { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-row .when .tag-via { margin-top: -2px; }
