:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --line: #e7e7e7;
  --line-strong: #d8d8d8;
  --surface: #fbfbfb;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 34px 80px rgba(0, 0, 0, 0.12);
  --avatar-highlight: rgba(255, 255, 255, 0.6);
  --error: #ef4444;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Geist", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --line: #e7e7e7;
  --line-strong: #d8d8d8;
  --surface: #fbfbfb;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 34px 80px rgba(0, 0, 0, 0.12);
  --avatar-highlight: rgba(255, 255, 255, 0.6);
  --error: #ef4444;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0f;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #87878f;
  --line: #2a2a30;
  --line-strong: #3a3a42;
  --surface: #121216;
  --shadow: none;
  --shadow-hover: none;
  --avatar-highlight: rgba(255, 255, 255, 0.06);
  --error: #f87171;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
  }

  html:not([data-theme]) {
    --bg: #0c0c0f;
    --ink: #f4f4f5;
    --muted: #a1a1aa;
    --faint: #87878f;
    --line: #2a2a30;
    --line-strong: #3a3a42;
    --surface: #121216;
    --shadow: none;
    --shadow-hover: none;
    --avatar-highlight: rgba(255, 255, 255, 0.06);
    --error: #f87171;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[data-theme="dark"] body {
  background: var(--bg);
}

html[data-theme="light"] body {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.98)), var(--bg);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body {
    background: var(--bg);
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 65%, rgba(0, 0, 0, 0.04), transparent 20%),
    radial-gradient(circle at 78% 18%, rgba(0, 0, 0, 0.03), transparent 18%);
  opacity: 0.75;
}

html[data-theme="dark"] body::before {
  opacity: 0;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body::before {
    opacity: 0;
  }
}

.page-shell {
  display: grid;
  grid-template-columns: 14rem 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.85rem 1.5rem 1.6rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.brand {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}

.brand:hover,
.brand:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: none;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.sidebar-toggle:hover {
  border-color: var(--ink);
}

.sidebar-toggle:active {
  transform: scale(0.94);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sidebar-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-toggle .icon-close {
  display: none;
}

.sidebar-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.sidebar-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
  min-height: 0;
}

.sidebar-nav,
.sidebar-group,
.sidebar-links {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-link,
.small-link,
.section-link,
.social-links a,
.email-link {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  transition: color 180ms ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 1.85rem;
  padding: 0.1rem 0;
  transition: color 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-link:hover,
.small-link:hover,
.section-link:hover,
.social-links a:hover,
.email-link:hover {
  color: var(--ink);
}

.sidebar-link:hover {
  transform: translateX(1px);
}

.sidebar-icon {
  width: 0.92rem;
  height: 0.92rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: var(--faint);
}

.sidebar-label {
  flex: 1;
}

.sidebar-arrow {
  width: 0.8rem;
  flex: none;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-0.2rem);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-link[aria-current="location"],
.sidebar-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 400;
}

.sidebar-link[aria-current="location"] .sidebar-icon,
.sidebar-link[aria-current="page"] .sidebar-icon {
  color: var(--ink);
}

.sidebar-link[aria-current="location"] .sidebar-arrow,
.sidebar-link[aria-current="page"] .sidebar-arrow {
  opacity: 1;
  order: -1;
  transform: translateX(0);
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  gap: 0.5rem;
  flex-shrink: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sidebar-footer::-webkit-scrollbar {
  width: 4px;
}

.sidebar-footer::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-footer::-webkit-scrollbar-thumb {
  background-color: var(--line-strong);
  border-radius: 999px;
}

.pill-button,
.theme-toggle button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.pill-button > *:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pill-button span {
  flex-shrink: 0;
}

.pill-button span {
  color: var(--faint);
}

.viewer-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.viewer-avatar,
.viewer-count {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.viewer-avatar:nth-child(2) {
  margin-left: -0.35rem;
}

.viewer-avatar:nth-child(3) {
  margin-left: -0.35rem;
}

.viewer-count {
  display: grid;
  place-items: center;
  margin-left: -0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}

.viewer-copy {
  margin: 0;
  padding-left: 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.contact-copy {
  margin: 0;
  padding-left: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.viewer-copy strong {
  color: var(--ink);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.16rem 0.16rem 0.16rem 0.275rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.theme-toggle button {
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.theme-toggle button svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--bg) 88%, var(--ink));
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 10px rgba(0, 0, 0, 0.1);
  animation: toggle-pop 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle button:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.theme-toggle button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.email-link {
  color: var(--ink);
  font-weight: 400;
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.email-link::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--faint);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22 6 12 13 2 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22 6 12 13 2 6'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 180ms ease;
}

.email-link:hover::before {
  background-color: var(--ink);
}

.content {
  position: relative;
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  padding: 2.25rem 3rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;
}

.content > * {
  width: 100%;
}

.page-intro {
  max-width: 36rem;
  display: grid;
  gap: 0.6rem;
  padding-top: 0.8rem;
  align-self: flex-start;
}

.page-intro .lead {
  margin-bottom: 0;
  max-width: 35rem;
}

.section-grid:empty {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 1.8rem;
  align-items: center;
  max-width: 100%;
}

.portrait-wrap {
  position: relative;
  min-height: 18rem;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: grayscale(0.85) contrast(1.05);
  transform: scale(1);
  transition:
    filter 480ms ease,
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.portrait-wrap:hover .portrait-img,
.portrait-wrap:focus-within .portrait-img {
  filter: grayscale(0) contrast(1.02);
  transform: scale(1.035);
}

.portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.22) 100%);
  mix-blend-mode: multiply;
  opacity: 0.5;
}

html[data-theme="dark"] .portrait-wrap {
  border-color: var(--line);
  background: var(--surface);
}

html[data-theme="dark"] .portrait-img {
  filter: grayscale(0.85) contrast(1.08) brightness(0.94);
}

html[data-theme="dark"] .portrait-wrap:hover .portrait-img,
html[data-theme="dark"] .portrait-wrap:focus-within .portrait-img {
  filter: grayscale(0) contrast(1.04) brightness(1);
}

html[data-theme="dark"] .portrait-wrap::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: normal;
  opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .portrait-img {
    filter: grayscale(0.85) contrast(1.08) brightness(0.94);
  }

  html:not([data-theme]) .portrait-wrap:hover .portrait-img,
  html:not([data-theme]) .portrait-wrap:focus-within .portrait-img {
    filter: grayscale(0) contrast(1.04) brightness(1);
  }

  html:not([data-theme]) .portrait-wrap::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
    mix-blend-mode: normal;
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait-img {
    transition: filter 300ms ease;
  }

  .portrait-wrap:hover .portrait-img,
  .portrait-wrap:focus-within .portrait-img {
    transform: none;
  }
}

.hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.65rem, 2.6vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--ink);
}

.page-title {
  margin: 0;
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  font-family: var(--sans);
  font-weight: 500;
}

.page-intro .lead {
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}

.kicker,
.section-index,
.mini-label,
.stat-label,
.timeline-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

.lead {
  margin: 0 0 0.9rem;
  max-width: 34rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}

.timeline-body .lead {
  margin: 0 0 1.8rem;
}

.timeline-body .lead:last-of-type {
  margin-bottom: 1.2rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  transition: border-color 200ms ease, background-color 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
}

.social-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  fill: var(--muted);
  transition: fill 200ms ease;
}

.social-link:nth-of-type(3) .social-icon {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 200ms ease;
}

.social-arrow {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: var(--faint);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 100%, transparent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.social-link:hover .social-icon,
.social-link:focus-visible .social-icon {
  fill: var(--ink);
}

.social-link:nth-of-type(3):hover .social-icon,
.social-link:nth-of-type(3):focus-visible .social-icon {
  stroke: var(--ink);
}

.social-link:hover .social-arrow,
.social-link:focus-visible .social-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--ink);
}

.social-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.identity-section {
  max-width: 100%;
}

.identity-strip {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.identity-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.35rem 1.5rem;
  border-right: 1px solid var(--line);
}

.identity-item:first-child {
  padding-left: 0.1rem;
}

.identity-item:last-child {
  border-right: 0;
}

.identity-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.identity-icon {
  width: 1.65rem;
  height: 1.65rem;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.identity-item:hover .identity-icon {
  transform: translateY(-3px) rotate(-6deg);
}

.identity-item:nth-child(1):hover .identity-icon,
.identity-item:nth-child(3):hover .identity-icon {
  transform: translateY(-3px) rotate(6deg);
}

.identity-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -0.1rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  color: var(--faint);
}

.identity-mark svg {
  width: 0.7rem;
  height: 0.7rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), color 220ms ease;
}

.identity-item:hover .identity-mark svg {
  color: var(--ink);
  transform: translate(1px, -1px);
}

.identity-mark--infinity {
  font-size: 1.05rem;
  color: var(--ink);
}

.identity-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 220ms ease;
}

.identity-item:hover .identity-label {
  color: var(--ink);
}

.identity-trace {
  height: 1px;
  margin-top: -1px;
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1.3px);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  background-position: left center;
}

@media (max-width: 780px) {
  .identity-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .identity-item {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .identity-item:first-child {
    padding-left: 1.5rem;
  }

  .identity-item:nth-child(2n) {
    border-right: 0;
  }

  .identity-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 480px) {
  .identity-strip {
    grid-template-columns: 1fr;
  }

  .identity-item {
    border-right: 0 !important;
    padding: 1.05rem 0.2rem;
  }

  .identity-item:not(:last-child) {
    border-bottom: 1px solid var(--line) !important;
  }

  .identity-item:last-child {
    border-bottom: 0 !important;
  }
}

.section-block {
  max-width: 100%;
}

.section-block + .section-block {
  margin-top: 1.4rem;
}

.section-block:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  padding-top: 0.2rem;
}

.post-list,
.timeline {
  position: relative;
  display: grid;
  gap: 2.5rem;
  padding-left: 0.1rem;
}

.blog-placeholder {
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}

.placeholder-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0;
  border-bottom: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1.6rem;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 1px;
  background: var(--line);
}

.timeline-card::after {
  content: "";
  position: absolute;
  left: 1.6rem;
  top: 1.45rem;
  bottom: -2.5rem;
  width: 1px;
  background: var(--line);
}

.timeline-card:last-child::after {
  display: none;
}

.timeline-avatar {
  position: relative;
  z-index: 1;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, var(--surface));
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent) inset;
}

.timeline-body {
  padding-bottom: 0.2rem;
}

.timeline-company-row {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.timeline-company-row h2,
.timeline h3,
.feature-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.timeline h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.timeline p,
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.timeline-subtitle,
.timeline-location,
.timeline-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  white-space: nowrap;
}

.timeline-subtitle,
.timeline-location {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
}

.timeline-location {
  white-space: normal;
}

.timeline-meta {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0.8));
  box-shadow: var(--shadow);
}

.feature-card .mini-label {
  margin-bottom: 0.3rem;
}

.tag-row,
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.tag-row span,
.stack-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  transition: all 200ms ease;
}

.tag-row span:hover,
.stack-row span:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.stack-row {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: 100vh;
    padding: 1rem 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    gap: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-panel {
    display: none;
    flex: none;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
  }

  .sidebar-panel.is-open {
    display: flex;
  }

  .sidebar-nav,
  .sidebar-group,
  .sidebar-links {
    padding-bottom: 0.75rem;
  }

  .content {
    padding: 2rem 1.25rem 3rem;
    max-width: 100%;
  }
}

@media (max-width: 780px) {
  .content {
    padding-inline: 1.1rem;
    gap: 2.25rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portrait-wrap {
    min-height: 0;
    aspect-ratio: 5 / 4;
    max-width: 20rem;
  }

  .cards-grid,
  .timeline article {
    grid-template-columns: 1fr;
  }

  .timeline::before,
  .timeline-card::after {
    left: 1.2rem;
  }

  .timeline article {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .section-head {
    gap: 1rem;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.15rem 1.25rem;
  }

  .project-row-meta {
    gap: 0.75rem;
  }
  
  .typing-header {
    gap: 1.5rem;
  }
  
  .typing-content {
    padding: 1.5rem;
  }

  .stat-value span:first-child {
    font-size: 1.7rem;
  }

  .text-display {
    font-size: 1.25rem;
    max-height: 125px; /* Ensures the 3rd line is fully visible on mobile */
  }

  .results-main h2 {
    font-size: 3.5rem;
  }

  .results-sub {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.9rem 1rem;
  }

  .brand {
    font-size: 0.9rem;
  }

  .content {
    padding: 1.5rem 0.9rem 2.5rem;
    gap: 2rem;
  }

  .hero-copy h1 {
    font-size: 1.5rem;
  }

  .lead {
    font-size: 0.92rem;
  }

  .social-links {
    gap: 0.5rem;
  }

  .social-link {
    padding: 0.45rem 0.7rem 0.45rem 0.6rem;
    font-size: 0.72rem;
  }

  .project-stack {
    max-width: 100%;
  }

  .section-index {
    font-size: 0.6rem;
  }

  .experience-row {
    padding: 1rem 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .feature-card,
  .post-row,
  .identity-section,
  .sidebar,
  .hero-copy h1,
  .lead,
  .portrait-wrap {
    animation: rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .identity-section {
    animation-delay: 120ms;
  }

  .section-block {
    animation: rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 180ms;
  }

  .feature-card:nth-child(2),
  .timeline article:nth-child(2),
  .post-row:nth-child(2) {
    animation-delay: 240ms;
  }

  .feature-card:nth-child(2) {
    animation-delay: 260ms;
  }

  .post-row:nth-child(3),
  .timeline article:nth-child(2) {
    animation-delay: 300ms;
  }

  .feature-card:hover,
  .post-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 320ms ease;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toggle-pop {
  0% {
    transform: scale(0.94);
  }

  70% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle button,
  .theme-toggle button[aria-pressed="true"] {
    animation: none;
    transition: none;
  }

  .identity-icon,
  .identity-item {
    transition: none;
  }
}

.experience-minimal {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.experience-row {
  display: grid;
  grid-template-columns: 50px 1fr 1fr;
  gap: 2rem;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.experience-row:last-child {
  border-bottom: none;
}

.exp-year {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.exp-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.exp-company {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .experience-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.2rem 0;
    align-items: flex-start;
  }

  .exp-company {
    text-align: left;
  }
}

.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.cert-category {
  display: grid;
  gap: 0.9rem;
}

.cert-card {
  flex: 0 1 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.95rem;
  padding: 1.4rem 1.3rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 240ms ease, border-color 200ms ease;
}

.cert-card:hover,
.cert-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.cert-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.cert-icon {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.cert-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.55rem;
  box-sizing: border-box;
  display: block;
}

.cert-icon.logo-fallback {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
}

.cert-icon.logo-fallback::after {
  content: attr(data-fallback);
}

.cert-body {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
}

.cert-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
}

.cert-issuer {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.cert-verify {
  margin-top: auto;
  padding-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 200ms ease, gap 200ms ease;
}

.cert-verify svg {
  width: 0.6rem;
  height: 0.6rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cert-card:hover .cert-verify,
.cert-card:focus-visible .cert-verify {
  color: var(--ink);
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .cert-card {
    flex: 1 1 100%;
  }
}

.project-stack {
  position: relative;
  width: 100%;
  max-width: 21rem;
  aspect-ratio: 1 / 1.02;
  margin: 0.3rem auto 0;
}

.project-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 55%, var(--bg)));
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transform-origin: 50% 100%;
  transition: transform 480ms cubic-bezier(0.16, 1, 0.3, 1), opacity 420ms ease, box-shadow 420ms ease;
}

.project-card-icon {
  position: relative;
  width: 8rem;
  height: 8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 0.4rem;
  box-sizing: border-box;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  margin-bottom: 0.6rem;
}

.project-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.project-card-icon.logo-fallback::after {
  content: attr(data-fallback);
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.project-card h2 {
  margin: 0;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.project-card .tag-row {
  margin-top: auto;
  padding-top: 0.6rem;
}

.project-card-link {
  margin-top: auto;
  padding-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
}

.project-card-link:hover {
  text-decoration: underline;
}

.project-card[data-position="front"] {
  transform: translate(0, 0) rotate(0deg) scale(1);
  z-index: 3;
  opacity: 1;
  cursor: default;
}

.project-card[data-position="front"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.project-card[data-position="back-left"] {
  transform: translate(-2rem, 1.4rem) rotate(-8deg) scale(0.93);
  z-index: 2;
  opacity: 0.66;
}

.project-card[data-position="back-right"] {
  transform: translate(2rem, 1.1rem) rotate(7deg) scale(0.94);
  z-index: 1;
  opacity: 0.52;
}

.project-card[data-position="back-left"]:hover {
  transform: translate(-2.3rem, 0.5rem) rotate(-8deg) scale(0.94);
  opacity: 0.92;
  box-shadow: var(--shadow-hover);
}

.project-card[data-position="back-right"]:hover {
  transform: translate(2.3rem, 0.2rem) rotate(7deg) scale(0.95);
  opacity: 0.92;
  box-shadow: var(--shadow-hover);
}

.project-card[data-position^="back"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.stack-hint {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  text-align: center;
}

@media (max-width: 780px) {
  .project-stack {
    max-width: 18rem;
  }

  .project-card {
    padding: 1rem 1.1rem;
  }

  .project-card[data-position="back-left"] {
    transform: translate(-1.1rem, 1rem) rotate(-6deg) scale(0.92);
  }

  .project-card[data-position="back-right"] {
    transform: translate(1.1rem, 0.8rem) rotate(5deg) scale(0.93);
  }

  .project-card[data-position="back-left"]:hover {
    transform: translate(-1.3rem, 0.4rem) rotate(-6deg) scale(0.93);
  }

  .project-card[data-position="back-right"]:hover {
    transform: translate(1.3rem, 0.1rem) rotate(5deg) scale(0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: none;
  }
}

.project-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background-color 200ms ease;
}

.project-list a.project-row {
  cursor: pointer;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-list a.project-row:hover {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.project-row-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--ink) 75%, var(--muted) 25%);
}

.project-row-body {
  display: grid;
  gap: 0.55rem;
}

.project-row-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-row-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
  letter-spacing: 0.005em;
}

.project-row-arrow {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.15rem;
  color: var(--faint);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: color 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-list a.project-row:hover .project-row-arrow {
  color: var(--ink);
  transform: translate(1px, -1px);
}

/* ---------------------------------------------------------------
   Typing Test Overlay
--------------------------------------------------------------- */
.typing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  font-family: var(--mono);
}

.typing-overlay:not([aria-hidden="true"]) {
  opacity: 1;
  pointer-events: auto;
}

.minimal-test-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.5rem 0; 
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  cursor: pointer;
  transition: opacity 200ms ease;
}

.minimal-test-btn:hover {
  opacity: 0.6;
}

.minimal-test-btn span {
  color: var(--faint);
}

/* True Middle Alignment for test view container */
#test-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
}

.typing-content {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  gap: 3rem;
  min-height: 100vh;
}

.typing-header {
  display: flex;
  gap: 4rem; 
  margin-bottom: 2rem;
  justify-content: center;
}

.typing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 400;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  line-height: 1;
}

.stat-value span:first-child {
  font-size: 2.2rem; 
}

.stat-symbol {
  font-size: 1.2rem;
}

.typing-stat label {
  font-size: 0.65rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Make sure text aligns and centers cleanly */
.text-display {
  font-size: 1.5rem;
  line-height: 1.7;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: center; 
  text-align: center;
  gap: 0.5rem 0.8rem;
  max-height: 150px; /* Ensures the 3rd line is fully visible without clipping */
  overflow: hidden;
  position: relative;
  user-select: none;
  width: 100%;
  scroll-behavior: smooth;
}

.word {
  display: flex;
}

/* Set inline-block for transforms to take effect */
.letter {
  position: relative;
  display: inline-block;
  transition: color 100ms ease;
}

/* Subtle Pop Animation for Keypresses */
@keyframes popIn {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.letter.correct {
  color: var(--ink);
  animation: popIn 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.letter.incorrect {
  color: var(--error); 
  animation: popIn 150ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.letter.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background-color: var(--ink);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-hints {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--muted);
  justify-content: center;
}

kbd {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  color: var(--ink);
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* Flexbox fixed to align contents seamlessly in the center */
#results-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.results-main {
  text-align: center;
  margin-bottom: 2rem;
}

.results-main h2 {
  font-size: 5rem;
  margin: 0;
  line-height: 1;
  color: var(--ink);
  font-weight: 400;
}

.results-main label {
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.results-sub {
  display: flex;
  gap: 4rem;
  margin-bottom: 3rem;
  justify-content: center;
}

.action-button {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 150ms ease, opacity 150ms ease;
}

.action-button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.action-button:focus-visible,
.minimal-test-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.action-button svg {
  width: 1rem;
  height: 1rem;
}
.mt-4 { margin-top: 1rem; }