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

:root {
  color-scheme: dark;
  --bg: #0c0c0d;
  --bg-raise: #151517;
  --bg-hover: rgba(255, 255, 255, 0.038);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-highlight: rgba(255, 255, 255, 0.1);
  --fg: #ededee;
  --fg-2: #a8a8b0;
  --fg-3: #8a8a93;
  /* WCAG AA compliant muted text (~5.65:1 on #0c0c0d) */
  --fg-4: #3a3a3f;
  --accent: #c8f560;
  /* soft lime — terminal-ish without being "green on black" */
  --accent-dim: rgba(200, 245, 96, 0.12);
  --accent-border: rgba(200, 245, 96, 0.22);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  --serif: 'Fraunces', Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 350;
  line-height: 1.68;
  overflow-x: hidden;
}

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

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

/* ───── Focus & Skip Link (WCAG 2.2 AA) ───── */
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

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

em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1em;
  font-weight: 350;
  color: var(--fg);
  letter-spacing: 0;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

/* ───── Ambient layers ───── */
.spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle closest-side, rgba(200, 245, 96, 0.05), transparent);
  contain: strict;
  will-change: transform;
  transition: opacity 0.6s ease;
}

.spotlight.on {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .spotlight {
    display: none;
  }
}

/* ───── Layout ───── */
.layout {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 5rem;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6rem 0 4rem;
}

.content {
  padding: 6rem 0 3rem;
}

/* ───── Side ───── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
  margin-bottom: 2.5rem;
}

.status .sep {
  color: var(--fg-4);
}

.status-dot {
  width: 7px;
  height: 14px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(200, 245, 96, 0.4);
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {

  0%,
  55% {
    opacity: 1;
  }

  56%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none !important;
  }
}

.name {
  font-size: clamp(2.4rem, 4.2vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--fg);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.role {
  font-size: 1.15rem;
  color: var(--fg-2);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  max-width: 26ch;
  line-height: 1.4;
  text-wrap: balance;
}

.intro {
  max-width: 34ch;
  color: var(--fg-3);
  text-wrap: pretty;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 3.5rem;
  width: fit-content;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.25rem;
  margin-left: -0.25rem;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color 0.25s;
}

.nav-line {
  width: 2rem;
  height: 1px;
  background: currentColor;
  transition: width 0.35s var(--ease), background-color 0.25s;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  color: var(--fg);
}

.nav a.active .nav-line {
  background: var(--accent);
}

.nav a:hover .nav-line,
.nav a:focus-visible .nav-line,
.nav a.active .nav-line {
  width: 4rem;
}

.side-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-3);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  margin-left: -0.5rem;
  transition: color 0.2s, background-color 0.2s;
}

.kbd-hint span {
  margin-left: 0.35rem;
}

.kbd-hint:hover,
.kbd-hint:focus-visible {
  color: var(--fg);
  background: var(--bg-hover);
}

.socials {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin-right: -0.45rem;
}

.socials a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--fg-3);
  transition: color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--fg);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

/* ───── Blocks ───── */
.block {
  margin-bottom: 7rem;
  scroll-margin-top: 6rem;
}

.block-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.block-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--fg-4);
  transition: background 0.3s, box-shadow 0.3s;
}

.block.in-view .block-title::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 245, 96, 0.45);
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 2.5rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.1rem;
  text-wrap: pretty;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text p:first-child {
  color: var(--fg);
}

.hl {
  color: var(--fg);
  font-weight: 450;
}

.portrait img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 22px;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.88;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 32px -12px rgba(0, 0, 0, 0.65);
  transition: filter 0.6s var(--ease), opacity 0.6s, transform 0.6s var(--ease), border-radius 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.portrait img:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: rotate(-3deg) scale(1.04);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent-border), 0 18px 36px -12px rgba(0, 0, 0, 0.75);
}

/* "View all" link */
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--fg-4);
  padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s;
}

.more-link:hover,
.more-link:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* Lists (experience / education) */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Dim siblings when one is hovered or focused */
.list:hover .item,
.list:focus-within .item {
  opacity: 0.5;
}

.list .item:hover,
.list .item:focus-within {
  opacity: 1;
}

.item {
  transition: opacity 0.3s;
}

.item-link {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  margin: 0 -1.25rem;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 0 transparent;
  transition: background-color 0.3s, box-shadow 0.3s;
}

a.item-link:hover,
a.item-link:focus-visible {
  background: var(--bg-hover);
  box-shadow: inset 0 1px 0 0 var(--border-highlight), 0 10px 30px -15px rgba(0, 0, 0, 0.5);
}

div.item-static:hover {
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 0 var(--border-subtle);
}

.item-date {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
  padding-top: 0.2rem;
  white-space: nowrap;
}

.item h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  text-wrap: balance;
  transition: color 0.25s;
}

.at {
  color: var(--fg-2);
  font-weight: 400;
}

.ext {
  display: inline-block;
  font-size: 12px;
  color: var(--fg-3);
  margin-left: 0.15rem;
  transition: transform 0.25s var(--ease), color 0.25s;
}

a.item-link:hover h3,
a.item-link:focus-visible h3 {
  color: var(--accent);
}

a.item-link:hover .ext,
a.item-link:focus-visible .ext {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.item p {
  font-size: 14px;
  text-wrap: pretty;
}

.muted {
  color: var(--fg-3);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.4rem;
  row-gap: 0.45rem;
  margin-top: 1.1rem;
}

/* Highlighter-marker swipe behind each tag */
.chips li {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
  padding: 0 0.3rem;
  border-radius: 2px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 45%;
  transition: background-size 0.45s var(--ease), background-image 0.3s, color 0.3s;
}

.item-link:hover .chips li,
.item-link:focus-visible .chips li {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 100%;
  color: var(--bg);
}

.badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  margin-left: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--fg-2);
  vertical-align: 1px;
}

/* Stack */
.stack {
  display: flex;
  flex-direction: column;
}

.stack-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding: 0.85rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.stack-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.stack-row+.stack-row {
  background-image: linear-gradient(90deg, var(--fg-4) 0 2px, transparent 2px 6px);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  background-position: top;
}

.stack dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  padding-top: 0.15rem;
}

.stack dd {
  color: var(--fg);
  text-wrap: pretty;
}

/* Contact */
.contact-lead {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--fg);
  font-weight: 450;
  max-width: 22ch;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  height: 42px;
  padding: 0 1.15rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--fg);
  background-color: rgba(255, 255, 255, 0.055);
  background-image: linear-gradient(180deg, transparent, transparent);
  box-shadow: inset 0 1px 0 0 transparent, 0 0 0 0 transparent;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

/* Same hover language as the project cards: lit top edge, soft light from above, lifted shadow */
.btn:hover,
.btn:focus-visible {
  background-color: rgba(255, 255, 255, 0.09);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 70%);
  border-color: var(--border-highlight);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.25),
    0 12px 24px -12px rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 4px 10px -6px rgba(0, 0, 0, 0.6);
}

.btn.primary {
  background-color: var(--fg);
  color: var(--bg);
  border-color: transparent;
}

.btn.primary:hover,
.btn.primary:focus-visible {
  background-color: var(--accent);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 70%);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.15),
    0 12px 26px -10px rgba(200, 245, 96, 0.4);
}


.btn-hint {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.65;
}

.foot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 6rem;
  font-size: 12px;
  color: var(--fg-3);
}

/* ───── Command palette ───── */
.palette {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  justify-items: center;
  align-items: start;
  padding-top: 18vh;
}

.palette[hidden] {
  display: none;
}

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.palette-panel {
  position: relative;
  width: min(560px, calc(100% - 2rem));
  background: rgba(24, 24, 27, 0.94);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border-highlight), 0 30px 80px -20px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  animation: pop 0.25s var(--ease);
}

.palette-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 1.15rem 1.25rem;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.palette-input:focus-visible {
  outline: none;
  box-shadow: 0 1px 0 var(--accent);
}

.palette-input::placeholder {
  color: var(--fg-3);
}

.palette-list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

.palette-group {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-3);
  padding: 0.6rem 0.75rem 0.3rem;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.palette-item[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

.palette-item[aria-selected="true"] .meta {
  color: var(--accent);
}

.palette-item .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
}

.palette-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--fg-3);
  font-size: 13px;
}

.palette-foot {
  display: flex;
  gap: 1.25rem;
  padding: 0.7rem 1.25rem;
  font-size: 11.5px;
  color: var(--fg-3);
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
}

.palette-foot kbd {
  height: 18px;
  min-width: 18px;
  font-size: 10px;
  margin-right: 0.2rem;
}

/* ───── Toast ───── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 60;
  transform: translate(-50%, 1rem);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ───── Motion ───── */
.fade {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  animation: enter 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
  will-change: opacity, transform;
}

@keyframes enter {
  to {
    opacity: 1;
    transform: none;
  }
}

.block {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.block.seen {
  opacity: 1;
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(-6px);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade,
  .block {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .kbd-hint {
    display: none;
  }
}

/* ───── Responsive ───── */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 1.5rem;
  }

  .side {
    position: static;
    height: auto;
    padding: 4rem 0 2.5rem;
    gap: 2rem;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 2rem;
    width: 100%;
  }

  .nav a {
    margin-left: 0;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    font-size: 11px;
  }

  .nav a.active {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
  }

  .nav-line {
    display: none;
  }

  .content {
    padding-top: 1.5rem;
  }

  .block {
    margin-bottom: 5rem;
    scroll-margin-top: 2rem;
  }

}

@media (max-width: 560px) {
  .about {
    grid-template-columns: 1fr;
  }

  .portrait {
    order: -1;
  }

  .item-link,
  .stack-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .item-link {
    padding: 1rem;
    margin: 0 -1rem;
  }

  .btn.primary .btn-label {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
