@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/GeistMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Charter Local";
  src: url("assets/fonts/charter_regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MS Sans Local";
  src: url("assets/fonts/ms_sans_serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MS Sans Local";
  src: url("assets/fonts/ms_sans_serif_bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #09090b;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --line: #ededf0;
  --accent: rgba(244, 244, 245, 0.82);
  --accent-strong: #18181b;
  --accent-foreground: #f8f8fa;
  --spotlight: rgba(0, 0, 0, 0.08);
  --spotlight-strong: rgba(0, 0, 0, 0.14);
  --dot: rgba(0, 0, 0, 0.08);
  --selection: #09090b;
  --selection-foreground: #ffffff;
  --font-sans: "Geist", "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", Consolas, monospace;
  --font-serif: "Charter Local", Georgia, serif;
  --font-pixel: "MS Sans Local", Arial, sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --line: #212126;
  --accent: rgba(39, 39, 42, 0.82);
  --accent-strong: #fafafa;
  --accent-foreground: #09090b;
  --spotlight: rgba(255, 255, 255, 0.06);
  --spotlight-strong: rgba(255, 255, 255, 0.12);
  --dot: rgba(255, 255, 255, 0.08);
  --selection: #fafafa;
  --selection-foreground: #09090b;
}

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

html {
  scroll-behavior: smooth;
}

:where([id]) {
  scroll-margin-top: 4.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--selection-foreground);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(113, 113, 122, 0.35);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  width: min(calc(100% - 1rem), 48rem);
  margin: 0 auto;
  padding: 0 0 2rem;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.portfolio {
  display: grid;
}

.screen-line-top,
.screen-line-bottom {
  position: relative;
}

.screen-line-top::before,
.screen-line-bottom::after {
  content: "";
  position: absolute;
  left: -100vw;
  width: 200vw;
  height: 1px;
  background: var(--line);
}

.screen-line-top::before {
  top: 0;
}

.screen-line-bottom::after {
  bottom: 0;
}

.topbar,
.profile-cover,
.profile-header,
.panel,
.separator,
.site-footer {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.panel {
  position: relative;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  left: -100vw;
  width: 200vw;
  height: 1px;
  background: var(--line);
}

.panel::before {
  top: 0;
}

.panel::after {
  bottom: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.topbar__brand,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__brand,
.topbar__link,
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-decoration: none;
}

.topbar__brand {
  color: var(--foreground);
}

.topbar__link,
.theme-toggle {
  color: var(--muted-foreground);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--muted-foreground) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 72%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
  cursor: pointer;
}

.theme-toggle:hover,
.topbar__link:hover,
.topbar__icon-link:hover {
  color: var(--foreground);
}

.topbar__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--muted-foreground);
  transition: color 160ms ease;
}

.topbar__icon-link svg {
  width: 1.05rem;
  height: 1.05rem;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--accent) 92%, transparent);
}

.theme-toggle__icon {
  width: 1rem;
  height: 1rem;
}

.profile-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3.4 / 1;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), var(--spotlight-strong), transparent 18%),
    radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), var(--spotlight), transparent 32%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.018), transparent);
}

.profile-cover__grid,
.profile-cover__grid::before {
  position: absolute;
  inset: 0;
}

.profile-cover__grid {
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 12px 12px;
}

.profile-cover__grid::before {
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent 30%, rgba(0, 0, 0, 0.03));
}

.profile-cover__mark {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.profile-cover__monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  min-height: 3.1rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 4vw, 2rem);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
}

.profile-cover__subline {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-header {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
}

.profile-header__avatar {
  display: grid;
  place-items: center;
  padding: 0.5rem;
  border-right: 1px solid var(--line);
}

.avatar-badge {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--background) 92%, transparent), color-mix(in srgb, var(--accent) 85%, transparent));
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.profile-header__content {
  min-width: 0;
}

.profile-header__meta {
  display: flex;
  align-items: flex-end;
  min-height: 2.6rem;
  padding: 0 1rem 0.45rem;
  color: color-mix(in srgb, var(--muted-foreground) 55%, transparent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
}

.profile-header__title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem 0;
  border-top: 1px solid var(--line);
}

.profile-header h1 {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.status-dot {
  position: relative;
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2563eb;
}

.status-dot::before {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.24);
}

.profile-header__flipline {
  min-height: 2.7rem;
  padding: 0.55rem 1rem 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted-foreground);
}

#flip-line {
  display: inline-block;
  transition: opacity 180ms ease;
}

#flip-line.is-swapping {
  opacity: 0;
}

.separator {
  height: 2rem;
  background:
    repeating-linear-gradient(315deg, color-mix(in srgb, var(--line) 64%, transparent) 0, color-mix(in srgb, var(--line) 64%, transparent) 1px, transparent 1px, transparent 50%),
    transparent;
  background-size: 10px 10px;
}

.panel__header {
  padding: 0.95rem 1rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.panel__count {
  top: -0.4em;
  position: relative;
  margin-left: 0.35rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
}

.panel__body {
  padding: 1rem;
}

.panel__body--stack {
  display: grid;
  gap: 1rem;
}

.panel__body--flush {
  padding: 0 1rem;
}

.overview-jobs,
.overview-grid,
.two-column-grid {
  display: grid;
  gap: 0.85rem;
}

.overview-grid,
.two-column-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.intro-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.intro-row p {
  min-width: 0;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.intro-row a {
  text-decoration: none;
}

.intro-row a:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.intro-icon,
.social-link__icon,
.project-item__logo,
.experience-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid color-mix(in srgb, var(--muted-foreground) 15%, transparent);
  border-radius: 0.72rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--background) 92%, transparent), color-mix(in srgb, var(--accent) 82%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1;
  overflow: hidden;
}

.intro-icon svg,
.social-link__icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.social-link__icon {
  width: 2rem;
  height: 2rem;
}

.social-link__icon svg {
  width: 1.12rem;
  height: 1.12rem;
}

.muted-inline {
  color: var(--muted-foreground);
}

.panel--social {
  position: relative;
}

.social-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.social-grid::before,
.social-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.social-grid::before {
  left: 50%;
}

.social-grid::after {
  display: none;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 4rem;
  padding: 1rem;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.social-link:nth-child(-n + 2),
.social-link:nth-child(3),
.social-link:nth-child(4) {
  border-bottom: 1px solid var(--line);
}

.social-link:hover {
  background: color-mix(in srgb, var(--accent) 72%, transparent);
}

.social-link__title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.social-link__arrow {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0;
}

.social-link__arrow::before {
  content: "\2197";
  font-size: 1rem;
  line-height: 1;
}

.prose-block,
.project-item__content p,
.info-list p {
  color: var(--muted-foreground);
}

.prose-block {
  font-size: 1rem;
}

.about-list {
  display: grid;
  gap: 0.9rem;
  padding-left: 1.1rem;
}

.tag-list,
.info-list {
  list-style: none;
}

.stack-panel {
  display: grid;
  gap: 0.95rem;
}

.stack-intro {
  color: var(--muted-foreground);
  font-size: 0.96rem;
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.stack-pill {
  display: inline-flex;
}

.stack-pill__link,
.stack-pill__plain {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem 0.125rem 0.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 70%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--foreground);
  text-decoration: none;
  user-select: none;
}

.stack-pill__link {
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stack-pill__link:hover {
  background: color-mix(in srgb, var(--accent) 92%, var(--foreground));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 100%, transparent);
  transform: translateY(-1px);
}

.stack-pill__link:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.stack-pill__plain {
  color: var(--muted-foreground);
}

/* Brand logo rendered from a monochrome SVG via CSS mask, tinted by --stack-accent. */
.stack-pill__icon {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  background-color: var(--stack-accent, var(--foreground));
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* Brands whose logo color is too dark for the dark theme can opt into a lighter tint. */
body[data-theme="dark"] .stack-pill__icon {
  background-color: var(--stack-accent-dark, var(--stack-accent, var(--foreground)));
}

/* Small neutral dot for concept pills that have no brand logo. */
.stack-pill__dot {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.18rem;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.stack-pill__label {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 78%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

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

.experience-card+.experience-card {
  border-top: 1px solid var(--line);
}

.experience-card__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.95rem;
}

.experience-card__head h3,
.stack-list h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.experience-card__head p {
  color: var(--muted-foreground);
  font-size: 0.92rem;
}

.experience-card__timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-left: 0.9rem;
  padding-left: 1.2rem;
}

.experience-card__timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.26rem;
  width: 1px;
  background: var(--border);
}

.position-item {
  position: relative;
  display: flex;
  gap: 0.9rem;
}

.position-item__marker {
  position: absolute;
  top: 0.52rem;
  left: -1.18rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--foreground);
}

.position-item__title {
  margin-bottom: 0.28rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.position-item p {
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

.project-list {
  display: grid;
}

.project-item {
  border-top: 1px solid var(--line);
}

.project-item:first-child {
  border-top: 0;
}

.project-item__summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  list-style: none;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.project-item__summary::-webkit-details-marker {
  display: none;
}

.project-item__summary:hover {
  background: color-mix(in srgb, var(--accent) 72%, transparent);
}

.project-item__heading {
  display: grid;
  flex: 1;
  gap: 0.18rem;
  min-width: 0;
}

.project-item__title {
  font-weight: 500;
  line-height: 1.25;
}

.project-item__meta {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.project-item__caret {
  margin-left: auto;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0;
  transition: transform 160ms ease;
}

.project-item__caret::before {
  content: "\2304";
  font-size: 1rem;
  line-height: 1;
}

.project-item[open] .project-item__caret {
  transform: rotate(180deg);
}

.project-item__content {
  display: grid;
  gap: 0.9rem;
  padding: 0 1rem 1rem 3.75rem;
  border-top: 1px solid var(--line);
}

.project-item__repo-row {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.project-item__repo {
  text-decoration: none;
}

.project-item__repo:hover {
  text-decoration: underline;
}

.two-column-grid {
  align-items: start;
}

.stack-list {
  display: grid;
  gap: 0.85rem;
}

.info-list {
  display: grid;
}

.info-list li {
  display: grid;
  gap: 0.18rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.info-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.info-list strong,
.info-list strong a {
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
}

.info-list strong a:hover {
  text-decoration: underline;
}

.info-list span {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.2rem;
  padding: 0.85rem 1rem;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

@media (min-width: 820px) {
  .social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .social-grid::after {
    display: block;
    left: 66.666%;
  }

  .social-grid::before {
    left: 33.333%;
  }

  .social-link:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .social-link:nth-child(4),
  .social-link:nth-child(5),
  .social-link:nth-child(6) {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {

  .topbar,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__actions {
    flex-wrap: wrap;
  }

  .profile-header {
    grid-template-columns: 1fr;
  }

  .profile-header__avatar {
    justify-content: flex-start;
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .overview-grid,
  .two-column-grid {
    grid-template-columns: 1fr;
  }

  .project-item__summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-item__content {
    padding-left: 1rem;
  }
}

@media (max-width: 540px) {
  .site-shell {
    width: min(calc(100% - 0.5rem), 48rem);
  }

  .topbar,
  .panel__header,
  .panel__body,
  .project-item__summary,
  .site-footer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .profile-header__meta,
  .profile-header__title-row,
  .profile-header__flipline {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .social-link {
    padding: 0.9rem 0.85rem;
  }

  .stack-cloud {
    gap: 0.45rem;
  }

  .stack-pill__label,
  .stack-intro {
    font-size: 0.82rem;
  }

  .profile-cover__monogram {
    min-width: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
