/* self-hosted so visitors never hit Google (SIL OFL fonts, latin + latin-ext subsets from Google Fonts) */
@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-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: "Bricolage Grotesque";
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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: "JetBrains Mono";
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0f0e0d;
  --fg: #f3ece4;
  --muted: #8a8079;
  --line: rgba(243, 236, 228, 0.12);
  --orange: #ff6a1a;
  --logo: clamp(4.5rem, 19vw, 16rem);
  --h3: clamp(2rem, 4vw, 3rem);
  --pad: clamp(1.5rem, 5vw, 4rem);
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  padding: 0 var(--pad);
  position: relative;
  overflow-x: hidden;
}

/* warm glow */
body::before {
  content: "";
  position: fixed;
  inset: auto -20vmax -40vmax auto;
  width: 90vmax;
  height: 90vmax;
  background: radial-gradient(circle, rgba(255, 106, 26, 0.18), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--orange);
  padding-bottom: 2px;
  transition: color .2s;
}

a:hover, a:focus-visible { color: var(--orange); outline: none; }

.dot { color: var(--orange); }

/* header */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: var(--pad) 0 0;
  font-family: var(--mono);
  font-size: 0.95rem;
}

header .mark { border: 0; padding: 0; line-height: 0; }
header .mark img { width: 2.5rem; height: 2.5rem; }

nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
nav a { border-bottom-color: transparent; }
nav a:hover, nav a:focus-visible { border-bottom-color: var(--orange); }

/* hero */

.hero {
  min-height: calc(100svh - 2 * var(--pad) - 2.5rem);
  display: grid;
  align-content: center;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
}

h1 {
  font-size: var(--logo);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.055em;
  line-height: 0.85;
  color: var(--orange);
}

/* Even gaps between letters. Tracking alone can't do it: the narrowest ink gap
   between baseline and x-height (1/1000 em, opsz 96, wght 800, no kerning)
   runs from 51 to 73. Each letter's spacing brings the gap to its right to 18. */
.hero h1 { font-kerning: none; }
.hero h1 span:nth-child(1) { letter-spacing: -0.047em; } /* E|n  65 → 18 */
.hero h1 span:nth-child(2) { letter-spacing: -0.037em; } /* n|g  55 → 18 */
.hero h1 span:nth-child(3) { letter-spacing: -0.033em; } /* g|i  51 → 18 */
.hero h1 span:nth-child(4) { letter-spacing: -0.055em; } /* i|n  73 → 18 */
.hero h1 span:nth-child(5) { letter-spacing: -0.036em; } /* n|e  54 → 18 */
.hero h1 span:nth-child(6) { letter-spacing: -0.036em; } /* e|.  52 → 16 */
.hero h1 .period { color: var(--fg); }

.tagline {
  /* beside the g's descender, flush with the n */
  margin-top: calc(var(--logo) * -0.05);
  margin-left: calc(var(--logo) * 1.75);
  white-space: nowrap;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.35;
}

.heart { color: var(--orange); }

.intro {
  margin-top: clamp(2.5rem, 7vw, 5rem);
  max-width: 34ch;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-weight: 400;
  line-height: 1.3;
}

/* sections */

section { padding: clamp(4rem, 10vw, 8rem) 0 0; scroll-margin-top: 1rem; }

h2 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.label {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* projects */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 5rem);
  list-style: none;
}

.projects li {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color .3s;
}

.projects li:hover { border-top-color: var(--orange); }

.projects .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; flex-wrap: wrap; }
/* line the tag's cap tops up with the title's (Bricolage cap top 0.17em, JetBrains Mono 0.8rem/1.5 cap top 0.304rem) */
.projects .head .label { text-align: right; margin-top: calc(var(--h3) * 0.17 - 0.304rem); }
@media (max-width: 34rem) { .projects .head .label { margin-top: 0; } }

h3 {
  font-size: var(--h3);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.04em;
  line-height: 1;
}

.projects p { color: var(--fg); opacity: 0.8; max-width: 44ch; font-size: 1.1rem; }

.projects .link { margin-top: auto; padding-top: 0.5rem; font-family: var(--mono); font-size: 0.95rem; }
.projects .link a { display: inline-block; }

/* about */

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(2rem, 5vw, 5rem);
}

.about p { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 40ch; }
.about p + p { margin-top: 1em; color: var(--muted); }

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 2rem;
  align-content: start;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 1.1rem;
}

dt { padding-top: 0.2rem; }

/* contact */

.email {
  font-size: clamp(2rem, 7vw, 5rem);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.04em;
  line-height: 1.1;
  border-bottom-width: 3px;
  overflow-wrap: anywhere;
}

/* footer */

footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: clamp(5rem, 12vw, 9rem);
  padding: 1.5rem 0 var(--pad);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

footer a { color: var(--muted); border-bottom-color: var(--line); }
footer a:hover, footer a:focus-visible { color: var(--orange); border-bottom-color: var(--orange); }

/* legal pages */

.legal { max-width: 44rem; padding-top: clamp(4rem, 10vw, 7rem); }
.legal h1 { font-size: clamp(3rem, 9vw, 6rem); color: var(--fg); letter-spacing: -0.045em; }
.legal .updated { margin: 1.5rem 0 3rem; }
.legal h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 2.5rem 0 0.75rem; }
.legal p, .legal li { font-size: 1.1rem; color: rgba(243, 236, 228, 0.85); }
.legal p + p { margin-top: 0.9em; }
.legal ul { margin: 0.75rem 0 0 1.25rem; }
.legal li + li { margin-top: 0.4rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

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