:root {
  --ink: #101113;
  --paper: #f3f0e8;
  --paper-bright: #fbfaf6;
  --text: #18191b;
  --muted: #686b72;
  --line: rgba(24, 25, 27, 0.18);
  --line-dark: rgba(255, 255, 255, 0.16);
  --blue: #2856c7;
  --blue-dark: #183f9d;
  --max-width: 1180px;
  --page-pad: clamp(1.25rem, 4vw, 3rem);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body,
a,
button {
  cursor: default;
}

a,
button,
[role="button"] {
  cursor: pointer;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: #d8e2ff;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid #86a2ff;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  background: #fff;
  color: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  background: rgba(16, 17, 19, 0.96);
  color: #fff;
  border-bottom: 1px solid var(--line-dark);
  backdrop-filter: blur(12px);
}

.nav-shell {
  width: min(100%, var(--max-width));
  min-height: 4.15rem;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  align-items: center;
  gap: 2rem;
}

.wordmark {
  width: fit-content;
}

.wordmark-name {
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-links,
.nav-socials {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-links a,
.nav-socials a {
  color: #c4c7cd;
  font-size: 0.78rem;
  font-weight: 550;
  transition: color 150ms ease;
}

.nav-links a:hover,
.nav-socials a:hover {
  color: #fff;
}

.nav-socials {
  justify-content: flex-end;
}

.hero {
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid var(--line-dark);
}

.hero-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(4.5rem, 8vw, 6.5rem) var(--page-pad);
  display: grid;
  grid-template-columns: minmax(0, 47rem) minmax(10.5rem, 12.5rem);
  align-items: center;
  gap: clamp(3.5rem, 8vw, 7rem);
}

.hero h1 {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2.55rem, 4.4vw, 3.7rem);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hero-meta {
  margin: 1.6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: #b8bcc5;
  font-size: 1rem;
}

.hero-meta a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.4rem;
}

.hero-link {
  padding-bottom: 0.18rem;
  color: #d7dae0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-link:first-child {
  color: #fff;
  border-bottom-color: #fff;
}

.hero-link:hover {
  color: #fff;
  border-bottom-color: #7594ff;
}

.hero-portrait {
  width: min(100%, 12.5rem);
  margin: 0;
  justify-self: end;
}

.hero-portrait img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-dark);
  border-radius: 0.35rem;
  filter: saturate(0.9) contrast(1.01);
}

.hero-portrait figcaption {
  margin-top: 0.6rem;
  color: #8f949e;
  font-size: 0.66rem;
  white-space: nowrap;
}

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

.section-shell,
.footer-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding-right: var(--page-pad);
  padding-left: var(--page-pad);
}

.section-heading {
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

.section-heading h2,
.about-heading h2,
.news-section h2 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.section-note {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.section-kicker,
.project-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.featured-projects {
  display: grid;
  gap: 3.25rem;
}

.project-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(18rem, 0.76fr) minmax(0, 1.24fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-media {
  position: relative;
  min-width: 0;
  align-self: center;
  overflow: hidden;
  background: var(--ink);
}

.project-media video {
  width: 100%;
  height: auto;
  object-fit: contain;
}

#magicquill-series .project-media {
  background: #e9e5da;
}

.project-preview[hidden] {
  display: none;
}

.preview-toggle {
  position: absolute;
  z-index: 3;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.2rem;
  display: flex;
  gap: 0.15rem;
  background: rgba(16, 17, 19, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2rem;
}

.preview-toggle button {
  min-width: 2.5rem;
  padding: 0.38rem 0.65rem;
  background: transparent;
  color: #c7cbd3;
  border: 0;
  border-radius: 2rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.preview-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

.project-copy {
  padding: clamp(1.5rem, 3vw, 2.7rem) 0 clamp(1.5rem, 3vw, 2.7rem) clamp(2rem, 5vw, 4rem);
  align-self: center;
}

.project-copy h3 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.85rem, 3.3vw, 2.8rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.project-summary {
  max-width: 39rem;
  margin: 1rem 0 0;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.48;
}

.project-outcome {
  max-width: 42rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-footer {
  grid-column: 1 / -1;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.project-actions,
.release-links,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.2rem;
}

.project-actions a,
.release-links a,
.inline-links a {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(40, 86, 199, 0.35);
  text-underline-offset: 0.2rem;
}

.project-actions a:hover,
.release-links a:hover,
.inline-links a:hover {
  color: var(--blue-dark);
  text-decoration-color: currentColor;
}

.action-icon {
  margin-right: 0.16rem;
  color: var(--text);
  font-size: 0.75rem;
  text-decoration: none;
}

.release-list {
  margin: 0;
}

.release-row {
  padding: 0.9rem 0;
  display: grid;
  grid-template-columns: minmax(10rem, 0.35fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.release-row:first-child {
  padding-top: 0;
}

.release-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.release-row > p {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
}

.project-highlights {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.metric-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
}

.metric-card {
  display: inline-grid;
  grid-template-columns: 1.45rem auto;
  align-items: center;
  gap: 0.55rem;
}

.metric-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
}

.metric-icon-huggingface {
  background: #f3c949;
  color: var(--text);
  font-size: 0.78rem;
}

.metric-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
  line-height: 1.25;
}

.metric-label {
  color: var(--muted);
  font-size: 0.7rem;
}

.metric-label::after {
  content: " ·";
}

.metric-copy strong {
  font-size: 0.75rem;
  font-weight: 700;
}

.metric-copy small {
  width: 100%;
  color: var(--muted);
  font-size: 0.66rem;
}

.research-section {
  background: var(--paper-bright);
}

.research-grid {
  border-top: 1px solid var(--line);
}

.research-card {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.research-media {
  width: 100%;
  height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--paper);
}

.research-media video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
}

.research-copy {
  min-width: 0;
}

.research-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.research-meta span + span::before {
  content: "·";
  margin-right: 0.35rem;
}

.research-copy h3 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.research-copy > p {
  max-width: 42rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.award-banner {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--blue);
}

.award-banner span {
  font-size: 0.72rem;
}

.award-banner strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.research-highlight {
  display: block;
  margin-top: 0.7rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.inline-links {
  margin-top: 1rem;
}

.inline-star {
  margin-left: 0.18rem;
  color: var(--muted);
  font-size: 0.69rem;
  text-decoration: none;
}

.about-section {
  background: var(--ink);
  color: #fff;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 0.65fr) minmax(22rem, 1.35fr);
  gap: clamp(3rem, 9vw, 8rem);
}

.about-heading h2 {
  font-size: clamp(2rem, 3.8vw, 3.15rem);
}

.about-copy > p {
  max-width: 44rem;
  margin: 0;
  color: #c5c8ce;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.about-copy > p + p {
  margin-top: 1.15rem;
}

.focus-list {
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  color: #9ea3ac;
  list-style: none;
}

.focus-list li {
  font-size: 0.78rem;
}

.focus-list li:not(:last-child)::after {
  content: "·";
  margin-left: 0.65rem;
  color: #656a73;
}

.timeline-section {
  background: var(--paper-bright);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vw, 6rem);
}

.timeline-column {
  border-top: 1px solid var(--line);
}

.timeline-column > .section-kicker {
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.86rem;
}

.timeline-item {
  padding: 1.45rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.timeline-item h3,
.timeline-item p,
.timeline-item small {
  margin: 0;
}

.timeline-item h3 {
  font-size: 1rem;
  font-weight: 650;
}

.timeline-item p {
  margin-top: 0.18rem;
  font-size: 0.9rem;
}

.timeline-item small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.timeline-when {
  text-align: right;
  font-size: 0.75rem;
  font-weight: 600;
}

.news-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 0.55fr) minmax(24rem, 1.45fr);
  gap: clamp(3rem, 9vw, 8rem);
}

.news-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.news-list li {
  padding: 1.15rem 0;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.news-list time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.news-list a {
  font-size: 0.9rem;
  line-height: 1.45;
}

.news-list a:hover {
  color: var(--blue);
}

.site-footer {
  padding: 3rem 0;
  background: var(--ink);
  color: #fff;
}

.footer-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2rem;
}

.footer-name,
.footer-shell p {
  margin: 0;
}

.footer-name {
  font-size: 1rem;
  font-weight: 650;
}

.footer-name + p {
  margin-top: 0.35rem;
  color: #8f949e;
  font-size: 0.72rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem 1.2rem;
}

.footer-links a {
  color: #c7cbd3;
  font-size: 0.72rem;
}

.footer-links a:hover {
  color: #fff;
}

@media (max-width: 960px) {
  .nav-shell {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero-shell {
    grid-template-columns: minmax(0, 1fr) 10rem;
    gap: 3rem;
  }

  .project-card {
    grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 760px) {
  .hero h1 {
    font-size: clamp(2.4rem, 7.5vw, 3.3rem);
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-copy {
    padding: 1.7rem 0;
  }

  .research-card {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.5rem;
  }

  .about-grid,
  .news-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  :root {
    --page-pad: 1rem;
  }

  html {
    scroll-padding-top: 4rem;
  }

  .nav-shell {
    min-height: 3.8rem;
  }

  .nav-socials a:first-child {
    display: none;
  }

  .hero-shell {
    padding-top: 3.5rem;
    padding-bottom: 3.75rem;
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero h1 {
    max-width: 18ch;
    font-size: clamp(2.25rem, 10vw, 2.9rem);
  }

  .hero-portrait {
    width: 9rem;
    justify-self: start;
  }

  .section {
    padding: 4.25rem 0;
  }

  .section-heading h2,
  .about-heading h2,
  .news-section h2 {
    font-size: 2.25rem;
  }

  .release-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .research-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .research-media {
    width: min(100%, 24rem);
    height: auto;
    min-height: 9rem;
  }

  .research-media video {
    width: 100%;
    max-height: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .timeline-when {
    text-align: left;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .footer-shell {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
