:root {
  --bg: #12201A;
  --bg-alt: #0F1B16;
  --card: #182A22;
  --text: #EDE6D2;
  --text-soft: #AEB9AC;
  --text-mute: #8A9488;
  --accent: #C79A4B;
  --line: #33453A;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}

a { color: inherit; }
img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 20px;
  }
}

/* TOP BAR & LANGUAGE SWITCHER */
.top-bar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
}

.lang-switch {
  display: flex;
  gap: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}

.lang-switch a {
  text-decoration: none;
  color: var(--text-mute);
  transition: color 0.2s ease;
}

.lang-switch a.active {
  color: var(--accent);
}

.lang-switch a:hover:not(.active) {
  color: var(--text);
}

/* FAMILY BAR (SPECIALIST PAGES) */
.family-bar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.family-bar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
}

.family-links {
  display: flex;
  gap: 22px;
}

.family-links a {
  text-decoration: none;
  color: var(--text-mute);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.family-links a:hover {
  color: var(--text);
}

.family-links a.current {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .family-links {
    gap: 14px;
    font-size: 0.76rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .family-links::-webkit-scrollbar {
    display: none;
  }
}

/* STICKY NAVIGATION BAR */
nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 32, 26, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 20px;
}

.nav-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color .2s ease, color .2s ease;
}

.nav-links a:hover {
  color: var(--text);
  border-color: var(--accent);
}

@media (max-width: 860px) {
  nav .wrap {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nav-name {
    font-size: 1rem;
  }
  .nav-links {
    display: flex;
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-links a {
    font-size: 0.82rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
  }
}

/* HERO SECTIONS */
header.hero {
  padding: 96px 0 60px;
  border-bottom: 1px solid var(--line);
}

header.hero-index {
  padding: 104px 0 70px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

header.hero-index h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  opacity: 0;
  animation: riseIn .7s ease forwards;
}

header.hero-index .sub {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--text-soft);
  font-size: 1.06rem;
}

.divider-row {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 40px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-mute);
  text-transform: uppercase;
}

.divider-row span {
  padding: 0 18px;
  border-left: 1px solid var(--line);
}

.divider-row span:first-child {
  border-left: none;
}

.hero-top {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap-reverse;
}

.hero-text {
  flex: 1;
  min-width: 280px;
}

.portrait {
  width: 200px;
  height: 240px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.hero-role {
  font-family: 'Fraunces', Georgia, serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  line-height: 1.06;
  opacity: 0;
  animation: riseIn .7s ease forwards;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1, header.hero-index h1 {
    animation: none;
    opacity: 1;
  }
}

.hero-quote {
  max-width: 620px;
  margin-top: 24px;
  font-family: 'Fraunces', Georgia, serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  color: var(--text);
}

.hero-sub {
  max-width: 640px;
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 1rem;
}

.stat-row {
  display: flex;
  margin-top: 46px;
  border-top: 1px solid var(--line);
}

.stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 18px 20px 0 0;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  word-wrap: break-word;
}

.stat:first-child {
  border-left: none;
  padding-left: 0;
}

.stat .num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
}

.stat .lbl {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-top: 4px;
  hyphens: auto;
}

@media (max-width: 900px) {
  .stat-row {
    flex-wrap: wrap;
    row-gap: 24px;
  }
  .stat {
    flex: 1 1 40%;
    border-left: none;
    padding-left: 0;
    padding-right: 0;
  }
}

/* SECTIONS & HEADINGS */
section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

section:nth-of-type(even) {
  background: var(--bg-alt);
}

section:last-of-type {
  border-bottom: none;
}

section.cards {
  padding: 70px 0 100px;
}

.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin-bottom: 34px;
}

.section-head .tag {
  font-size: 0.83rem;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  padding-top: 6px;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: 1.85rem;
}

.lede {
  grid-column: 2;
  max-width: 66ch;
  color: var(--text-soft);
  margin-top: 10px;
}

@media (max-width: 760px) {
  .section-head {
    grid-template-columns: 1fr;
  }
  .lede, .bio-list, .steps, .ledger, .contact-grid, .chip-grid, .edu-list {
    grid-column: 1;
  }
}

/* BIO LIST */
.bio-list {
  grid-column: 2;
  border-top: 1px solid var(--line);
}

.bio-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
}

.bio-row .mark {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  padding-top: 1px;
}

/* STEPS & METHOD */
.steps {
  grid-column: 2;
}

.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.step:last-child {
  border-bottom: 1px solid var(--line);
}

.step .n {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.6rem;
  color: var(--accent);
}

.step h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
}

.step p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.96rem;
}

/* RESULTS HIGHLIGHT */
.results {
  grid-column: 2;
  margin-top: 30px;
  padding: 26px 28px;
  border: 1px solid var(--accent);
  background: rgba(199, 154, 75, 0.06);
  border-radius: 12px;
}

.results p {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1rem;
}

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

.results b {
  color: var(--accent);
}

/* EDUCATION LIST */
.edu-list {
  grid-column: 2;
  border-top: 1px solid var(--line);
}

.edu-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.edu-row .deg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-mute);
}

.edu-row .what {
  color: var(--text-soft);
  font-size: 0.96rem;
}

.edu-row .what b {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 680px) {
  .edu-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* EXPERIENCE & ROLES */
.ledger {
  grid-column: 2;
}

.role {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.role:last-child {
  border-bottom: 1px solid var(--line);
}

.role .period {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-mute);
  padding-top: 3px;
}

.role .company {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.role .title {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.role ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.role li {
  margin-bottom: 5px;
}

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

.role p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  max-width: 74ch;
}

@media (max-width: 760px) {
  .role {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.affil {
  grid-column: 2;
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.affil b {
  color: var(--text);
}

/* HOME PAGE CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mono-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
}

.card h2 {
  font-size: 1.5rem;
  margin: 0;
}

.card-role {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-soft);
}

.card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

.go {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--accent);
}

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

/* CHIPS & PROJECT CARDS */
.chip-grid {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1.4;
}

.chip-col {
  flex-direction: column;
  gap: 4px;
  padding: 14px 22px;
}

.mono-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 2px;
  text-transform: uppercase;
}

.chip:hover, .chip.active {
  background: rgba(199, 154, 75, 0.05);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.project-card .k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.project-card h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
}

/* FOOTER & CONTACTS */
footer {
  padding: 56px 0 40px;
}

footer.footer-index {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  text-align: center;
}

footer.footer-index p {
  color: var(--text-mute);
  font-size: 0.85rem;
  margin: 0;
}

footer .section-head {
  display: block;
  margin-bottom: 0;
  text-align: center;
}

footer .section-head .tag {
  padding-top: 0;
  text-align: left;
}

.contact-grid {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  margin-top: 26px;
}

.contact-item {
  text-align: center;
}

.contact-item .lbl {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.contact-item .val {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.contact-item a {
  text-decoration: none;
}

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

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.contact-icon:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .contact-grid {
    gap: 20px;
  }
}

.foot-rule {
  grid-column: 2;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 18px;
  font-size: 0.85rem;
  color: var(--text-mute);
}
