@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --ink: #111210;
  --muted: #6e706b;
  --red: #b93824;
  --red-dark: #982b1c;
  --canvas: #fdfdfb;
  --surface: #ffffff;
  --line: #e4e5e1;
  --container: 1120px;
}

html {
  scroll-padding-top: 88px;
}

body {
  min-width: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", system-ui, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
.page-hero__title,
.privacy-hero__title,
.expert-hero__title,
.privacy-section__title,
.expert-section__title,
.section__title,
.project-card__title,
.philosophy__quote {
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: -.04em;
  overflow-wrap: normal;
  hyphens: manual;
}

h1,
.page-hero__title,
.privacy-hero__title,
.expert-hero__title {
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 1.01;
}

h2,
.section__title,
.privacy-section__title,
.expert-section__title {
  font-size: clamp(2.15rem, 4vw, 3.8rem);
  line-height: 1.08;
}

p,
li,
td,
th {
  line-height: 1.7;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 40%, transparent);
  outline-offset: 3px;
}

/* Fallback shell styles; the shared site system owns the same contract. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 253, 251, .96);
  backdrop-filter: blur(12px);
}

.site-header__inner,
.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.site-header__inner {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
}

.wordmark {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.07em;
  text-decoration: none;
}

.wordmark__dot { color: var(--red); }

.site-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.85rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
  backdrop-filter: none;
}

.site-nav__link {
  color: var(--muted);
  font-size: .88rem;
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible,
.site-nav__link[aria-current] { color: var(--ink); }

.site-nav__cta,
.header-cta,
.button,
.hero-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: .72rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0;
  color: #fff;
  background: var(--ink);
  box-shadow: none;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.site-nav__cta:hover,
.header-cta:hover,
.button:hover,
.hero-btn--primary:hover,
.btn:hover {
  color: #fff;
  background: var(--red);
}

.header-cta { margin-left: auto; }
.site-nav .site-nav__cta { display: none; }

.button--secondary,
.hero-btn--secondary,
.btn--secondary {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}

.button--secondary:hover,
.hero-btn--secondary:hover,
.btn--secondary:hover {
  color: var(--red);
  border-color: var(--red);
  background: transparent;
}

.menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

/* Shared editorial pages and case studies. */
.hero,
.page-hero,
.privacy-hero,
.expert-hero {
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.page-hero,
.privacy-hero,
.expert-hero {
  display: block;
  padding: 0;
  color: var(--ink);
}

.page-hero::before,
.page-hero::after,
.project-card::before,
.project-card::after,
.education__card::before,
.education__card::after,
.profile-intro__story::before,
.philosophy__quote::before,
.philosophy__quote::after,
.cta::before,
.cta::after { display: none; }

.hero__inner,
.page-hero__content,
.privacy-hero__inner,
.expert-hero__inner {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
  padding: clamp(5rem, 10vw, 8.5rem) 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .55fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
}

.hero__inner--text {
  grid-template-columns: minmax(0, 900px);
}

.hero__inner > *,
.privacy-hero__inner > *,
.expert-hero__inner > * {
  min-width: 0;
  max-width: 100%;
}

.privacy-hero__inner,
.expert-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
}

.specialist-hero__media {
  overflow: hidden;
  margin: 0;
  border: 0;
}

.specialist-hero__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(.7) contrast(1.04);
}

.page-hero__content,
.privacy-hero__inner,
.expert-hero__inner {
  display: block;
  max-width: var(--container);
  text-align: left;
}

.hero h1,
.page-hero__title,
.privacy-hero__title,
.expert-hero__title {
  max-width: 960px;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.kicker,
.page-hero__label,
.section__label,
.privacy-hero__eyebrow,
.expert-hero__eyebrow,
.privacy-section__label,
.expert-section__label,
.card__tag,
.project-card__badge {
  display: block;
  margin: 0 0 1.2rem;
  width: fit-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--red);
  background: transparent;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lead,
.page-hero__subtitle,
.privacy-hero__lead,
.expert-hero__lead,
.privacy-section__intro,
.expert-section__intro,
.section__subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.7;
}

.hero__actions,
.actions,
.privacy-hero__actions,
.expert-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2.25rem;
}

.hero__media {
  overflow: hidden;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero__media img,
.answer-block__image img {
  width: 100%;
  object-fit: cover;
  filter: saturate(.75);
}

.hero__media img { aspect-ratio: 4 / 5; }

.hero__diagram {
  display: grid;
  gap: 0;
  align-content: center;
  min-height: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.hero__diagram span {
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-weight: 500;
}

.hero__diagram i { color: var(--red); }

.band,
.privacy-section,
.expert-section,
.section {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: var(--canvas);
}

.band--white,
.privacy-section--alt,
.expert-section--alt { background: var(--canvas); }

.band > .section,
.section:not(.profile-intro):not(.career):not(.skills):not(.education):not(.philosophy),
.privacy-section__inner,
.expert-section__inner,
.profile-intro__container,
.skills__grid,
.education__container,
.opensource__container,
.projects__grid,
.career__timeline,
.section__header {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.band > .section,
.privacy-section,
.expert-section,
.section,
.profile-intro,
.career,
.skills,
.education,
.philosophy,
.projects,
.opensource {
  padding: clamp(4.5rem, 8vw, 7.5rem) 0;
}

.band > .section { padding-inline: 0; }
.band--compact > .section { padding-block: clamp(3rem, 5vw, 4.5rem); }

.section__header {
  margin-bottom: 3.5rem;
  text-align: left;
}

.section__header .section__subtitle {
  margin-inline: 0;
}

.grid,
.privacy-grid,
.faq-grid,
.proof-grid,
.service-grid,
.projects__grid,
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
}

.grid--two,
.answer-block,
.privacy-answer { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.answer-block--text { grid-template-columns: minmax(0, 900px); }

.card,
.privacy-card,
.faq-item,
.proof-item,
.service-item-expert,
.project-card,
.skill-category,
.education__card,
.opensource__item,
.signal-box {
  min-width: 0;
  margin: 0;
  padding: 1.75rem 2rem 2rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.card:nth-child(3n),
.privacy-card:nth-child(3n),
.faq-item:nth-child(3n),
.proof-item:nth-child(3n),
.service-item-expert:nth-child(3n),
.project-card:nth-child(3n),
.skill-category:nth-child(3n) { border-right: 0; }

.card:hover,
.privacy-card:hover,
.faq-item:hover,
.proof-item:hover,
.service-item-expert:hover,
.project-card:hover,
.education__card:hover,
.profile-intro__image-frame:hover,
.career__content:hover,
.skill-category:hover,
.skill-tag:hover,
.opensource__content:hover {
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.card h3,
.privacy-card h3,
.faq-item h3,
.proof-item h3,
.service-item-expert h3,
.project-card h3,
.skill-category h3 {
  margin-top: 2.5rem;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
}

.card p,
.privacy-card p,
.faq-item p,
.proof-item p,
.service-item-expert p,
.project-card p,
.skill-category p { color: var(--muted); }

.article { max-width: 850px; }
.article h2 { margin-top: 4.5rem; }
.article h3 { margin-top: 2.8rem; }
.article p,
.article li { font-size: 1.04rem; }
.article a { text-decoration-color: var(--red); text-underline-offset: .2em; }

.byline { color: var(--muted); font-size: .9rem !important; }

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.4rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: .86rem;
}

.case-meta span {
  padding: 0;
  border: 0;
  background: transparent;
}

.fact-table {
  width: 100%;
  margin: 2.5rem 0;
  border-collapse: collapse;
}

.fact-table th,
.fact-table td {
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  vertical-align: top;
}

.fact-table th {
  width: 32%;
  padding-right: 2rem;
  color: var(--ink);
}

.architecture-flow {
  display: grid;
  margin: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.architecture-flow__step,
.scope-note {
  padding: 1.15rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.architecture-flow__step::after { display: none; }

.scope-note { border-left: 3px solid var(--red); padding-left: 1.25rem; }

.signal-box li::before,
.principle-list li::before,
.facts-list li::before { background: var(--red); }

.proof-list,
.qa {
  display: grid;
  gap: 0;
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.proof-item,
.qa__item {
  margin: 0;
  padding: 1.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* About and Lab: retain their content, but flatten the old decorative UI. */
.profile-intro__container,
.answer-block,
.privacy-answer {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.profile-intro__image-frame,
.answer-block__image {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-intro__highlight,
.profile-intro__story,
.education__connection,
.opensource__privacy {
  margin: 2rem 0;
  padding: 1.25rem 0 1.25rem 1.4rem;
  border: 0;
  border-left: 3px solid var(--red);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-intro__links,
.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin: 2rem 0;
}

.profile-intro__link,
.project-card__tech-tag,
.skill-tag {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: .86rem;
}

.profile-intro__link:hover,
.project-card__link:hover { color: var(--red); }

.career__timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.career__timeline::before,
.career__timeline::after { display: none; }

.career__item {
  display: block;
  min-width: 0;
  padding: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.career__item:nth-child(odd) {
  padding-left: 0;
  border-right: 1px solid var(--line);
}

.career__item:nth-child(even) { padding-right: 0; }

.career__marker { display: none; }
.career__content {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.career__period {
  display: block;
  margin-bottom: 1rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.career__title {
  margin-bottom: .45rem;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.15;
}

.career__company { margin-bottom: 1.25rem; }
.career__description { max-width: 62ch; }
.career__highlights { margin: 1.25rem 0 0; padding-left: 1.15rem; }
.career__highlights li + li { margin-top: .55rem; }
.career__highlights li::before { color: var(--red); }
.profile-intro__content h2,
.profile-intro__content h3,
.career__title,
.education__degree,
.education__thesis-title,
.skill-category__title {
  font-family: "Space Grotesk", system-ui, sans-serif;
}
.profile-intro__content h2,
.career__title,
.education__degree,
.education__thesis-title,
.skill-category__title { color: var(--ink); }
.profile-intro__content h3,
.career__company,
.education__institution,
.education__thesis-label,
.career__period { color: var(--red); }
.career__learning-text { color: var(--muted); }
.project-card__evidence dt { color: var(--ink); }
.project-card__highlight svg,
.opensource__item-icon,
.opensource__item-icon svg { color: var(--red); }
.career__period,
.education__period,
.education__thesis {
  padding: 0;
  border: 0;
  background: transparent;
}
.education__thesis { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.skill-tag:hover { color: var(--red); }

.hero-btn--primary:hover,
.btn--primary:hover,
.button:hover,
.project-card:hover,
.education__card:hover {
  box-shadow: none !important;
  transform: none !important;
}

.philosophy { color: #fff; background: var(--ink); }
.philosophy__container { width: min(900px, calc(100% - 48px)); margin-inline: auto; }
.philosophy__quote { color: #fff; }
.philosophy__text { color: #c2c4bd; }

.project-card__badge,
.project-card__highlight { position: static; }
.project-card__highlight { padding: 0; border: 0; color: var(--muted); background: transparent; }
.project-card__evidence { border-top: 1px solid var(--line); }
.project-card__evidence-row { padding-block: .8rem; border-bottom: 1px solid var(--line); }
.project-card__link { color: var(--ink); text-decoration-color: var(--red); }

/* The Lab is an overview, not eight full case studies. */
.projects .project-card__evidence,
.projects .project-card__highlight { display: none; }
.projects .project-card__tech-tag:nth-child(n + 4) { display: none; }
.projects .project-card__description { max-width: 38ch; }
.projects .project-card__link { margin-top: 1.25rem; }

.footer,
.footer__bottom {
  width: auto;
  margin: 0;
  padding: 2rem max(24px, calc((100% - var(--container)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--canvas);
  font-size: .82rem;
}

.footer__inner {
  width: min(var(--container), 100%);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer a,
.footer__bottom a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.footer a:hover,
.footer__bottom a:hover { color: var(--red); }

.modal__content {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--canvas);
  box-shadow: none;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal.is-open .modal__content {
  transform: translateY(0);
}

.modal[hidden] {
  display: none;
}

.modal__close {
  width: 44px;
  height: 44px;
  border-color: var(--line);
  color: var(--ink);
}

.modal__close:hover,
.modal__close:focus-visible,
.modal__section h3 {
  border-color: var(--red);
  color: var(--red);
}

.opensource__content {
  box-shadow: none;
}

.reveal { opacity: 1; transform: none; }

.page-hero *,
.privacy-hero *,
.expert-hero * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.redirect-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.redirect-page__inner {
  width: min(720px, 100%);
  padding: clamp(3rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.redirect-page h1 { margin-bottom: 1.25rem; }
.redirect-page p { max-width: 580px; color: var(--muted); }

@media (max-width: 960px) {
  .site-header { height: 66px; }
  .site-header__inner { justify-content: space-between; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header-cta { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    top: 66px;
    right: -24px;
    left: -24px;
    padding: 1.25rem 24px 1.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    transform: none;
  }
  .site-nav[data-open="true"],
  .site-nav.is-open { display: grid; justify-items: start; gap: .9rem; }
  .site-nav .site-nav__cta { display: inline-flex; margin-top: .35rem; }
  .hero__inner,
  .privacy-hero__inner,
  .expert-hero__inner,
  .profile-intro__container,
  .answer-block,
  .privacy-answer { grid-template-columns: 1fr; }
  .hero__media { width: min(430px, 100%); }
  .grid,
  .privacy-grid,
  .faq-grid,
  .proof-grid,
  .service-grid,
  .projects__grid,
  .skills__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card:nth-child(3n),
  .privacy-card:nth-child(3n),
  .faq-item:nth-child(3n),
  .proof-item:nth-child(3n),
  .service-item-expert:nth-child(3n),
  .project-card:nth-child(3n),
  .skill-category:nth-child(3n) { border-right: 1px solid var(--line); }
  .card:nth-child(2n),
  .privacy-card:nth-child(2n),
  .faq-item:nth-child(2n),
  .proof-item:nth-child(2n),
  .service-item-expert:nth-child(2n),
  .project-card:nth-child(2n),
  .skill-category:nth-child(2n) { border-right: 0; }
}

@media (max-width: 640px) {
  .site-header__inner,
  .container,
  .hero__inner,
  .page-hero__content,
  .privacy-hero__inner,
  .expert-hero__inner,
  .band > .section,
  .section:not(.profile-intro):not(.career):not(.skills):not(.education):not(.philosophy),
  .privacy-section__inner,
  .expert-section__inner,
  .profile-intro__container,
  .skills__grid,
  .education__container,
  .opensource__container,
  .projects__grid,
  .career__timeline,
  .section__header,
  .philosophy__container {
    width: min(var(--container), calc(100% - 40px));
  }
  h1,
  .page-hero__title,
  .privacy-hero__title,
  .expert-hero__title { font-size: clamp(1.65rem, 7.8vw, 3.4rem); }
  h2,
  h3,
  .section__title,
  .privacy-section__title,
  .expert-section__title { overflow-wrap: anywhere; }
  .button,
  .hero-btn,
  .btn {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
  }
  .grid,
  .privacy-grid,
  .faq-grid,
  .proof-grid,
  .service-grid,
  .projects__grid,
  .skills__grid { grid-template-columns: 1fr; }
  .card,
  .privacy-card,
  .faq-item,
  .proof-item,
  .service-item-expert,
  .project-card,
  .skill-category,
  .education__card,
  .opensource__item,
  .signal-box,
  .card:nth-child(n),
  .privacy-card:nth-child(n),
  .faq-item:nth-child(n),
  .proof-item:nth-child(n),
  .service-item-expert:nth-child(n),
  .project-card:nth-child(n),
  .skill-category:nth-child(n) {
    padding-inline: 0;
    border-right: 0;
  }
  .career__timeline { grid-template-columns: 1fr; }
  .career__item,
  .career__item:nth-child(odd),
  .career__item:nth-child(even) {
    padding: 2rem 0;
    border-right: 0;
  }
  .fact-table,
  .fact-table tbody,
  .fact-table tr,
  .fact-table th,
  .fact-table td { display: block; width: 100%; }
  .fact-table th { padding-bottom: .25rem; border-bottom: 0; }
  .fact-table td { padding-top: .25rem; }
  .footer__inner { flex-direction: column; }
}

@media (max-width: 400px) {
  h1,
  .page-hero__title,
  .privacy-hero__title,
  .expert-hero__title { font-size: 1.75rem; }
}

@media (max-width: 360px) {
  h1,
  .page-hero__title,
  .privacy-hero__title,
  .expert-hero__title { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
