/* ==========================================================================
   Rob Dougan — robertdougan.co.uk
   Vanilla CSS. Tokens first, then layout in document order.
   ========================================================================== */

:root {
  --paper:   #faf6ea; /* page background */
  --panel:   #f2ecdb; /* cards, rows */
  --panel-2: #efe9d7; /* nav pill hover, secondary button hover */
  --sunk:    #e7dfc9; /* tech chips, image placeholders, footer rule */
  --ink:     #16150f; /* text, dark button, dark card */
  --soft:    #55524a; /* secondary paragraph text */
  --mute:    #6a675c; /* mono metadata */
  --accent:  #2aa79b; /* teal: full stops, dots, primary button, one card */
  --r: 22px;          /* panel radius */

  --font-display: 'Bricolage Grotesque', Helvetica, Arial, sans-serif;
  --font-body: 'Hanken Grotesk', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

a:hover { color: var(--accent); }

::selection {
  background: var(--accent);
  color: var(--paper);
}

.accent { color: var(--accent); }
.soft { color: var(--soft); }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 60px;
}

/* Anchor targets clear the sticky header. */
#top,
#about,
#projects {
  scroll-margin-top: 72px;
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  background: var(--paper);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  transition: transform 120ms, background 120ms;
}

.nav-link:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.nav-link--say-hello {
  background: var(--ink);
  color: var(--paper);
}

.nav-link--say-hello:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding: clamp(36px, 7vw, 96px) 0 clamp(28px, 5vw, 56px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a4740;
  margin: 0 0 clamp(20px, 3vw, 34px);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(46px, 8.4vw, 116px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 4vw, 44px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
}

.btn-glyph { font-size: 14px; }

.btn-primary {
  background: var(--accent);
  color: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 120ms, box-shadow 120ms;
}

.btn-primary:hover {
  color: var(--paper);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-secondary {
  border: 1.5px solid var(--ink);
  transition: transform 120ms, background 120ms;
}

.btn-secondary:hover {
  color: var(--ink);
  background: var(--panel-2);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------- about -- */

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(14px, 2vw, 20px);
  padding-bottom: clamp(14px, 2vw, 20px);
}

.about-card {
  padding: clamp(24px, 3vw, 38px);
  border-radius: var(--r);
  background: var(--panel);
}

.about-card h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.about-card p {
  margin: 0 0 1em;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

.about-card p:last-child { margin-bottom: 0; }

.link-accent {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}

.about-stats {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: clamp(14px, 2vw, 20px);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px clamp(20px, 2.4vw, 28px);
  border-radius: var(--r);
  background: var(--panel);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-row--accent {
  background: var(--accent);
  color: var(--paper);
}

.stat-row--accent .stat-label {
  color: inherit;
  opacity: 0.75;
}

/* ------------------------------------------------------------- projects -- */

.projects,
.elsewhere {
  padding: clamp(36px, 6vw, 80px) 0 0;
}

.projects > h2,
.elsewhere > h2 {
  margin: 0 0 clamp(18px, 2.6vw, 28px);
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: clamp(20px, 2.6vw, 30px);
  border-radius: var(--r);
  background: var(--panel);
  transition: transform 140ms, box-shadow 140ms;
}

.project-card + .project-card {
  margin-top: clamp(14px, 2vw, 20px);
}

.project-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22, 21, 15, 0.10);
}

/* Placeholder block; the <img> covers it once a real screenshot is supplied. */
.project-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--r) - 8px);
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: var(--sunk);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(22, 21, 15, 0.06) 0 8px,
    transparent 8px 16px
  );
}

.project-thumb-caption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.project-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* No screenshot yet — fall back to the hatched block. */
.project-thumb-img:not([src]),
.project-thumb-img[src=""] {
  display: none;
}

.project-info h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-info p {
  margin: 0 0 0.9em;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
  text-wrap: pretty;
}

.project-info p.soft { margin-bottom: 20px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sunk);
}

/* ------------------------------------------------------------ elsewhere -- */

.elsewhere-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(12px, 1.6vw, 16px);
}

.tile {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(20px, 2.2vw, 26px);
  border-radius: var(--r);
  background: var(--panel);
  transition: transform 140ms, background 140ms;
}

.tile:hover {
  color: var(--ink);
  background: var(--panel-2);
  transform: translateY(-3px);
}

.tile-label {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile-glyph {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mute);
}

.tile--dark {
  background: var(--ink);
  color: var(--paper);
  transition: transform 140ms;
}

.tile--dark:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-3px);
}

.tile-glyph--faint {
  color: inherit;
  opacity: 0.7;
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(36px, 6vw, 80px);
  padding-top: 22px;
  border-top: 1.5px solid var(--sunk);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ----------------------------------------------------------- responsive -- */

/* Everything else collapses via auto-fit/minmax. The header is the one row
   that needs a hand at the narrow end. */
@media (max-width: 440px) {
  .main-nav { gap: 4px; }
  .nav-link { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .nav-link,
  .btn-primary,
  .btn-secondary,
  .project-card,
  .tile {
    transition: none;
  }

  .nav-link--say-hello:hover,
  .btn-primary:hover,
  .btn-primary:active,
  .btn-secondary:hover,
  .project-card:hover,
  .tile:hover,
  .tile--dark:hover {
    transform: none;
  }
}
