:root {
  --bg: #1e1e1e;
  --surface: #252526;
  --surface-2: #2d2d2d;
  --border: #3c3c3c;
  --ink: #d4d4d4;
  --ink-soft: #9d9d9d;
  --ink-dim: #6a6a6a;
  --accent: #6fcf8a;
  --accent-2: #2f9e6f;
  --accent-gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --mono: "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-2);
  color: #0c0c0c;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* photo spans the page right of the sidebar; the dark gradient tint (same color as --bg) fades
   it out toward the text side without fully hiding it. Box is taller than the viewport (125vh)
   so it always fully covers it; the extra 25vh hangs below at rest and the scroll listener in
   script.js translates it up into view, so the visible area never runs out of image */
.bg-image {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  height: 125vh;
  z-index: 0;
  pointer-events: none;
  display: none;
  will-change: transform;
  background-image:
    linear-gradient(to left, rgba(30, 30, 30, 0.3) 0%, rgba(30, 30, 30, 0.72) 45%, rgba(30, 30, 30, 0.94) 100%),
    url("img/waterfall.jpg");
  background-size: cover, cover;
  background-position: right center, right center;
  background-repeat: no-repeat, no-repeat;
  filter: grayscale(0.35) brightness(0.48) contrast(1.05);
}

@media (min-width: 1150px) {
  .bg-image {
    display: block;
  }
}

.mono {
  font-family: var(--mono);
}

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

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* gradient-text hover/active links: shared by sidebar nav, meta-block, project cards, contact list */
.sidebar nav a.active,
.meta-block a:hover,
.card h3 a:hover,
.contact-list a:hover {
  background-image: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: #191919;
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  z-index: 2;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 22px;
  cursor: default;
}

.nav-group-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0 0 8px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
}

.sidebar nav a {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-left: 2px solid transparent;
  white-space: nowrap;
}

.sidebar nav a:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
}

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

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

  .sidebar {
    display: none;
  }
}

main.content {
  max-width: 900px;
  min-width: 0;
  padding: 56px 40px 100px;
  position: relative;
}

@media (max-width: 820px) {
  main.content {
    padding: 36px max(20px, env(safe-area-inset-right)) 80px max(20px, env(safe-area-inset-left));
  }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  margin: 0 0 10px;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.role {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.meta-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  margin-bottom: 40px;
}

.meta-block .k {
  color: var(--ink-dim);
}

.meta-block .v {
  color: var(--ink);
}

section {
  margin-top: 48px;
  scroll-margin-top: 24px;
}

section h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-note {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.about p {
  max-width: 62ch;
  color: var(--ink-soft);
}

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

.role-item {
  margin-bottom: 22px;
}

.role-item:last-child {
  margin-bottom: 0;
}

.role-item-head,
.role-sub-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.role-item-title {
  font-weight: 600;
  font-size: 14.5px;
}

.role-item-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.role-item p,
.role-sub-item p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 58ch;
}

.role-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.role-logo {
  width: 20px;
  height: 20px;
  object-fit: cover;
  background: #fff;
  border-radius: 3px;
  flex-shrink: 0;
}

.role-group-title {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1;
  margin: 0;
}

.role-sub-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.role-sub-item-title {
  font-size: 13.5px;
  color: var(--ink);
}

.role-sub-item-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.name-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.role-item .name-tags {
  margin-bottom: 10px;
}

.card .name-tags {
  margin-bottom: 5px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  cursor: default;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

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

.grid:not(.expanded) .card-extra {
  display: none;
}

.show-toggle {
  display: block;
  margin: 16px auto 0;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 16px;
  cursor: pointer;
}

.show-toggle:hover {
  color: var(--accent);
  border-color: var(--ink-dim);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.card:hover {
  border-color: var(--ink-dim);
}

.card-img-link {
  display: block;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 16/6.5;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

@media (hover: hover) and (pointer: fine) {
  .card img {
    filter: brightness(0.6) blur(4px);
    transform: scale(1.03);
    transition: filter .25s ease, transform .25s ease;
  }

  .card:hover img,
  .card:focus-within img {
    filter: brightness(1) blur(0);
    transform: scale(1.06);
  }
}

@media (hover: none) {
  .card img {
    filter: brightness(0.9) blur(1px);
  }
}

.card-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 16/6.5;
  padding: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.card:hover .card-noimg {
  color: var(--ink-soft);
}

.card-body {
  padding: 10px 14px 12px;
}

.card .card-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  margin-bottom: 5px;
}

.card h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.card .card-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card .card-desc.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.card-more {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.card-more:hover {
  color: var(--accent);
}

.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.edu-row .name {
  font-weight: 600;
  font-size: 14px;
}

.edu-row .note {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-dim);
}

.edu-row .sub {
  color: var(--ink-soft);
  font-size: 13px;
}

.edu-row .date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

footer {
  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

footer .footer-chart {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent-2);
  line-height: 1;
  cursor: default;
  user-select: none;
  min-width: 0;
  overflow: hidden;
}

footer.no-chart .footer-chart {
  display: none;
}
