/*
  Themes set --canvas/--ink/--accent inline on <html> (see App\Support\Themes),
  so the server render already has the right colors and there is no flash.
  Everything below is derived from those three tones.

  Hand-written on purpose: no Tailwind, no Vite, no Node in the image.
*/

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

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

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

.display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

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

.link-underline {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 150ms ease;
}
.link-underline:hover { text-decoration-color: var(--accent); }

.shell {
  margin: 0 auto;
  max-width: 56rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ---------------------------------------------------------------- nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  background-color: color-mix(in oklab, var(--canvas) 85%, transparent);
  backdrop-filter: blur(12px);
}

.nav__inner {
  display: flex;
  height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav__links a {
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 150ms ease;
}
.nav__links a:hover { color: var(--ink); }

@media (min-width: 640px) {
  .nav__links { display: flex; }
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: border-color 150ms ease, color 150ms ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

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

main { padding-bottom: 6rem; }

.hero { padding: 3.5rem 0 5rem; }

@media (min-width: 640px) {
  .hero { padding: 6rem 0 7rem; }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.dot {
  position: relative;
  display: inline-flex;
  width: 0.375rem;
  height: 0.375rem;
}

.dot__ping {
  position: absolute;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.6;
  animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.dot__core {
  position: relative;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

.hero__name {
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 0.95;
  font-weight: 700;
}

.hero__headline {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--accent);
}

.hero__tagline {
  margin-top: 2rem;
  max-width: 42rem;
  font-size: 1.25rem;
  line-height: 1.35;
  color: color-mix(in oklab, var(--ink) 85%, transparent);
}

.hero__summary {
  margin-top: 2rem;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero__location {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .hero__headline { font-size: 1.25rem; }
  .hero__tagline { font-size: 1.5rem; }
  .hero__summary { font-size: 1rem; }
}

.hero__actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.button {
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 150ms ease;
}
.button:hover { opacity: 0.9; }

.button--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
.button--ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

.stats {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--line);
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stats > div {
  background: var(--canvas);
  padding: 1.5rem 1.25rem;
}

.stats dt {
  font-size: 1.875rem;
  font-weight: 600;
}

.stats dd {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

/* ----------------------------------------------------------- sections --- */

.sections {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

@media (min-width: 640px) {
  .sections { gap: 8rem; }
}

section { scroll-margin-top: 6rem; }

.section-heading { margin-bottom: 2.5rem; }

.section-heading__label {
  margin-bottom: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-heading__title {
  font-size: 1.5rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .section-heading__title { font-size: 1.875rem; }
}

.section-heading__rule {
  margin-top: 1.5rem;
  height: 1px;
  width: 100%;
  background: var(--line);
}

.tag {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  color: var(--muted);
}

.tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* -------------------------------------------------------- experience --- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.entry {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .entry { grid-template-columns: 9.5rem 1fr; }
  .entry__rail { padding-top: 0.25rem; }
}

.entry__dates {
  font-size: 0.875rem;
  font-weight: 500;
}

.entry__duration {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.entry__current {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--accent);
}

.entry__current span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
}

.entry__body {
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}

@media (min-width: 640px) {
  .entry__body { padding-left: 2rem; }
}

.entry__company {
  font-size: 1.25rem;
  font-weight: 600;
}

.entry__alongside {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.entry__summary {
  margin-top: 1rem;
  max-width: 65ch;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted);
}

.roles {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.role__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.role__title { font-size: 1rem; font-weight: 500; }

.role__dates { font-size: 0.75rem; color: var(--muted); }

.badge {
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.highlights {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.highlights li {
  display: flex;
  max-width: 65ch;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.highlights li::before {
  content: "";
  margin-top: 0.625rem;
  flex: none;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--accent);
}

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

/* Flex, not grid: a fixed column count leaves an empty cell whenever the
   project count is not a multiple of it. Here the items on the last row
   stretch to fill, so any number of projects looks intentional. */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--line);
}

.card {
  display: flex;
  flex: 1 1 15rem;
  flex-direction: column;
  background: var(--canvas);
  padding: 1.5rem;
  transition: background-color 150ms ease;
}

a.card:hover { background: var(--surface); }

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.card__name { font-size: 1.125rem; font-weight: 600; }

.card__year { font-size: 0.75rem; color: var(--muted); }

.card__role {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.card__text {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted);
}

.card__link {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.75rem;
  color: var(--accent);
}

/* -------------------------------------------------------------- stack --- */

.rows {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.row {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .row { grid-template-columns: 9.5rem 1fr; }
}

.row__label {
  padding-top: 0.125rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.row__value {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  font-size: 0.9375rem;
}

.row__sep { color: color-mix(in oklab, var(--muted) 50%, transparent); }

/* ---------------------------------------------------------- education --- */

.stack-rows {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.edu__degree { font-size: 1rem; font-weight: 500; }
.edu__inst { font-size: 0.9375rem; color: var(--muted); }
.edu__note { margin-top: 0.375rem; font-size: 0.875rem; color: var(--accent); }
.edu__dates { padding-top: 0.125rem; font-size: 0.875rem; color: var(--muted); }

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

.footer {
  margin-top: 6rem;
  border-top: 1px solid var(--line);
  padding-top: 3.5rem;
  scroll-margin-top: 6rem;
}

.footer__label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.footer__title {
  margin-top: 0.75rem;
  max-width: 36rem;
  font-size: 1.5rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .footer__title { font-size: 1.875rem; }
}

.footer__links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

.footer__links a.muted:hover { color: var(--ink); }

.footer__legal {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ------------------------------------------------------ theme switcher --- */

.theme {
  position: relative;
}

.theme__button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease;
}
.theme__button:hover { color: var(--ink); }

.swatches { display: flex; gap: 2px; }

.swatch {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.theme__menu {
  position: absolute;
  right: 0;
  z-index: 20;
  margin-top: 0.5rem;
  width: 15rem;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}

.theme__option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.theme__option:hover { background: var(--canvas); }
.theme__option[aria-selected="true"] { color: var(--accent); }

.theme__option .swatch { width: 0.75rem; height: 0.75rem; }

.theme__name { display: block; font-weight: 500; }
.theme__desc { display: block; font-size: 0.75rem; color: var(--muted); }

/* -------------------------------------------------------------- print --- */

/* The web page is not the print artifact; /cv.pdf is. Printing the site
   directly still gives something sane rather than a wall of dark ink. */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #111; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
