:root {
  --bg: #17191c;
  --surface: #1f2328;
  --text: #d9dde3;
  --muted: #a8b0ba;
  --accent: #bfc6cf;
  --border: #323842;
}

* {
  box-sizing: border-box;
  cursor: crosshair;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.home-page {
  --pr-left: 3vw;
  --pr-bottom: 4vh;
  --pr-w: min(46vw, 560px);
  --pr-ar: 1 / 1;
  --vd-right: 8vw;
  --vd-bottom: 46vh;
  --vd-w: min(42vw, 590px);
  --vd-ar: 16 / 9;
  position: relative;
  background-color: #1d2229;
}

.home-page::before {
  content: "";
  position: fixed;
  left: var(--pr-left);
  bottom: var(--pr-bottom);
  width: var(--pr-w);
  aspect-ratio: var(--pr-ar);
  background-image: url("assets/images/primate.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.22;
  filter: invert(1) brightness(1.1);
  pointer-events: none;
  z-index: 2;
}

.home-page::after {
  content: none;
}

.home-video {
  position: fixed;
  right: var(--vd-right);
  bottom: var(--vd-bottom);
  width: var(--vd-w);
  aspect-ratio: var(--vd-ar);
  height: auto;
  max-height: 62vh;
  object-fit: cover;
  filter: invert(1) grayscale(1) contrast(1.75) brightness(0.46);
  opacity: 0.52;
  pointer-events: none;
  z-index: 0;
}

.home-mark {
  position: fixed;
  top: 1.4rem;
  left: 2.1rem;
  margin: 0;
  color: #ff2a2a;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  z-index: 2;
}

.home-mark strong {
  display: inline-block;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
  font-style: italic;
  transform: scaleX(0.84) scaleY(1.7);
  transform-origin: left center;
}

.home-email {
  position: fixed;
  right: 1.6rem;
  bottom: 1.1rem;
  margin: 0;
  color: #ff2a2a;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  z-index: 2;
}

.about-page {
  position: relative;
}

.about-page::before {
  content: "";
  position: fixed;
  top: 54%;
  left: 50%;
  width: min(68vw, 760px);
  height: min(68vw, 760px);
  background-image: url("assets/images/home-bg.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.24;
  filter: invert(1) brightness(1.15) contrast(1.02);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}

.side-pyramid-nav {
  --btn-w: 94px;
  --line-len: 58px;
  position: fixed;
  right: 2.5rem;
  top: 1.25rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.side-pyramid-nav a {
  color: #ff2a2a;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-style: italic;
  text-decoration: none;
  letter-spacing: 0.03em;
  display: inline-block;
  position: relative;
  width: var(--btn-w);
  text-align: center;
  padding: 0.2rem 0;
  border: 1px solid rgba(255, 42, 42, 0.9);
}

.side-pyramid-nav a:hover,
.side-pyramid-nav a.active {
  color: #ff5a5a;
}

.pyramid-top {
  margin-bottom: 0.05rem;
}

.pyramid-bottom {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.05rem;
}

.pyramid-tail {
  margin-top: 0.05rem;
  width: 100%;
  text-align: center;
}

/* Corner connectors: top -> middle pair, then middle pair -> bottom */
.pyramid-top::before,
.pyramid-top::after {
  content: "";
  position: absolute;
  top: 100%;
  width: calc(var(--line-len) + 2px);
  border-top: 1px solid rgba(255, 42, 42, 0.9);
  pointer-events: none;
}

.pyramid-top::before {
  left: 0;
  transform: rotate(162deg);
  transform-origin: left center;
}

.pyramid-top::after {
  left: 100%;
  transform: rotate(18deg);
  transform-origin: left center;
}

.pyramid-bottom a:first-child::after,
.pyramid-bottom a:last-child::after {
  content: "";
  position: absolute;
  top: 100%;
  width: var(--line-len);
  border-top: 1px solid rgba(255, 42, 42, 0.9);
  pointer-events: none;
}

.pyramid-bottom a:first-child::after {
  left: 0;
  transform: rotate(18deg);
  transform-origin: left center;
}

.pyramid-bottom a:last-child::after {
  left: 100%;
  transform: rotate(162deg);
  transform-origin: left center;
}

.tilde-main {
  padding-top: 4.5rem;
}

.quote-chain {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.quote-node {
  width: min(56vw, 760px);
  min-height: 140px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  position: relative;
}

.quote-node p {
  margin: 0;
  text-align: center;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-style: italic;
  font-weight: 300;
  line-height: 1.5;
}

.quote-node a {
  color: #ffffff;
  text-decoration: none;
}

.quote-node a:hover {
  color: #f2f4f7;
}

.quote-rect {
  border-radius: 6px;
  min-height: 108px;
}

.quote-node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 1.6rem;
  background: #ffffff;
  transform: translateX(-50%);
}

header {
  border-bottom: 1px solid var(--border);
  background: #14171b;
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

a {
  color: inherit;
}

.nav-links a {
  color: #ff2a2a;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-style: italic;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  border-color: #ff2a2a;
  color: #ff5a5a;
}

main a {
  color: #ff2a2a;
}

main a:hover {
  color: #ff5a5a;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  position: relative;
  z-index: 1;
}

h1 {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 2.4rem;
  font-style: italic;
  font-weight: 300;
  color: #ff2a2a;
  letter-spacing: 0.03em;
  margin-top: 0;
}

.page-title {
  display: inline-block;
  transform: scaleX(0.84) scaleY(1.7);
  transform-origin: left center;
}

.lead {
  font-size: 1.1rem;
  color: #ff2a2a;
  max-width: 70ch;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
}

.about-header {
  margin: 0 0 0.75rem;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  color: #ff2a2a;
}

.about-header strong {
  display: inline-block;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
  font-style: italic;
  transform: scaleX(0.84) scaleY(1.7);
  transform-origin: left center;
}

.interest-list {
  margin-top: 0.2rem;
  color: #ff2a2a;
  line-height: 1.7;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
}

.grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
}

.research-list {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.research-list .card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.research-list .card h3 {
  margin: 0 0 0.35rem;
}

.research-list .card h3 a {
  color: #ff2a2a;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-style: italic;
  font-weight: 300;
  font-size: 1.22rem;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.research-list .card h3 a:hover {
  color: #ff5a5a;
}

.research-list .card p {
  margin: 0;
  color: #c0c6cf;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
}

.chart-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
}

.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.chart-card h3 {
  margin: 0;
  color: #ff2a2a;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 300;
  font-style: italic;
  font-size: 1rem;
}

.formula {
  margin: 0;
  color: #ff6d6d;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.75rem;
  opacity: 0.95;
}

.chart-box {
  height: 280px;
  min-height: 280px;
  border-radius: 6px;
  overflow: hidden;
}

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

  .chart-box {
    height: 240px;
    min-height: 240px;
  }
}

@media (max-width: 820px) {
  .side-pyramid-nav {
    --btn-w: 76px;
    right: 0.65rem;
    top: 0.55rem;
    gap: 0.28rem;
  }

  .side-pyramid-nav a {
    font-size: 0.72rem;
  }

  main {
    padding-top: 6.2rem;
  }

  .home-mark {
    top: 0.8rem;
    left: 0.85rem;
    font-size: 1.45rem;
  }
}

.notice {
  background: #2c261c;
  border: 1px solid #6a593d;
  border-radius: 8px;
  padding: 0.8rem;
  color: #e3d2b5;
}
