:root {
  color-scheme: light;
  --ink: #121314;
  --muted: #5d636b;
  --line: #d8dde2;
  --paper: #f7f9fb;
  --white: #ffffff;
  --blue: #5ea6d8;
  --blue-soft: #d9edf8;
  --red: #b94536;
  --green: #8ba83f;
  --graphite: #252a2e;
  --shadow: 0 24px 70px rgba(18, 19, 20, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(18, 19, 20, 0.055) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, rgba(18, 19, 20, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
}

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

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

.page-rail {
  position: fixed;
  inset: 0 auto 0 34px;
  width: 1px;
  background: var(--line);
  z-index: 0;
}

.admin-door {
  position: fixed;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  border: 0;
  background: transparent;
  cursor: default;
  z-index: 30;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  min-height: 76px;
  padding: 18px clamp(22px, 5vw, 76px);
  border-bottom: 1px solid rgba(18, 19, 20, 0.08);
  background: rgba(247, 249, 251, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 5px 5px 0 var(--ink);
}

.nav-links {
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a:hover,
.text-link:hover {
  color: var(--red);
}

.top-actions {
  gap: 14px;
}

.text-link {
  color: var(--muted);
  font-weight: 800;
}

.lang-toggle,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--ink);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.lang-toggle,
.button-secondary {
  background: var(--white);
  color: var(--ink);
}

.button-primary {
  background: var(--ink);
  color: var(--white);
}

.button-primary:hover,
.button-secondary:hover,
.lang-toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--blue);
}

main {
  position: relative;
  z-index: 1;
}

.hero-section {
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  padding: clamp(24px, 4.5vw, 64px) clamp(22px, 5vw, 76px) clamp(38px, 6vw, 78px);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(36px, 7vw, 92px);
  align-items: center;
  width: 100%;
}

.hero-copy {
  padding-left: clamp(18px, 2.5vw, 48px);
}

.kicker,
.section-kicker {
  margin: 0 0 16px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(50px, 10.8vw, 160px);
  line-height: 0.86;
}

.hero-name-line {
  display: block;
}

.hero-title {
  max-width: 780px;
  margin: 28px 0 0;
  color: var(--graphite);
  font-size: clamp(24px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.05;
}

.hero-about {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-contact-links {
  display: grid;
  gap: 10px;
  max-width: 780px;
  margin-top: 22px;
}

.hero-contact-label {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  max-width: 100%;
  padding: 7px 14px;
  border: 1.5px solid var(--ink);
  background: rgba(255, 255, 255, 0.78);
  color: var(--graphite);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.08;
  box-shadow: 4px 4px 0 rgba(18, 19, 20, 0.08);
}

.hero-contact-link span:first-child {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.hero-contact-link small {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-contact-link:hover {
  background: var(--blue-soft);
  transform: translate(-1px, -1px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-card {
  align-self: center;
  justify-self: end;
  width: clamp(380px, 25vw, 470px);
  border: 1.5px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.portrait-shell {
  position: relative;
  aspect-ratio: 4 / 5;
  border-bottom: 1.5px solid var(--ink);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(94, 166, 216, 0.44), transparent 45%),
    linear-gradient(315deg, rgba(185, 69, 54, 0.2), transparent 48%),
    #eaf0f4;
}

.portrait-empty {
  position: absolute;
  inset: 24px;
  display: grid;
  place-content: center;
  border: 1.5px dashed rgba(18, 19, 20, 0.42);
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
}

.portrait-empty small {
  margin-top: 6px;
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-facts {
  margin: 0;
  padding: 0;
}

.quick-facts div {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.quick-facts div:last-child {
  border-bottom: 0;
}

.quick-facts dt {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-facts dd {
  margin: 0;
  color: var(--graphite);
  font-weight: 800;
}

.band {
  padding: clamp(58px, 8vw, 104px) clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 830px;
  margin-bottom: 34px;
}

.section-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.98;
}

.education-list,
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.edu-card,
.project-card,
.stack-card,
.publication-card {
  border: 1.5px solid var(--ink);
  background: var(--white);
  box-shadow: 9px 9px 0 rgba(18, 19, 20, 0.08);
}

.edu-card,
.project-card,
.stack-card {
  padding: 24px;
}

.edu-card .period,
.stack-card .period,
.news-date {
  color: var(--red);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
}

.edu-card h3,
.project-card h3,
.stack-card h3 {
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.1;
}

.edu-card p,
.project-card p,
.stack-card p,
.publication-card p,
.news-item p {
  color: var(--muted);
  line-height: 1.65;
}

.edu-card strong,
.stack-card strong {
  display: block;
  margin-top: 8px;
}

.stack-detail-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.stack-detail {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stack-detail strong {
  margin-top: 0;
  color: var(--graphite);
  font-size: 15px;
}

.stack-detail p {
  margin: 6px 0 0;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 86px);
  align-items: start;
}

.sticky-head {
  position: sticky;
  top: 106px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tag,
.project-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
}

.stack-list {
  display: grid;
  gap: 16px;
}

.publication-band {
  background: var(--graphite);
}

.publication-band .section-title {
  color: var(--white);
}

.publication-card {
  max-width: 980px;
  padding: clamp(28px, 5vw, 52px);
}

.publication-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.publication-footer p {
  margin-bottom: 0;
}

.publication-footer .button-secondary {
  flex-shrink: 0;
}

.publication-card h3 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(26px, 3.3vw, 46px);
  line-height: 1.05;
  max-width: 900px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 310px;
}

.project-card p {
  flex: 1;
}

.project-card a {
  align-self: flex-start;
  margin-top: 22px;
}

.stack-action,
.publication-card .button-secondary {
  display: inline-flex;
  margin-top: 18px;
}

.publication-card .button-secondary {
  background: var(--white);
}

.news-list {
  display: grid;
  gap: 0;
  border-top: 1.5px solid var(--ink);
}

.news-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.admin-dialog {
  width: min(980px, calc(100vw - 30px));
  max-height: calc(100vh - 40px);
  border: 1.5px solid var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-dialog::backdrop {
  background: rgba(18, 19, 20, 0.45);
  backdrop-filter: blur(5px);
}

.dialog-close-form {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}

.icon-close {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--ink);
  background: var(--white);
  font-size: 24px;
  cursor: pointer;
}

.admin-panel {
  padding: 32px;
}

.admin-copy,
.admin-message {
  color: var(--muted);
  line-height: 1.6;
}

.admin-field {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  font-weight: 900;
}

.admin-field input,
.content-json {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
}

.content-json {
  width: 100%;
  min-height: 52vh;
  margin-top: 16px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-button {
  min-width: 126px;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-grid,
  .split-band,
  .education-list,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero-card {
    justify-self: start;
    width: min(320px, 100%);
  }

  .sticky-head {
    position: static;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 14px 16px;
    gap: 12px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero-section,
  .band {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-contact-links {
    display: grid;
  }

  .hero-contact-list {
    display: grid;
  }

  .hero-contact-link {
    width: 100%;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quick-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.inline-link {
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--blue);
}

.education-list {
  grid-template-columns: 1fr;
}

.point-list {
  margin: 14px 0 0;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.65;
  list-style: disc;
}

.point-list li + li {
  margin-top: 6px;
}

.point-list li::marker {
  color: var(--blue);
}

.stack-detail .point-list {
  margin-top: 6px;
}
