:root {
  --bg: #f5f6f2;
  --paper: #fbfcf9;
  --ink: #0b1714;
  --muted: #5f6b66;
  --line: #d8ded9;
  --green: #4cffb0;
  --green-dark: #0a5d42;
  --deep: #07110f;
  --deep-2: #0b1916;
  --white: #ffffff;
  --max: 1180px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }
.skip { position: fixed; left: 16px; top: -70px; z-index: 100; background: white; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,246,242,.92);
  border-bottom: 1px solid rgba(216,222,217,.85);
  backdrop-filter: blur(14px);
}
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 31px; height: 31px; border: 1px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-family: Georgia, serif; font-size: 18px; font-style: italic;
}
.brand-text { font-size: 12px; letter-spacing: .13em; white-space: nowrap; }
.brand-text strong { font-weight: 700; }
.top-nav { display: flex; align-items: center; gap: 25px; font-size: 13px; }
.top-nav a { color: #34423d; text-decoration: none; }
.top-nav a:hover { color: var(--ink); }
.nav-github { border: 1px solid #b9c2bd; padding: 8px 13px; border-radius: 9px; }

.hero { padding: 100px 0 86px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; width: 640px; height: 640px; border: 1px solid rgba(11,23,20,.07); border-radius: 50%;
  right: -250px; top: -270px; box-shadow: 0 0 0 90px rgba(11,23,20,.018), 0 0 0 180px rgba(11,23,20,.012); pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 76px; align-items: center; }
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; font-size: 12px; letter-spacing: .06em; color: #4b5954; text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #0b9c68; box-shadow: 0 0 0 4px rgba(11,156,104,.10); }
.status-sep { color: #a1aaa5; }
h1 { font-size: clamp(46px, 6vw, 78px); line-height: .98; letter-spacing: -.05em; margin: 0 0 30px; max-width: 900px; font-weight: 710; }
.hero-copy { font-size: clamp(18px, 2vw, 21px); line-height: 1.6; color: #42504b; max-width: 790px; margin: 0; }
.hero-actions { margin-top: 36px; display: flex; gap: 11px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 17px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 650; transition: transform .15s ease, opacity .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: white; border: 1px solid var(--ink); }
.btn-secondary { background: transparent; border: 1px solid #aeb9b3; }
.btn-quiet { background: transparent; color: #41504b; }
.hero-note { color: #73807a; font-size: 12px; margin: 22px 0 0; }

.invariant-card { background: var(--deep); color: white; border-radius: 22px; padding: 29px; box-shadow: 0 30px 70px rgba(0,0,0,.11); }
.eyebrow, .section-kicker, .card-label { font-size: 10px; letter-spacing: .18em; font-weight: 750; }
.eyebrow { color: var(--green); }
.invariant-card > p { font-family: Georgia, serif; font-size: 25px; line-height: 1.32; letter-spacing: -.015em; margin: 27px 0 32px; }
.mini-rule { height: 1px; background: rgba(255,255,255,.18); }
.invariant-meta { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 20px; color: #aebbb6; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.lifecycle-band { background: #0b1714; color: white; padding: 40px 0 42px; }
.lifecycle-band .section-kicker { color: #78a391; margin-bottom: 22px; }
.lifecycle { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.lifecycle li { min-height: 120px; padding: 4px 22px 10px; border-left: 1px solid rgba(255,255,255,.13); position: relative; }
.lifecycle li:first-child { border-left: 0; padding-left: 0; }
.lifecycle li::after { content: "→"; position: absolute; right: -8px; top: 41px; color: #648277; font-size: 15px; }
.lifecycle li:last-child::after { display: none; }
.lifecycle span { display: block; color: #6b887d; font-size: 10px; letter-spacing: .12em; margin-bottom: 27px; }
.lifecycle strong { display: block; font-size: 15px; }
.lifecycle small { display: block; color: #8fa49c; margin-top: 5px; font-size: 11px; line-height: 1.3; }

.section { padding: 92px 0; }
.section-alt { background: #ecefe9; }
.section-dark { background: var(--deep); color: white; }
.section-kicker { color: var(--green-dark); margin-bottom: 16px; }
.section-dark .section-kicker { color: var(--green); }
.section h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; letter-spacing: -.035em; margin: 0; max-width: 720px; }
.section-heading { display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: end; margin-bottom: 42px; }
.section-heading > p { color: var(--muted); margin: 0; font-size: 16px; max-width: 500px; }
.cards { display: grid; gap: 14px; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 27px 24px 29px; min-height: 270px; }
.card.featured { border-color: #99ad9f; box-shadow: inset 0 3px 0 #0d6e4e; }
.card-label { color: #74847d; }
.card h3 { margin: 46px 0 15px; font-size: 21px; letter-spacing: -.02em; }
.card p { color: #5d6964; font-size: 14px; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 90px; align-items: center; }
.lead { font-size: 17px; color: #58645f; max-width: 590px; margin-top: 24px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.integration-grid span { background: #f8f9f6; border: 1px solid #d7ddd8; border-radius: 10px; min-height: 54px; display: flex; align-items: center; padding: 0 16px; font-size: 13px; font-weight: 650; }

.text-link { font-size: 13px; text-decoration: none; color: #43514c; border-bottom: 1px solid #9dab9f; padding-bottom: 2px; justify-self: end; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.metric { padding: 30px 25px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric strong { display: block; font-size: 34px; line-height: 1; letter-spacing: -.04em; margin-bottom: 12px; }
.metric span { display: block; font-size: 13px; font-weight: 650; }
.metric small { display: block; color: #7a8781; font-size: 11px; margin-top: 5px; }
.method-note { font-size: 12px; color: #78847e; max-width: 900px; margin: 18px 0 0; }

.cite-grid { display: grid; grid-template-columns: 1fr .9fr; gap: 90px; align-items: center; }
.section-dark p { color: #aebbb6; max-width: 650px; }
.cite-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.btn-light { background: white; border: 1px solid white; color: var(--ink); }
.btn-dark-outline { border: 1px solid #466058; color: white; }
.citation-box { border: 1px solid #30443d; background: #0b1916; border-radius: var(--radius); padding: 24px; }
.citation-top { display: flex; justify-content: space-between; align-items: center; color: #739388; font-size: 10px; letter-spacing: .16em; font-weight: 750; }
.citation-top button { font: inherit; letter-spacing: .05em; color: #b9c7c2; background: transparent; border: 1px solid #385047; border-radius: 7px; padding: 6px 9px; cursor: pointer; }
.citation-box p { font-family: Georgia, serif; color: #e0e7e4; font-size: 19px; line-height: 1.55; margin: 30px 0 26px; }
.citation-id { border-top: 1px solid #2b3e37; padding-top: 16px; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.scope-section { padding-top: 78px; padding-bottom: 78px; }
.scope-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 100px; align-items: start; }
.scope-grid h2 { font-size: 38px; }
.scope-grid > p { margin: 0; color: #5d6964; font-size: 15px; max-width: 720px; }

.site-footer { border-top: 1px solid var(--line); padding: 34px 0 42px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr .8fr .6fr; gap: 30px; align-items: end; }
.footer-brand { margin-bottom: 10px; }
.footer-inner p { margin: 0; color: #74807a; font-size: 12px; }
.footer-links { display: flex; gap: 17px; flex-wrap: wrap; font-size: 12px; }
.footer-links a { text-decoration: none; color: #4d5b55; }
.footer-meta { font-size: 11px; color: #88928e; text-align: right; }

@media (max-width: 980px) {
  .hero-grid, .section-heading, .split, .cite-grid, .scope-grid { grid-template-columns: 1fr; gap: 38px; }
  .hero { padding-top: 74px; }
  .invariant-card { max-width: 620px; }
  .cards.four, .metrics { grid-template-columns: repeat(2, 1fr); }
  .lifecycle { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .lifecycle li:nth-child(4) { border-left: 0; padding-left: 0; }
  .lifecycle li:nth-child(3)::after, .lifecycle li:last-child::after { display: none; }
  .text-link { justify-self: start; }
  .footer-inner { grid-template-columns: 1fr; align-items: start; }
  .footer-meta { text-align: left; }
}

@media (max-width: 680px) {
  .wrap { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { height: 64px; }
  .top-nav a:not(.nav-github) { display: none; }
  .brand-text { font-size: 10px; }
  .hero { padding: 58px 0 62px; }
  h1 { font-size: 48px; }
  .hero-copy { font-size: 17px; }
  .hero-actions .btn { width: 100%; }
  .invariant-card > p { font-size: 22px; }
  .lifecycle { grid-template-columns: 1fr 1fr; }
  .lifecycle li:nth-child(3), .lifecycle li:nth-child(5) { border-left: 0; padding-left: 0; }
  .lifecycle li:nth-child(4) { border-left: 1px solid rgba(255,255,255,.13); padding-left: 22px; }
  .lifecycle li:nth-child(2)::after, .lifecycle li:nth-child(4)::after { display: none; }
  .lifecycle li:nth-child(3)::after { display: block; }
  .section { padding: 68px 0; }
  .cards.four, .metrics, .integration-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card h3 { margin-top: 32px; }
  .metric { border-left: 0; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: 0; }
  .citation-box p { font-size: 17px; }
  .scope-grid { gap: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


/* Rosetta Core architecture diagram */
.wide-wrap {
  width: min(calc(100% - 40px), 1500px);
  margin: 0 auto;
}

.architecture-section {
  padding-top: 86px;
  padding-bottom: 88px;
}

.architecture-heading {
  width: min(100%, var(--max));
  margin-left: auto;
  margin-right: auto;
}

.architecture-figure {
  margin: 40px 0 0;
}

.architecture-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 46px rgba(11,23,20,.07);
  scrollbar-width: thin;
  scrollbar-color: #aab5af transparent;
}

.architecture-scroll:focus-visible {
  outline: 3px solid rgba(10,93,66,.28);
  outline-offset: 4px;
}

.architecture-image-link {
  display: block;
  line-height: 0;
}

.architecture-scroll img {
  display: block;
  width: 100%;
  min-width: 1100px;
  height: auto;
}

.architecture-figure figcaption {
  width: min(100%, var(--max));
  margin: 14px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #74807a;
  font-size: 12px;
  line-height: 1.5;
}

.architecture-figure figcaption span {
  max-width: 820px;
}

.architecture-figure figcaption a {
  flex: 0 0 auto;
  color: #43514c;
  text-decoration: none;
  border-bottom: 1px solid #9dab9f;
  align-self: flex-start;
}

@media (max-width: 680px) {
  .wide-wrap {
    width: min(calc(100% - 28px), 1500px);
  }

  .architecture-section {
    padding-top: 66px;
    padding-bottom: 68px;
  }

  .architecture-figure {
    margin-top: 30px;
  }

  .architecture-scroll img {
    min-width: 1040px;
  }

  .architecture-figure figcaption {
    flex-direction: column;
    gap: 8px;
  }
}
