/* matthewmckenzie.co.za
   Ported from the Claude Design canvas source. Every declaration below that
   carries a design value is transcribed from that source unchanged; the inline
   style attributes it shipped with are simply hoisted into rules here so the
   two pages can share one cacheable stylesheet.
   Additions on top of the design are marked "not in the design source". */

/* ---------- fonts ---------- */
/* Metrophobic: Google's latin subset, self-hosted. SIL OFL 1.1. */
@font-face {
  font-family: Metrophobic;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/metrophobic-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;
}
/* Geist, pinned to weight 700 and subset to the six glyphs of "STRKR." (896 bytes). */
@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/geist-strkr.woff2") format("woff2");
  unicode-range: U+002E, U+004B, U+0052, U+0053, U+0054;
}

/* ---------- tokens ---------- */
:root {
  --bg: #ffffff; --band: #f5f5f7; --card: #ffffff; --panel: #d9d9d9; --chip: #e8e8e8;
  --ink: #000000; --ink-soft: rgba(0, 0, 0, .55);
  --glow: rgba(214, 208, 208, .25); --glow-soft: rgba(214, 208, 208, .10);
  --crease: #dcdcdf; --crease-shadow: rgba(0, 0, 0, .10); --hair: rgba(0, 0, 0, .05);
  --pill: #ececec; --ghost: #ffffff; --inv: 0;
  --np: clamp(5px, .36vw, 7px); --tp: clamp(5px, .36vw, 7px);
  --hero-f: clamp(32px, 6.667vw, 128px);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --shadow-float: -5px -5px 50px 20px var(--glow-soft), 5px 5px 50px 20px var(--glow-soft), 0 1px 2px var(--hair);
}
[data-theme="dark"] {
  --bg: #09090a; --band: #0f0f11; --card: #161618; --panel: #1b1b1f; --chip: #26262b;
  --ink: #f2f2f4; --ink-soft: rgba(242, 242, 244, .6);
  --glow: rgba(0, 0, 0, .55); --glow-soft: rgba(0, 0, 0, .35);
  --crease: #2a2a2f; --crease-shadow: rgba(0, 0, 0, .7); --hair: rgba(255, 255, 255, .06);
  --pill: #2d2d33; --ghost: rgba(255, 255, 255, .13); --inv: 1;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Metrophobic, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .55s var(--ease), color .55s var(--ease);
  scroll-behavior: smooth;
}
a { color: var(--ink); text-decoration: none; transition: opacity .3s ease, transform .3s ease; }
a:hover { color: var(--ink); opacity: .72; }
img { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* Not in the design source: keyboard affordances. The design defines hover
   states only, which leaves keyboard users with no visible focus at all. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  box-shadow: var(--shadow-float);
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); opacity: 1; }

/* ---------- page shell ---------- */
#mm {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: clip;
}

/* ---------- header ---------- */
#mm-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: clamp(12px, 1.1vw, 20px) clamp(14px, 2.2vw, 42px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

[data-r="burger"] {
  justify-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-float);
}
[data-r="burger"] i {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .4s var(--ease), opacity .25s ease;
}

[data-r="navpill"] {
  display: none;
  grid-column: 2;
  padding: var(--np);
  border-radius: 999px;
  background: var(--card);
  font-size: clamp(15px, 1.875vw, 30px);
  box-shadow: var(--shadow-float);
}
#mm-navinner { position: relative; display: flex; align-items: center; }
#mm-pill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 999px;
  background: var(--pill);
  transition: transform .5s cubic-bezier(.34, 1.26, .44, 1), width .5s cubic-bezier(.34, 1.26, .44, 1);
  z-index: 0;
}
[data-navlink] {
  position: relative;
  z-index: 1;
  opacity: 1;
  padding: .32em .9em;
  line-height: 1.22;
  border-radius: 999px;
}

#mm-toggle {
  justify-self: end;
  grid-column: 3;
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--tp);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-float);
}
#mm-knob {
  position: absolute;
  top: var(--tp); bottom: var(--tp); left: var(--tp);
  width: calc(50% - var(--tp));
  border-radius: 999px;
  background: var(--pill);
  transition: transform .45s cubic-bezier(.34, 1.32, .46, 1);
  z-index: 0;
}
#mm-sun, #mm-moon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 2.6vw, 50px);
  height: clamp(44px, 2.6vw, 50px);
  border-radius: 999px;
}
#mm-sun img, #mm-moon img {
  object-fit: contain;
  filter: invert(var(--inv));
  transition: opacity .4s ease, filter .55s ease;
}
#mm-sun img { width: 52%; height: 52%; }
#mm-moon img { width: 50%; height: 50%; }

/* ---------- mobile sheet ---------- */
[data-r="sheet"] {
  position: fixed;
  top: 82px; left: 12px; right: 12px;
  z-index: 59;
  padding: 8px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 24px 60px -20px var(--crease-shadow), 0 1px 2px var(--hair);
  opacity: 0;
  transform: translateY(-14px) scale(.98);
  pointer-events: none;
  transition: opacity .38s var(--ease), transform .38s var(--ease);
}
[data-sheetlink] {
  display: block;
  padding: 16px 20px;
  border-radius: 22px;
  font-size: 21px;
}

/* ---------- hero ---------- */
#home {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(110px, 12vh, 180px) clamp(18px, 3vw, 60px) clamp(60px, 9vh, 120px);
  scroll-margin-top: 0;
}
.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1920px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 40px);
  font-size: var(--hero-f);
}
[data-r="greetwrap"] {
  margin: 0;
  line-height: 1;
  animation: mmRise .9s cubic-bezier(.22, 1, .36, 1) both;
}
#mm-greet {
  display: inline-block;
  line-height: 1;
  letter-spacing: -.01em;
  transition: transform .85s cubic-bezier(.34, 1.4, .5, 1), opacity .55s ease;
}
#mm-stage {
  position: relative;
  z-index: 2;
  max-width: 100%;
  perspective: 1900px;
  perspective-origin: 50% 44%;
  animation: mmPop 1s cubic-bezier(.22, 1, .36, 1) .12s both;
}
#mm-glow {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  border-radius: .39em;
  box-shadow: -10px -10px 100px 50px var(--glow), 10px 10px 100px 50px var(--glow);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  pointer-events: none;
}
#mm-float {
  position: relative;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  will-change: transform;
}
#mm-box {
  position: relative;
  width: 2em; height: 1.52em;
  will-change: transform, width;
}
.hero-card {
  position: absolute;
  inset: 0;
  border-radius: .39em;
  background: var(--card);
  box-shadow: 0 1px 2px var(--hair);
}
[data-face] { position: absolute; inset: 0; }
[data-face="a"] { z-index: 2; }
[data-face="b"] { z-index: 1; }
.hero-facein {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: .39em;
  padding: 0 .47em;
}
[data-t], #mm-ruler {
  display: block;
  white-space: nowrap;
  line-height: 1.05;
  letter-spacing: -.01em;
}
#mm-ruler {
  position: absolute;
  left: 0; top: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- section divider ---------- */
.crease {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--crease) 8%, var(--crease) 92%, transparent);
  box-shadow: 0 8px 22px -10px var(--crease-shadow);
}

/* ---------- projects ---------- */
#projects { scroll-margin-top: clamp(80px, 8vw, 120px); }
.section-title {
  margin: 0;
  padding: clamp(48px, 4.2vw, 80px) clamp(18px, 3vw, 60px) clamp(40px, 3.6vw, 70px);
  text-align: center;
  font-weight: 400;
  font-size: var(--hero-f);
  line-height: 1;
  letter-spacing: -.01em;
}
.band {
  background: var(--band);
  padding: clamp(44px, 4.4vw, 84px) clamp(18px, 5.8vw, 112px) clamp(56px, 6vw, 116px);
  transition: background-color .55s var(--ease);
}
[data-r="grid"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 3.33vw, 64px) clamp(28px, 3.33vw, 64px);
  max-width: 1700px;
  margin: 0 auto;
}
[data-card] { display: flex; flex-direction: column; gap: clamp(10px, .83vw, 16px); }
.card-title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(19px, 1.667vw, 32px);
  line-height: 1.2;
}
[data-media] {
  position: relative;
  aspect-ratio: 27 / 20;
  border-radius: clamp(16px, 1.25vw, 24px);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 2px 8px -2px var(--crease-shadow);
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
}
[data-media] img {
  width: 100%; height: 100%;
  object-fit: cover;
}
[data-shade] {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .26);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease);
}
[data-meta] {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, .73vw, 14px);
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .7em 1.15em;
  border-radius: clamp(10px, .78vw, 15px);
  background: var(--chip);
  font-size: clamp(15px, 1.15vw, 22px);
  line-height: 1.2;
}
.chip img { width: 1.2em; height: 1.2em; filter: invert(var(--inv)); }

/* Not in the design source: the sixth card has no project behind it yet, so it
   renders as a labelled placeholder rather than an empty panel. */
.card-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.15vw, 22px);
  letter-spacing: .04em;
}

/* ---------- connect ---------- */
#connect {
  padding-top: clamp(70px, 10vw, 190px);
  scroll-margin-top: clamp(80px, 8vw, 120px);
}
[data-r="panel"] {
  background: var(--panel);
  border-radius: clamp(28px, 5.2vw, 100px) clamp(28px, 5.2vw, 100px) 0 0;
  padding: clamp(38px, 4.2vw, 80px) clamp(20px, 3.8vw, 73px) clamp(30px, 3.4vw, 64px);
  opacity: 0;
  /* Shorter travel and a fast back-out overshoot, so the panel pops into place.
     The design's 1.05s slide ran long enough that it compounded with the user's
     own scrolling and read as drifting past, then settling. */
  transform: translateY(clamp(28px, 4.5vh, 64px));
  transition: background-color .55s var(--ease),
              transform .42s cubic-bezier(.34, 1.56, .64, 1),
              opacity .28s var(--ease);
}
.panel-title {
  margin: 0 0 clamp(26px, 2.6vw, 50px);
  font-weight: 400;
  font-size: clamp(26px, 6.667vw, 128px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ghost);
  overflow-wrap: anywhere;
}
[data-r="footrow"] {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: center;
  gap: clamp(18px, 2.3vw, 44px);
}
[data-r="social"] { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 30px); }
[data-r="social"] a { display: block; transition: transform .44s cubic-bezier(.34, 1.32, .46, 1), opacity .3s ease; }
[data-r="social"] img {
  width: clamp(46px, 4.17vw, 80px);
  height: clamp(46px, 4.17vw, 80px);
  filter: invert(var(--inv));
}
[data-r="touch"] { font-size: clamp(22px, 2.5vw, 48px); line-height: 1.2; text-align: center; }
[data-r="logo"] {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, .5vw, 10px) clamp(12px, .9vw, 17px);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 1px 2px var(--hair);
  transition: transform .44s cubic-bezier(.34, 1.32, .46, 1), box-shadow .44s var(--ease), opacity .3s ease;
}
[data-r="logo"] span:first-child {
  font-family: Geist, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.33vw, 64px);
  line-height: 1.25;
  letter-spacing: -.02em;
  color: #000000;
}
[data-shine] {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 42%;
  background: linear-gradient(100deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, .13) 50%, rgba(0, 0, 0, 0) 90%);
  transform: translateX(-160%) skewX(-18deg);
  pointer-events: none;
}

/* ---------- prose (about page) ---------- */
/* The fixed header overlaps the first section, and .section-title's own top
   padding is smaller than the header is tall at narrow widths. */
#about { padding-top: clamp(46px, 5vh, 80px); scroll-margin-top: clamp(80px, 8vw, 120px); }

/* Not in the design source. Built from the same tokens so the second page reads
   as part of the same site. */
.prose {
  max-width: 78ch;
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 60px) clamp(56px, 6vw, 116px);
  font-size: clamp(17px, 1.15vw, 22px);
  line-height: 1.65;
}
.prose h2 {
  margin: clamp(38px, 3.4vw, 64px) 0 clamp(12px, 1vw, 20px);
  font-weight: 400;
  font-size: clamp(24px, 2.5vw, 48px);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.prose h3 {
  margin: clamp(24px, 2vw, 36px) 0 clamp(8px, .7vw, 14px);
  font-weight: 400;
  font-size: clamp(19px, 1.667vw, 32px);
  line-height: 1.2;
}
.prose p { margin: 0 0 1em; color: var(--ink-soft); }
.prose p strong { color: var(--ink); font-weight: 400; }
.prose a { text-decoration: underline; text-underline-offset: .18em; }
.prose ul { margin: 0 0 1.2em; padding-left: 1.1em; color: var(--ink-soft); }
.prose li { margin-bottom: .4em; }
.prose .lead { font-size: clamp(19px, 1.667vw, 30px); color: var(--ink); line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: clamp(8px, .73vw, 14px); margin: 0 0 1.4em; padding: 0; list-style: none; }
.tags li {
  margin: 0;
  padding: .55em 1.05em;
  border-radius: clamp(10px, .78vw, 15px);
  background: var(--chip);
  color: var(--ink);
  font-size: clamp(14px, 1.05vw, 19px);
  line-height: 1.2;
}

/* Terminal easter egg, recoloured onto the design's tokens. */
.terminal {
  margin: clamp(28px, 2.6vw, 48px) 0;
  border-radius: clamp(16px, 1.25vw, 24px);
  overflow: hidden;
  background: var(--band);
  box-shadow: 0 2px 8px -2px var(--crease-shadow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(13px, .9vw, 16px);
  line-height: 1.7;
}
.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--chip);
}
.terminal-bar i { display: block; width: 11px; height: 11px; border-radius: 999px; background: var(--crease); }
.terminal-body { padding: 16px clamp(16px, 1.5vw, 26px) 22px; overflow-x: auto; }
.terminal-body div { white-space: pre; }
.terminal .p { color: var(--ink-soft); }
.terminal .o { color: var(--ink); }

/* ---------- 404 ---------- */
.notfound {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 32px);
  padding: clamp(110px, 12vh, 180px) clamp(18px, 3vw, 60px) clamp(60px, 9vh, 120px);
  text-align: center;
}
.notfound h1 {
  margin: 0;
  font-weight: 400;
  font-size: var(--hero-f);
  line-height: 1;
  letter-spacing: -.01em;
}
.notfound p { margin: 0; color: var(--ink-soft); font-size: clamp(17px, 1.4vw, 26px); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .7em 1.4em;
  border-radius: clamp(10px, .78vw, 15px);
  background: var(--chip);
  font-size: clamp(16px, 1.15vw, 22px);
  line-height: 1.2;
}

/* ---------- animations ---------- */
@keyframes mmRise { from { opacity: 0; } to { opacity: 1; } }
@keyframes mmShine {
  from { transform: translateX(-160%) skewX(-18deg); }
  to { transform: translateX(260%) skewX(-18deg); }
}
@keyframes mmPop {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- interaction states ---------- */
[data-card]:hover [data-meta], [data-card]:focus-within [data-meta] { opacity: 1 !important; transform: translateY(0) !important; }
[data-card]:hover [data-media], [data-card]:focus-within [data-media] { transform: translateY(-5px) scale(.968) !important; box-shadow: 0 22px 46px -18px var(--crease-shadow) !important; }
[data-card]:hover [data-shade], [data-card]:focus-within [data-shade] { opacity: 1 !important; }
[data-r="social"] a:hover { opacity: .92; transform: translateY(-4px) scale(1.07); }
[data-r="social"] a:active { transform: translateY(-1px) scale(.96); }
[data-r="logo"]:hover { opacity: 1; transform: translateY(-3px); box-shadow: 0 16px 34px -16px var(--crease-shadow); }
[data-r="logo"]:active { transform: translateY(-1px) scale(.986); }
[data-r="logo"]:hover [data-shine] { animation: mmShine 1s var(--ease); }
[data-r="panel"][data-in="true"] { transform: none !important; opacity: 1 !important; }
[data-r="grid"][data-always="true"] [data-meta] { opacity: 1 !important; transform: none !important; }
[data-r="burger"][data-open="true"] i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
[data-r="burger"][data-open="true"] i:nth-child(2) { opacity: 0; }
[data-r="burger"][data-open="true"] i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
[data-r="sheet"][data-open="true"] { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }

/* ---------- breakpoints ---------- */
@media (min-width: 860px) {
  [data-r="burger"], [data-r="sheet"] { display: none !important; }
  [data-r="navpill"] { display: block !important; }
  [data-r="greetwrap"] {
    position: absolute;
    left: clamp(24px, 9.4vw, 180px);
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 2;
  }
  [data-r="grid"] { grid-template-columns: repeat(2, 1fr) !important; }
  [data-r="footrow"] {
    grid-template-columns: 1fr auto 1fr !important;
    justify-items: stretch !important;
    gap: clamp(20px, 2.3vw, 44px);
  }
  [data-r="footrow"] [data-r="social"] { justify-self: start; }
  [data-r="footrow"] [data-r="touch"] { justify-self: center; }
  [data-r="footrow"] [data-r="logo"] { justify-self: end; }
}
@media (min-width: 1200px) {
  [data-r="grid"] { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (hover: none) {
  [data-meta] { opacity: 1 !important; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html, body { scroll-behavior: auto; }
}
