:root {
  --bg: #f4f1ea;
  --paper: #f8f5ef;
  --ink: #15120f;
  --muted: #5f574e;
  --line: rgba(21, 18, 15, 0.14);
  --accent: #23201c;
  --accent-soft: rgba(35, 32, 28, 0.08);
  --radius: 16px;
  --container: 1060px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

body.has-chat-dock {
  padding-bottom: 96px;
}

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

a {
  color: inherit;
}

.container {
  width: min(var(--container), 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(0);
  background: transparent;
  transition: background-color 180ms ease, box-shadow 180ms ease, backdrop-filter 180ms ease;
}

.site-header.is-scrolled {
  backdrop-filter: blur(12px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  text-decoration: none;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.96rem;
  color: var(--muted);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.mobile-nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0.45rem 0.8rem;
}

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  gap: 2.5rem;
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: -68px;
  padding-top: 68px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1,
h2 {
  font-family: "Source Serif 4", Georgia, serif;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  max-width: 16ch;
}

.lede {
  margin: 1.3rem 0 0;
  max-width: 62ch;
  color: var(--muted);
}

.hero-quick-links {
  margin: 1.05rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.85rem;
}

.hero-quick-links a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 0;
}

.hero-quick-links a:hover {
  color: var(--ink);
}

.hero-quick-links .icon {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem;
  background: color-mix(in oklab, #ffffff 40%, transparent);
}

.hero-quick-links svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.hero-figure {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: clip;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #ddd5cb, #f8f4ed);
  box-shadow: 0 10px 40px rgba(42, 36, 28, 0.08);
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section {
  padding: clamp(4rem, 7vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.2rem;
}

.section h2 {
  font-size: clamp(1.6rem, 4vw, 2.9rem);
}

.split-text {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--muted);
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  color: var(--muted);
  font-size: 0.94rem;
}

.roadmap-wrap {
  position: relative;
  margin-top: 2.5rem;
  padding: 0 0.5rem;
}

.roadmap-edu {
  position: relative;
  height: 52px;
}

.roadmap-item {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

.roadmap-edu .roadmap-item {
  bottom: 0;
}

.roadmap-item h3 {
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.15;
}

.roadmap-item p {
  font-family: "Caveat", cursive;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.2;
}

.roadmap-curve {
  width: 100%;
  height: 100px;
  display: block;
  margin: 0.3rem 0;
}

.roadmap-curve path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 8 6;
  stroke-linecap: round;
  opacity: 0.2;
}

.roadmap-years {
  position: relative;
  height: 22px;
  margin-top: 0.5rem;
}

.roadmap-years span {
  position: absolute;
  transform: translateX(-50%);
  font-family: "Caveat", cursive;
  font-size: 0.88rem;
  color: color-mix(in oklab, var(--muted) 50%, transparent);
}

.roadmap-work {
  position: relative;
  height: 30px;
  margin-top: 2.2rem;
}

.roadmap-work .roadmap-item {
  top: 0;
}

.roadmap-work .roadmap-item p {
  display: none;
}

.roadmap-work .roadmap-item::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0;
  height: 52px;
  border-left: 1.5px dashed color-mix(in oklab, var(--ink) 18%, transparent);
}

.publication-list {
  margin: 0;
  padding-left: 1.2rem;
}

.publication-list li {
  padding: 0.8rem 0 1rem;
  border-bottom: 1px dashed var(--line);
}

.publication-list li:last-child {
  border-bottom: none;
}

.publication-list h3 {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.45;
}

.publication-list p {
  margin: 0.42rem 0 0.45rem;
  color: var(--muted);
}

.pub-note {
  margin-top: -0.05rem;
  color: #70573a;
  font-size: 0.88rem;
}

.publication-list a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-size: 0.92rem;
}

.publication-list a:hover {
  border-color: currentColor;
  color: var(--ink);
}

.pub-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.chat-float {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 45;
  width: min(640px, 92vw);
}

.chat-pill {
  width: min(420px, 72vw);
  margin: 0 auto;
  display: block;
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  color: var(--muted);
  padding: 0.58rem 1rem;
  backdrop-filter: blur(10px);
  text-align: center;
  cursor: pointer;
}

.chat-pill:hover {
  color: var(--ink);
}

.chat-log {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, white 90%, var(--paper));
  padding: 0.7rem;
  max-height: 120px;
  overflow: auto;
}

.chat-panel {
  margin-top: 0.45rem;
  border: 1px solid color-mix(in oklab, var(--line) 85%, transparent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  padding: 0.58rem;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.chat-panel-head p {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-minimize {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  height: 1.65rem;
  width: 1.65rem;
  cursor: pointer;
}

.chat-minimize:hover {
  color: var(--ink);
}

.msg {
  width: fit-content;
  max-width: 90%;
  margin-bottom: 0.7rem;
  padding: 0.62rem 0.78rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.msg.user {
  margin-left: auto;
  background: var(--accent);
  color: white;
}

.msg.bot {
  background: #ece7dd;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.55rem 0.1rem 0.1rem;
}

.chat-form input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: white;
  min-width: 0;
}

.button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.62rem 1rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 150ms ease;
}

.button.primary {
  color: #fff;
  background: #2b2722;
  border-color: #2b2722;
}

.button.primary:hover {
  transform: translateY(-1px);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost:hover {
  background: #ece4d8;
}

.site-footer {
  min-height: 120px;
  border-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.ghost-link {
  border: 1px solid transparent;
  color: color-mix(in oklab, var(--muted) 75%, transparent);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.ghost-link:hover {
  color: var(--muted);
}

/* ─── Masonry gallery ─── */

.gallery {
  column-count: 3;
  column-gap: 0.85rem;
}

.gallery-item {
  margin: 0 0 0.85rem;
  break-inside: avoid;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 0.85rem 0.7rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.gallery-item:hover figcaption {
  opacity: 1;
}

/* ─── Lightbox ─── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox.is-active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 3px;
  user-select: none;
  transition: opacity 180ms ease;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 200ms;
  z-index: 2;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 2.8rem;
  cursor: pointer;
  padding: 1rem;
  transition: color 200ms;
  line-height: 1;
  z-index: 2;
  user-select: none;
}

.lightbox-nav:hover {
  color: rgba(255, 255, 255, 0.8);
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.lightbox-info {
  position: absolute;
  bottom: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    margin-top: 0;
    padding: 3.4rem 0 1.6rem;
  }

  .hero-figure {
    max-width: 520px;
  }

  .split-text {
    gap: 0.4rem;
  }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: var(--paper);
    border-bottom: 0;
    padding: 0.8rem 4vw 1rem;
  }

  .site-nav.open {
    display: flex;
  }

  .mobile-nav-toggle {
    display: inline-block;
  }

  .news-list li {
    grid-template-columns: 72px 1fr;
  }

  .roadmap-wrap {
    padding: 0;
  }

  .roadmap-edu,
  .roadmap-work {
    height: auto;
    margin-top: 0;
  }

  .roadmap-item {
    position: static;
    transform: none;
    text-align: left;
    white-space: normal;
    border-top: 1px dashed var(--line);
    padding: 0.55rem 0;
  }

  .roadmap-work .roadmap-item p {
    display: block;
  }

  .roadmap-work .roadmap-item::before {
    display: none;
  }

  .roadmap-curve,
  .roadmap-years {
    display: none;
  }
}

@media (max-width: 780px) {
  body.has-chat-dock {
    padding-bottom: 90px;
  }

  .gallery {
    column-count: 2;
    column-gap: 0.6rem;
  }

  .gallery-item {
    margin-bottom: 0.6rem;
  }

  .lightbox-nav {
    font-size: 2rem;
    padding: 0.6rem;
  }

  .lightbox-prev {
    left: 0.2rem;
  }

  .lightbox-next {
    right: 0.2rem;
  }

  .chat-pill {
    width: min(92vw, 420px);
  }
}

@media (max-width: 480px) {
  .gallery {
    column-count: 1;
    max-width: 480px;
  }

  .gallery-item figcaption {
    opacity: 1;
  }
}
