:root {
  --bg: #f6f5f1;
  --surface: #eeece6;
  --text: #1c1b19;
  --muted: #6b6860;
  --faint: #d9d6ce;
  --accent: #c2410c;
  --accent-soft: #c2410c1a;
  --pill: #f07a1a;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 2rem);
  --max: 64rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1b1b19;
    --text: #e9e7e1;
    --muted: #9a968c;
    --faint: #2c2b28;
    --accent: #f08a4b;
    --accent-soft: #f08a4b1f;
    --pill: #f59a52;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1b1b19;
  --text: #e9e7e1;
  --muted: #9a968c;
  --faint: #2c2b28;
  --accent: #f08a4b;
  --accent-soft: #f08a4b1f;
  --pill: #f59a52;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: .5rem .75rem;
  background: var(--text);
  color: var(--bg);
  z-index: 10;
}
.skip:focus { top: .75rem; }

/* header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.masthead.scrolled { border-bottom-color: var(--faint); }

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.75rem;
}

.mark {
  font: 700 1.125rem/1 var(--sans);
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.nav { display: flex; gap: 1.5rem; }
.nav a {
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover, .nav a.active { color: var(--text); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--faint);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* intro */

.intro {
  display: grid;
  align-content: start;
  padding-top: clamp(3rem, 10vw, 8.5rem);
  padding-bottom: clamp(3.5rem, 9vw, 6rem);
}

.portrait {
  display: block;
  width: 8rem;
  margin-bottom: 1.75rem;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.25rem;
  background: var(--surface);
}

@media (min-width: 48rem) {
  .intro { grid-template-columns: 1fr auto; column-gap: 3rem; }
  .intro > :not(.portrait) { grid-column: 1; }
  .portrait {
    grid-column: 2;
    grid-row: 1 / span 3;
    position: relative;
    align-self: stretch;
    width: clamp(13rem, 22vw, 16.5rem);
    margin: 0;
  }
  .portrait img {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
    object-position: 50% 30%;
    border-radius: 1.75rem;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.75rem;
  font: 400 .8125rem/1 var(--mono);
  color: var(--muted);
}
.dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: #3f9d5b;
  box-shadow: 0 0 0 3px #3f9d5b26;
}

h1 {
  font: 600 clamp(3rem, 9vw, 5.5rem)/0.95 var(--sans);
  letter-spacing: -0.045em;
}

.lede {
  max-width: 36rem;
  margin-top: 1.75rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  margin-top: 2.25rem;
  font-size: .9375rem;
}

.btn {
  display: inline-flex;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}
.btn:hover { background: var(--accent); color: #fff; }

/* sections */

.section {
  display: grid;
  gap: 2rem;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 1px solid var(--faint);
}

@media (min-width: 56rem) {
  .section { grid-template-columns: 19rem 1fr; gap: 3rem; }
  .label { white-space: nowrap; }
}

.label {
  font: 600 clamp(1.875rem, 4vw, 2.5rem)/1.05 var(--sans);
  letter-spacing: -0.035em;
}

.body { max-width: 42rem; }

.prose p + p { margin-top: 1.1em; }

h3 {
  font: 600 1.25rem/1.3 var(--sans);
  letter-spacing: -0.02em;
}

/* experience */

.when {
  margin: .3rem 0 .9rem;
  font: 400 .8125rem/1.5 var(--mono);
  color: var(--muted);
}

.bullets { margin-top: .85rem; display: grid; gap: .5rem; }
.bullets li {
  position: relative;
  padding-left: 1.1rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .75em;
  width: .45rem;
  height: 1px;
  background: var(--accent);
}

/* work */

.project {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--faint);
}
.project:first-child { padding-top: 0; }
.project:last-child { border-bottom: 0; padding-bottom: 0; }

.project h3 { margin-bottom: .6rem; }

.project h3 a { text-decoration: none; }
.project h3 a::after {
  content: "↗";
  display: inline-block;
  margin-left: .3rem;
  font: 400 .8em var(--sans);
  color: var(--muted);
  transition: transform .15s, color .15s;
}
.project h3 a:hover::after { color: var(--accent); transform: translate(2px, -2px); }

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
}
.stack li {
  padding: .25rem .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, var(--bg));
  color: var(--muted);
  font: 500 .6875rem/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* skills */

.skills {
  display: grid;
  gap: 2rem;
}
.skills h3 {
  margin-bottom: .75rem;
  font: 600 1rem/1.4 var(--sans);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.pills li {
  padding: .3rem .75rem;
  border: 1px solid color-mix(in srgb, var(--pill) 30%, var(--bg));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill) 9%, var(--bg));
  font-size: .875rem;
  line-height: 1.4;
}

/* contact */

.closing { font-size: 1.0625rem; }

.email {
  display: inline-block;
  margin-top: 1rem;
  font: 600 clamp(1.5rem, 4.5vw, 2.25rem)/1.2 var(--sans);
  letter-spacing: -0.03em;
  text-decoration-color: var(--accent);
  overflow-wrap: anywhere;
}

/* footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--faint);
  font-size: .8125rem;
  color: var(--muted);
}

/* 404 */

.lost {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}
.lost .code { font: 400 .8125rem var(--mono); color: var(--muted); }

@media (max-width: 30rem) {
  .nav { gap: 1rem; }
  .nav a:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --faint: #ccc; --accent: #000; }
  .masthead, .skip, .status, .btn { display: none; }
  body { font-size: 10.5pt; }
  .intro { padding: 0 0 1.5rem; }
  h1 { font-size: 30pt; }
  .section { padding-block: 1rem; break-inside: avoid; }
  a { text-decoration: none; }
  .email { font-size: 14pt; }
}
