@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f3f7;
  --tile: #ffffff;
  --ink: #11131a;
  --muted: #5a6072;
  --line: #e1e4ec;
  --control-line: #8a90a2;
  --accent: #4f3ff0;
  --accent-deep: #3a2bd1;
  --accent-soft: #ece9ff;
  --on-accent-2: #e6e3ff;
  --dark-2: #262a36;
  --mint: #dcf5e8;
  --mint-ink: #0c5537;
  --sky: #dfeaff;
  --sky-ink: #1b4a9c;
  --peach: #ffe8da;
  --peach-ink: #7a3312;
  --on-dark-2: #b9bccb;
  --live: #3ee08f;
  --cached: #f2b544;
  --cached-panel: #fff4dc;
  --error: #c0262d;
  --focus: #4f3ff0;

  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(17, 19, 26, .06), 0 8px 24px rgba(17, 19, 26, .05);
  --page: 76rem;
  --gap: 1rem;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

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

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }
.skip-link:hover { color: #fff; }

.degraded-banner {
  background: var(--cached-panel);
  color: var(--ink);
  padding: .75rem 1.25rem;
  text-align: center;
  font-weight: 600;
}

/* Header */
.site-header {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}
.site-name { font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 1.0625rem; }
.nav { display: flex; gap: .25rem; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.nav a:hover { color: var(--ink); background: var(--tile); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--tile); box-shadow: var(--shadow); }

/* Tile grid */
.grid {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--gap);
  align-content: start;
}
.tile {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.tile-full { grid-column: span 12; }
.tile-wide { grid-column: span 8; }
.tile-half { grid-column: span 6; }
.tile-side { grid-column: span 4; }

.tile-intro {
  grid-column: span 8;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.75rem;
}
.tile-intro.tile-full { grid-column: span 12; grid-row: auto; }
.tile-intro.tile-single { grid-row: auto; }
.tile-fit { align-self: start; }
.tile-tall { grid-row: span 2; }
.tile-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; padding: 2.5rem 2.75rem; }

h1 { font-size: clamp(2.75rem, 1.6rem + 4.2vw, 5.25rem); font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.tile-head h1 { font-size: clamp(2.5rem, 1.8rem + 2.8vw, 4rem); }
.lede { margin-top: 1.25rem; font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); color: var(--muted); line-height: 1.45; max-width: 36ch; }
.tile-head .lede { margin-top: .75rem; max-width: none; }
.tile-intro h2.tile-title { margin-top: 1.75rem; }
.tile-intro .muted { margin-top: .5rem; max-width: 60ch; }

.tile-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.tile-title-lg { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); letter-spacing: -.03em; }
.tile-title a { text-decoration: none; }
.tile-title a:hover { text-decoration: underline; }
.tile p + p { margin-top: .35rem; }
.tile-title + p, .tile-title + .chips, .tile-title + .muted { margin-top: .75rem; }
.muted { color: var(--muted); line-height: 1.6; }
.meta-line { margin-top: .75rem !important; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tile colorways */
.tile-mint { background: var(--mint); }
.tile-mint .tile-title, .tile-mint li::marker { color: var(--mint-ink); }
.tile-sky { background: var(--sky); }
.tile-sky .tile-title { color: var(--sky-ink); }
.tile-peach { background: var(--peach); }
.tile-peach .tile-title { color: var(--peach-ink); }
.tile-mint .chips li, .tile-sky .chips li { background: rgba(255, 255, 255, .78); }
.about-text { margin-top: .9rem !important; font-size: 1.125rem; line-height: 1.65; max-width: 62ch; }
.now-list { margin: .9rem 0 0; padding-left: 1.1rem; display: grid; gap: .6rem; font-weight: 600; line-height: 1.45; }
.tile-dark { background: var(--ink); color: #fff; }
.tile-dark p { color: var(--on-dark-2); }
.tile-dark a { color: #fff; }
.tile-accent { background: var(--accent); color: #fff; }
.tile-accent p { color: var(--on-accent-2); }
.tile-accent a { color: #fff; }
.tile-dark a:hover, .tile-accent a:hover { color: #fff; text-decoration-thickness: 3px; }

.status-dot {
  display: inline-block;
  width: .6rem;
  height: .6rem;
  margin-right: .6rem;
  border-radius: 50%;
  vertical-align: .18em;
}
.status-dot.is-live { background: var(--live); box-shadow: 0 0 0 4px rgba(62, 224, 143, .22); }
.status-dot.is-cached { background: var(--cached); box-shadow: 0 0 0 4px rgba(242, 181, 68, .22); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: .625rem; }
.tile-project .actions { margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.875rem;
  padding: 0 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}
.btn:hover { background: var(--accent); color: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn-soft:hover { background: var(--accent); color: #fff; }

/* Chips */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { padding: .5rem .9rem; border-radius: 999px; background: var(--bg); font-weight: 600; }
.tile-project .chips { margin-top: 1rem; }
.chips-dark li { background: var(--dark-2); color: #fff; }
.tile-dark .chips + p { margin-top: 1rem; }

/* Project tile + diagram */
.tile-project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2rem; align-items: center; }
.tile-project .muted { margin-top: .75rem; max-width: 52ch; }
.diagram { width: 100%; max-width: 26rem; justify-self: center; font-family: var(--font); font-size: 13px; font-weight: 700; }
.diagram text { fill: var(--ink); }
.diagram .text-accent { fill: var(--accent-deep); }
.diagram .text-inverse { fill: #fff; }
.diagram .text-muted { fill: var(--muted); }
.diagram .node { fill: var(--bg); }
.diagram .node-accent { fill: var(--accent-soft); }
.diagram .node-dark { fill: var(--ink); }
.diagram .node-dashed { fill: none; stroke: var(--control-line); stroke-dasharray: 5 4; }
.diagram-lines path { fill: none; stroke: #c9cbe0; stroke-width: 2; }
.tile-diagram { display: grid; gap: 1rem; }
.tile-diagram .diagram { max-width: 32rem; }

/* Experience */
.tile-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 2rem; }
.tile-job { display: flex; flex-direction: column; }
.job-dates { font-size: .875rem; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.tile-job .tile-title { margin-top: .5rem; }
.job-role { margin-top: .25rem !important; font-weight: 600; }
.tile-job .muted { margin-top: .9rem !important; font-size: .95rem; }

/* Contact */
.tile-contact { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; }
.contact-email { display: inline-block; margin-top: .25rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.contact-email-lg { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); letter-spacing: -.03em; }
.link-row { display: flex; flex-wrap: wrap; gap: 1.25rem; font-weight: 700; color: var(--muted); }
.link-row a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Resume entries */
.entries { list-style: none; margin: 1rem 0 0; padding: 0; }
.entries > li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.entries h3 { font-size: 1.15rem; font-weight: 800; }
.points { margin: .6rem 0 0; padding-left: 1.1rem; max-width: 70ch; }

/* Footer */
.site-footer { width: 100%; max-width: var(--page); margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; color: var(--muted); font-size: .9rem; }

/* Admin and legacy containers */
.card { grid-column: span 12; background: var(--tile); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.card h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); margin-bottom: 1rem; }
.card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: .75rem; }
.form-card form { display: flex; flex-direction: column; gap: .5rem; max-width: 36rem; }
.form-card label { font-weight: 700; margin-top: .5rem; }
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { padding: .7rem .85rem; background: #fff; border: 1px solid var(--control-line); border-radius: 12px; }
textarea { min-height: 8rem; resize: vertical; }
button { align-self: flex-start; min-height: 2.875rem; padding: 0 1.35rem; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
button:hover { background: var(--accent); }
.error { color: var(--error); font-weight: 700; }
.meta { color: var(--muted); }

/* Motion: one load cascade, plus a small lift on work tiles */
.tile-job, .tile-project { transition: transform 200ms cubic-bezier(.16, 1, .3, 1), box-shadow 200ms ease-out; }
.tile-job:hover, .tile-project:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(17, 19, 26, .06), 0 16px 36px rgba(17, 19, 26, .09); }
@media (prefers-reduced-motion: no-preference) {
  .grid > .tile { animation: tile-rise 640ms cubic-bezier(.16, 1, .3, 1) both; }
  .grid > .tile:nth-child(2) { animation-delay: 50ms; }
  .grid > .tile:nth-child(3) { animation-delay: 100ms; }
  .grid > .tile:nth-child(4) { animation-delay: 150ms; }
  .grid > .tile:nth-child(5) { animation-delay: 200ms; }
  .grid > .tile:nth-child(6) { animation-delay: 250ms; }
  .grid > .tile:nth-child(n+7) { animation-delay: 300ms; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-job:hover, .tile-project:hover { transform: none; }
}
@keyframes tile-rise { from { opacity: .35; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .tile-intro, .tile-wide, .tile-half, .tile-side, .tile-tall { grid-column: 1 / -1; grid-row: auto; }
  .tile-project { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile-intro, .tile-head { padding: 1.5rem; }
}

@media (max-width: 30rem) {
  .nav a { padding: 0 .75rem; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}
.privacy ul.muted { margin: .5rem 0 0; padding-left: 1.25rem; max-width: 60ch; }
.privacy ul.muted li + li { margin-top: .35rem; }
.privacy code { font-size: .9em; }

/* Analytics consent */
.link-button { min-height: 0; padding: 0; border-radius: 0; background: none; color: inherit; font-weight: inherit; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.link-button:hover { background: none; color: var(--ink); }
.consent-banner { position: fixed; inset: auto 1rem 1rem; z-index: 10; max-width: 34rem; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.25rem; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(17, 19, 26, .06), 0 16px 36px rgba(17, 19, 26, .12); font-size: .95rem; }
.consent-banner[hidden] { display: none; }
.consent-banner p { flex: 1 1 18rem; }
.consent-actions { display: flex; gap: .5rem; }
.consent-actions button[data-consent="decline"] { background: var(--accent-soft); color: var(--accent-deep); }
.consent-actions button[data-consent="decline"]:hover { background: var(--accent); color: #fff; }
