:root {
  color-scheme: dark;
  --page: #090d0b;
  --page-rgb: 9, 13, 11;
  --page-soft: #111713;
  --ink: #fff2de;
  --ink-rgb: 255, 242, 222;
  --muted: #baad9d;
  --quiet: #9c8f80;
  --line: rgba(255, 242, 222, 0.16);
  --panel: rgba(255, 248, 237, 0.07);
  --panel-strong: rgba(255, 248, 237, 0.11);
  --accent: #ff9d66;
  --accent-2: #8ed8c3;
  --accent-rgb: 255, 157, 102;
  --accent-2-rgb: 142, 216, 195;
  --shadow: rgba(0, 0, 0, 0.24);
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --h1-size: clamp(2.7rem, 5.8vw, 5.3rem);
  --h2-size: clamp(2rem, 4vw, 3.8rem);
  --h3-size: clamp(1.25rem, 2vw, 1.6rem);
  --max-width: 1120px;
  --nav-width: 24rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
}

:root[data-theme="light"],
[data-theme="light"] {
  color-scheme: light;
  --page: #f5f8f7;
  --page-rgb: 245, 248, 247;
  --page-soft: #ffffff;
  --ink: #132023;
  --ink-rgb: 19, 32, 35;
  --muted: #5e6f70;
  --quiet: #667476;
  --line: rgba(19, 32, 35, 0.13);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --accent: #167f74;
  --accent-2: #9f6a11;
  --accent-rgb: 22, 127, 116;
  --accent-2-rgb: 159, 106, 17;
  --shadow: rgba(50, 70, 70, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: clamp(5.5rem, 10vh, 7rem);
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 28rem),
    radial-gradient(circle at 88% 22%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 24rem),
    linear-gradient(color-mix(in srgb, var(--ink) 3.5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 3.5%, transparent) 1px, transparent 1px),
    var(--page);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.shimmer-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.theme-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 68%, transparent);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 0.25rem;
}

/* Typography */
img,
video,
iframe {
  display: block;
  max-width: 100%;
}

p {
  margin-top: 0;
  color: var(--muted);
}

h1 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 520;
  letter-spacing: -0.025em;
  max-width: 700px;
  margin-bottom: var(--space-6);
  font-size: var(--h1-size);
}

h2 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 520;
  letter-spacing: -0.025em;
  max-width: 720px;
  margin-bottom: var(--space-4);
  font-size: var(--h2-size);
}

h3 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1;
  margin-bottom: var(--space-3);
  font-size: var(--h3-size);
  letter-spacing: -0.02em;
}

.skip-link {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 30;
  padding: var(--space-2) var(--space-3);
  background: var(--ink);
  color: var(--page);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
main {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(var(--nav-width), calc(100% - 24px));
  min-height: 2.65rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  padding: 0.34rem 0.42rem 0.34rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  box-shadow: 0 16px 44px color-mix(in srgb, var(--shadow) 68%, transparent);
  backdrop-filter: blur(18px);
}

.wordmark,
.eyebrow,
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.wordmark {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.58rem;
  color: var(--muted);
}

.site-nav a {
  text-decoration: none;
}

.theme-toggle {
  display: inline-grid;
  position: relative;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  transform: translateY(-1px);
}

.theme-toggle::after {
  position: absolute;
  inset: 0.48rem;
  border-radius: inherit;
  background: var(--accent);
  content: "";
}

.theme-toggle.is-randomizing {
  animation: toggle-pop 520ms cubic-bezier(0.2, 0.9, 0.22, 1);
}

.theme-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
  display: none;
}

.theme-icon-sun {
  display: none;
}

.theme-icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-icon-sun,
[data-theme="light"] .theme-icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-icon-moon,
[data-theme="light"] .theme-icon-moon {
  display: none;
}

.ink-ripple,
.burst-dot {
  position: absolute;
  left: var(--origin-x);
  top: var(--origin-y);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.ink-ripple {
  width: 18px;
  aspect-ratio: 1;
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 58%, transparent);
  animation: ink-ripple 760ms ease-out forwards;
}

.burst-dot {
  width: var(--dot-size, 7px);
  aspect-ratio: 1;
  background: var(--dot-color, var(--accent));
  box-shadow: 0 0 22px var(--dot-color, var(--accent));
  animation: burst-dot 820ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.effect-letter .wordmark,
body.effect-letter .site-nav a,
body.effect-letter h1,
body.effect-letter h2,
body.effect-letter h3 {
  animation: letter-jolt 520ms cubic-bezier(0.2, 0.9, 0.22, 1);
}

body.effect-blink .portrait-frame,
body.effect-blink .text-link {
  animation: chromatic-blink 620ms ease-out;
}

body.effect-card .list-item {
  position: relative;
  overflow: hidden;
}

body.effect-card .list-item::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 15%, color-mix(in srgb, var(--accent-2) 44%, transparent) 50%, transparent 85%);
  content: "";
  transform: translateX(-120%);
  animation: card-shimmer 760ms ease-out;
}

@keyframes toggle-pop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  35% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 24%, transparent);
    transform: translateY(-1px) scale(1.18);
  }

  62% {
    transform: translateY(0) scale(0.94);
  }
}

@keyframes ink-ripple {
  0% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0);
  }

  58% {
    opacity: 0.2;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(150);
  }
}

@keyframes burst-dot {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.6);
  }

  40% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.08);
  }
}

@keyframes letter-jolt {
  0%,
  100% {
    filter: none;
    transform: translate(0, 0);
  }

  18% {
    filter: drop-shadow(2px 0 0 var(--accent));
    transform: translate(1px, -1px);
  }

  36% {
    filter: drop-shadow(-2px 0 0 var(--accent-2));
    transform: translate(-1px, 1px);
  }

  60% {
    transform: translate(1px, 0);
  }
}

@keyframes chromatic-blink {
  0%,
  100% {
    box-shadow: 0 18px 48px var(--shadow);
  }

  35% {
    box-shadow:
      0 0 0 1px var(--accent),
      0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent),
      0 18px 42px color-mix(in srgb, var(--accent-2) 22%, transparent);
  }
}

@keyframes card-shimmer {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

.hero {
  padding: clamp(5.25rem, 8vw, 7rem) 0 var(--space-14);
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
}

.hero-intro {
  display: grid;
  grid-template-columns: minmax(0, 650px) auto;
  gap: clamp(var(--space-6), 6vw, var(--space-12));
  align-items: start;
}

.eyebrow {
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.hero-copy {
  max-width: 650px;
  margin-bottom: var(--space-6);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.list-item {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--shadow) 62%, transparent);
}

.portrait-card {
  align-self: start;
  justify-self: center;
  margin-top: 0.15rem;
}

.portrait-frame {
  position: relative;
  width: clamp(7.25rem, 12vw, 9.4rem);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 999px;
  padding: 0.42rem;
  background:
    radial-gradient(circle at 24% 18%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 36%),
    color-mix(in srgb, var(--panel-strong) 72%, transparent);
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--shadow) 70%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}

.portrait-frame::after {
  position: absolute;
  inset: 0.17rem;
  border: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 42%;
}

.section {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: clamp(5.5rem, 10vh, 7rem);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(280px, 1fr);
  gap: var(--space-8);
  align-items: start;
}

.stack > * + * {
  margin-top: var(--space-4);
}

.section-heading {
  max-width: 780px;
  margin-bottom: var(--space-6);
}

.timeline-groups {
  display: grid;
  gap: var(--space-6);
  max-width: 650px;
  margin: 0 auto;
}

.timeline-group {
  display: grid;
  gap: var(--space-3);
}

.timeline-group-header {
  display: grid;
  gap: var(--space-2);
}

.timeline-group-header .eyebrow {
  margin-bottom: 0;
}

.timeline-group-header h3 {
  margin-bottom: 0;
}

.timeline-list {
  display: grid;
  gap: var(--space-2);
}

.timeline-item {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: 0.2rem 0;
}

.timeline-badge {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-soft) 92%, transparent);
  box-shadow:
    0 6px 18px color-mix(in srgb, var(--shadow) 24%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
}

.timeline-badge img,
.theme-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.theme-logo-light {
  display: none;
}

:root[data-theme="light"] .theme-logo-light,
[data-theme="light"] .theme-logo-light {
  display: block;
}

:root[data-theme="light"] .theme-logo-dark,
[data-theme="light"] .theme-logo-dark {
  display: none;
}

.timeline-copy {
  min-width: 0;
}

.timeline-copy-header {
  display: grid;
  gap: 0.14rem;
}

.timeline-copy-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.15;
}

.timeline-role,
.timeline-date {
  margin: 0;
}

.timeline-role {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.timeline-date {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-date {
  justify-self: end;
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap;
}

#experience {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.text-link {
  width: fit-content;
  color: var(--ink);
  font-weight: 750;
}

.text-link:hover {
  color: var(--accent);
}

.fun-link-toggle,
.fun-link-toggle:visited,
.fun-link-toggle:hover {
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.16em;
}

.contact {
  border-bottom: 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.contact-links a,
.contact-links a:visited,
.contact-links a:hover,
.contact-links a:focus {
  color: var(--ink);
  /* font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  font-weight: 800; */
  line-height: 1.15;
  text-decoration: none;
}

.contact-links a:hover {
  color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-8) 0;
  color: var(--quiet);
  font-size: 0.95rem;
}

/* Article and template pages */
.page-title {
  max-width: 880px;
}

.article-shell {
  max-width: 760px;
}

.article-shell h2 {
  margin-top: var(--space-12);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.article-meta {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-grid {
  display: grid;
  gap: var(--space-4);
}

.list-item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6);
}

pre,
code {
  font-family: var(--font-mono);
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--page) 80%, #000);
  color: var(--ink);
  border: 1px solid var(--line);
}

@media (max-width: 980px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header {
    top: 8px;
    width: min(var(--nav-width), calc(100% - 16px));
    min-height: 2.45rem;
    gap: 0.55rem;
    padding: 0.28rem 0.34rem 0.28rem 0.6rem;
    background: var(--page);
    overflow: visible;
  }

  .site-footer {
    display: grid;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.42rem;
  }

  .hero {
    padding-top: clamp(4.5rem, 18vw, 5.75rem);
  }

  .hero-intro {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
  }

  .portrait-frame {
    width: 5.9rem;
    padding: 0.3rem;
  }

  .timeline-item {
    grid-template-columns: 3rem minmax(0, 1fr);
    align-items: start;
  }

  .timeline-date {
    justify-self: start;
    text-align: left;
    margin-left: calc(3rem + var(--space-3));
  }

  .section {
    padding: var(--space-8) 0;
  }

  .theme-toggle {
    width: 1.9rem;
    height: 1.9rem;
  }

}

@media (max-width: 520px) {
  :root {
    --h1-size: clamp(2.45rem, 12vw, 3.8rem);
    --h2-size: clamp(1.9rem, 9vw, 2.7rem);
  }

  .site-footer,
  main {
    width: min(var(--max-width), calc(100% - 24px));
  }

  .site-header {
    width: calc(100% - 12px);
    padding-right: 0.3rem;
    padding-left: 0.48rem;
  }

  .hero-intro {
    gap: var(--space-3);
  }

  .portrait-frame {
    width: 4.9rem;
  }

  .timeline-item {
    gap: var(--space-3);
  }

  .timeline-badge {
    width: 2.3rem;
    height: 2.3rem;
    padding: 0.28rem;
  }

  .timeline-role {
    font-size: 0.88rem;
  }
}
