:root {
  color-scheme: dark;
  --ink: #f3f0e5;
  --muted: #c8c1ad;
  --paper: #171a16;
  --surface: rgba(17, 20, 17, 0.78);
  --surface-strong: rgba(9, 11, 9, 0.84);
  --line: rgba(237, 229, 199, 0.2);
  --accent: #d6c36a;
  --accent-strong: #fff0a6;
  --warm: #d99a64;
  --subtitle: #e5b17c;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

@font-face {
  font-family: "SF Gothican";
  src: url("../assets/font/SF-Gothican.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: url("../assets/img/background.jpg") center / cover no-repeat;
}

body::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 12, 10, 0.72), rgba(10, 12, 10, 0.28)),
    radial-gradient(circle at 20% 22%, rgba(214, 195, 106, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(5, 6, 5, 0.12), rgba(5, 6, 5, 0.62));
}

a {
  color: inherit;
}

.site-header {
  width: 100%;
  margin: 0;
}

.about-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 6vw, 80px);
}

.brand-nav {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.brand,
.brand-divider,
.kicker {
  color: var(--ink);
  font-family: "SF Gothican", "Cooper Black", Georgia, serif;
  font-synthesis: weight;
  font-weight: 700;
  line-height: 1;
  text-shadow:
    0 3px 4px rgba(0, 0, 0, 0.48),
    0 0 1px rgba(255, 255, 255, 0.35);
}

.brand {
  font-size: 1.7rem;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.brand:hover,
.brand:focus-visible {
  color: var(--accent-strong);
  outline: none;
  text-decoration-line: underline;
}

.brand-divider {
  font-size: 1.7rem;
  opacity: 0.72;
}

.about-shell {
  padding: 38px 0 78px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(0, 1.26fr);
  gap: clamp(34px, 6vw, 72px);
  align-items: start;
}

.portrait {
  position: sticky;
  top: 28px;
  margin: 0;
}

.portrait-fade {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 0.76;
  overflow: visible;
  background: transparent;
  filter: drop-shadow(0 26px 54px rgba(0, 0, 0, 0.36));
}

.portrait-fade img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.18) contrast(1.12) saturate(0.78);
  transform: scale(1.055);
  clip-path: polygon(8% 5%, 86% 2%, 98% 16%, 96% 80%, 82% 96%, 23% 94%, 5% 82%, 0 21%);
  -webkit-mask-image: radial-gradient(ellipse at 49% 54%, #000 0 34%, rgba(0, 0, 0, 0.9) 43%, rgba(0, 0, 0, 0.48) 53%, rgba(0, 0, 0, 0.12) 61%, transparent 69%);
  mask-image: radial-gradient(ellipse at 49% 54%, #000 0 34%, rgba(0, 0, 0, 0.9) 43%, rgba(0, 0, 0, 0.48) 53%, rgba(0, 0, 0, 0.12) 61%, transparent 69%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.kicker {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(1.35rem, 2.8vw, 2.6rem);
}

h1 {
  max-width: 8ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.intro-subtitle {
  max-width: 600px;
  margin: 28px 0 0;
  color: var(--subtitle);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.22rem, 2.2vw, 1.72rem);
  font-style: italic;
  line-height: 1.28;
}

.bio-card {
  margin-top: 32px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.bio-card p {
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.76;
}

.bio-card p + p {
  margin-top: 1.08em;
}

.bio-card a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.bio-card a:hover,
.bio-card a:focus-visible {
  color: #fff;
  outline: none;
}

cite {
  font-style: italic;
}

.timeline-link {
  position: relative;
  display: inline-grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: min(100%, 420px);
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 240, 166, 0.36);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22px 50%, rgba(255, 240, 166, 0.22), transparent 52px),
    var(--surface);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(214, 195, 106, 0.12);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.timeline-link::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 34%, rgba(255, 240, 166, 0.14) 44%, transparent 54% 100%);
  content: "";
  transform: translateX(-120%);
  animation: timeline-sweep 3.8s ease-in-out infinite;
  pointer-events: none;
}

.timeline-link:hover,
.timeline-link:focus-visible {
  border-color: rgba(255, 240, 166, 0.72);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.44),
    0 0 34px rgba(214, 195, 106, 0.2);
  outline: none;
  transform: translateY(-3px);
}

.timeline-link strong,
.timeline-link small {
  display: block;
}

.timeline-link strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.1;
}

.timeline-link small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.timeline-link-mark {
  position: relative;
  width: 34px;
  height: 42px;
}

.timeline-link-mark::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent-strong);
  box-shadow: 0 0 16px rgba(255, 240, 166, 0.45);
  content: "";
}

.timeline-link-mark::after {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow:
    0 15px 0 var(--accent),
    0 30px 0 #9eb9a6;
  content: "";
  transform: translateX(-5px);
}

@keyframes timeline-sweep {
  0%,
  58% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

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

  .portrait {
    position: static;
  }

  .portrait-fade {
    width: 100%;
  }

}

@media (max-width: 520px) {
  .site-header,
  .about-shell {
    width: min(100% - 32px, 1120px);
  }

  h1 {
    max-width: 9ch;
  }

  .bio-card {
    padding: 20px;
  }

  .timeline-link {
    max-width: 100%;
  }
}

/* Anchored site menu replacing the old breadcrumb. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  overflow: visible;
  border-bottom: 1px solid rgba(237, 229, 199, 0.08);
  background: linear-gradient(180deg, rgba(12, 14, 12, 0.5), rgba(12, 14, 12, 0.18));
  backdrop-filter: blur(8px);
}

.site-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px clamp(14px, 2vw, 24px);
  overflow: visible;
}

.brand-menu-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.brand-submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 90;
  display: grid;
  gap: 4px;
  min-width: 178px;
  padding: 10px;
  border: 1px solid rgba(237, 229, 199, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 20, 17, 0.9), rgba(8, 10, 8, 0.82));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(14px);
}

.brand-menu-item::after {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
  content: "";
}

.brand-menu-item:hover .brand-submenu,
.brand-menu-item:focus-within .brand-submenu {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.brand-submenu a {
  color: var(--ink);
  font-family: "SF Gothican", "Cooper Black", Georgia, serif;
  font-synthesis: weight;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-shadow:
    0 3px 4px rgba(0, 0, 0, 0.48),
    0 0 1px rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.brand-submenu a:hover,
.brand-submenu a:focus-visible {
  color: var(--accent-strong, var(--accent, #fff0a6));
  outline: none;
  text-decoration-line: underline;
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-menu {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .brand,
  .brand-submenu a {
    font-size: 1.32rem;
    white-space: nowrap;
  }
}

/* Collapsible menu for mobile. */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 38px;
  border: 1px solid rgba(237, 229, 199, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 20, 17, 0.62), rgba(8, 10, 8, 0.42));
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}

.menu-toggle span + span {
  display: none;
}

@media (max-width: 760px) {
  .site-menu {
    position: relative;
    display: grid;
    justify-items: start;
    gap: 0;
    max-width: min(360px, calc(100vw - 28px));
    overflow: visible;
    padding-bottom: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-menu > :not(.menu-toggle) {
    display: none;
  }

  .site-menu.is-open {
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(237, 229, 199, 0.16);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(17, 20, 17, 0.88), rgba(8, 10, 8, 0.76));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
  }

  .site-menu.is-open > .brand {
    display: block;
  }

  .site-menu.is-open > .brand-menu-item {
    display: grid;
    gap: 4px;
  }

  .site-menu.is-open .brand-menu-item::after {
    content: none;
  }

  .site-menu.is-open .brand-submenu {
    position: static;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0 0 2px 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: none;
    backdrop-filter: none;
  }

  .site-menu.is-open .brand-submenu a {
    font-size: 1.12rem;
    opacity: 0.86;
  }
}

/* Mobile menu floats over the page instead of pushing content. */
@media (max-width: 760px) {
  .site-header {
    left: 0;
    right: 0;
    width: 100vw;
    max-width: none;
    min-height: 58px;
    margin: 0;
    padding: 10px clamp(14px, 4vw, 22px);
    background: linear-gradient(180deg, rgba(12, 14, 12, 0.54), rgba(12, 14, 12, 0.2));
  }

  .site-menu {
    position: absolute;
    top: 10px;
    left: clamp(14px, 4vw, 22px);
    z-index: 95;
    width: max-content;
    max-width: min(360px, calc(100vw - 28px));
  }

  .site-menu.is-open {
    width: min(360px, calc(100vw - 28px));
  }

  .header-tools {
    margin-top: 52px;
  }
}
