@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #e9e9e5;
  --ink: #11110f;
  --muted: #666660;
  --line: rgba(17, 17, 15, 0.17);
  --inverse: #f5f5f1;
  --dark: #10110f;
  --accent: #1868ff;
  --header-bg: rgba(244, 244, 241, 0.82);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
  --max: 1440px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131411;
  --surface: #1c1d19;
  --ink: #f0f0eb;
  --muted: #a3a39b;
  --line: rgba(240, 240, 235, 0.17);
  --inverse: #11120f;
  --dark: #ecece7;
  --accent: #6b9cff;
  --header-bg: rgba(19, 20, 17, 0.82);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms ease, color 240ms ease;
}

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 200ms ease;
}
.site-header.scrolled { border-color: var(--line); }

.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 13px; font-weight: 600; }
.brand img { filter: none; }
[data-theme="dark"] .brand img, [data-theme="dark"] .about-mark img { filter: invert(1); }

.nav { display: flex; align-items: center; gap: 32px; font-size: 13px; }
.nav a, .github-link { color: var(--muted); transition: color 180ms ease; }
.nav a:hover, .github-link:hover { color: var(--ink); }

.header-actions { justify-self: end; display: flex; align-items: center; gap: 20px; font-size: 13px; }
.icon-button { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.icon-button:hover { background: var(--surface); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.hero {
  position: relative;
  min-height: 92svh;
  padding: clamp(150px, 19vh, 220px) var(--gutter) 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow, .section-index, .platform, .note-tag {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.eyebrow { margin-bottom: 28px; }
.hero h1 {
  margin: 0;
  max-width: 1050px;
  font-size: clamp(66px, 10vw, 154px);
  font-weight: 500;
  line-height: 0.82;
}
.hero h1 em { font-family: var(--serif); font-weight: 400; }
.hero-copy { margin: 48px 0 28px; color: var(--muted); font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; }
.text-link { display: inline-flex; align-items: center; gap: 10px; width: fit-content; min-height: 44px; border-bottom: 1px solid var(--ink); font-size: 14px; }
.text-link span { transition: transform 180ms ease; }
.text-link:hover span { transform: translate(3px, -3px); }
.hero-link:hover span { transform: translateY(4px); }

.hero-orbit {
  position: absolute;
  right: var(--gutter);
  bottom: 72px;
  width: 168px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; background: var(--ink); border-radius: 50%; width: 5px; height: 5px; }
.hero-orbit::before { top: -3px; left: 50%; }
.hero-orbit::after { bottom: 18px; right: 18px; }
.hero-orbit span { position: absolute; font-size: 9px; color: var(--muted); }
.hero-orbit span:nth-child(1) { top: 45%; left: -16px; }
.hero-orbit span:nth-child(2) { top: 45%; right: -16px; }
.hero-orbit span:nth-child(3) { bottom: -6px; left: 39%; }

.section { max-width: var(--max); margin: 0 auto; padding: 140px var(--gutter); }
.section-heading { display: grid; grid-template-columns: 1fr 2fr; align-items: start; margin-bottom: 72px; }
.section-heading h2, .about h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 7vw, 100px);
  font-weight: 400;
  line-height: 0.93;
}

.looprec-feature {
  position: relative;
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(310px, 0.75fr) minmax(0, 1.6fr);
  overflow: hidden;
  background: #101210;
  color: #f5f5f1;
  border-radius: 8px;
}
.product-copy { z-index: 2; padding: clamp(36px, 5vw, 72px); display: flex; flex-direction: column; align-items: flex-start; }
.product-identity { display: flex; align-items: center; gap: 20px; }
.product-identity img { border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.product-identity h3 { margin: 3px 0 0; font-size: 24px; font-weight: 500; }
.platform { color: #93998f; }
.product-lead { margin: auto 0 22px; font-family: var(--serif); font-size: clamp(44px, 5vw, 74px); line-height: .94; }
.product-description { max-width: 390px; margin: 0 0 32px; color: #a8ada4; font-size: 15px; line-height: 1.7; }
.button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; gap: 12px; border-radius: 4px; font-size: 13px; font-weight: 500; transition: transform 180ms ease, background 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button-light { background: #f3f3ef; color: #10110f; }
.button-light:hover { background: #fff; }

.product-visual { position: relative; display: flex; align-items: center; padding: 80px 0 80px 20px; overflow: hidden; }
.product-visual img { position: relative; z-index: 2; width: min(920px, 115%); max-width: none; filter: drop-shadow(0 30px 50px rgba(0,0,0,.5)); }
.window-glow { position: absolute; width: 75%; aspect-ratio: 1; background: rgba(39, 115, 255, .2); filter: blur(80px); border-radius: 50%; }

.product-list { margin-top: 72px; border-top: 1px solid var(--line); }
.product-row { min-height: 126px; display: grid; grid-template-columns: 80px 1fr 1.8fr 1fr 24px; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); transition: padding 200ms ease, color 200ms ease; }
a.product-row:hover { padding-left: 12px; color: var(--accent); }
.product-number, .product-type { color: var(--muted); font-size: 12px; }
.product-name { font-family: var(--serif); font-size: 34px; }
.product-summary { color: var(--muted); font-size: 14px; }
.status-dot { justify-self: center; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }

.principles { max-width: none; background: var(--surface); }
.principles > * { max-width: calc(var(--max) - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.principle-list { margin-top: 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 7vw, 110px); }
.principle { padding-top: 24px; border-top: 1px solid var(--line); }
.principle > span { color: var(--muted); font-size: 11px; }
.principle h3 { margin: 80px 0 24px; font-family: var(--serif); font-size: clamp(40px, 4vw, 60px); font-weight: 400; line-height: .95; }
.principle p { max-width: 260px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.note-links { margin-top: 10px; border-top: 1px solid var(--line); }
.note-link { min-height: 112px; display: grid; grid-template-columns: 100px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); transition: padding 200ms ease, color 200ms ease; }
.note-link:hover { padding: 0 12px; color: var(--accent); }
.note-link > span:nth-child(2) { display: flex; align-items: baseline; gap: 30px; }
.note-link strong { min-width: 220px; font-family: var(--serif); font-size: 30px; font-weight: 400; }
.note-link small { color: var(--muted); font-size: 13px; }

.about { display: grid; grid-template-columns: 1fr 2fr; min-height: 680px; align-items: center; border-top: 1px solid var(--line); }
.about-mark { width: clamp(110px, 14vw, 190px); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.about-mark img { width: 55%; }
.about-copy .section-index { margin-bottom: 48px; }
.about-copy > p:not(.section-index) { max-width: 600px; margin: 48px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.7; }

.site-footer { min-height: 120px; margin: 0 var(--gutter); display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-brand { color: var(--ink); }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms cubic-bezier(.2,.75,.25,1), transform 700ms cubic-bezier(.2,.75,.25,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.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; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .site-header { grid-template-columns: 1fr auto; height: 64px; }
  .nav { display: none; }
  .github-link { display: none; }
  .hero { min-height: 88svh; padding-top: 130px; justify-content: center; }
  .hero h1 { font-size: clamp(60px, 19vw, 100px); }
  .hero-orbit { display: none; }
  .desktop-break { display: none; }
  .section { padding-top: 96px; padding-bottom: 96px; }
  .section-heading { grid-template-columns: 1fr; gap: 36px; margin-bottom: 48px; }
  .looprec-feature { min-height: auto; grid-template-columns: 1fr; }
  .product-copy { min-height: 580px; }
  .product-visual { min-height: 400px; padding: 30px 0 70px 32px; }
  .product-visual img { width: 125%; }
  .product-row { grid-template-columns: 42px 1fr auto; gap: 12px; padding: 24px 0; }
  .product-summary { grid-column: 2 / 4; }
  .product-type { grid-column: 2; }
  .row-arrow, .status-dot { grid-column: 3; grid-row: 1; }
  .principle-list { grid-template-columns: 1fr; }
  .principle h3 { margin-top: 44px; }
  .note-link { grid-template-columns: 64px 1fr auto; padding: 24px 0; }
  .note-link > span:nth-child(2) { flex-direction: column; gap: 6px; align-items: flex-start; }
  .note-link strong { min-width: 0; }
  .about { grid-template-columns: 1fr; gap: 70px; }
  .site-footer { min-height: 180px; grid-template-columns: 1fr auto; }
  .site-footer > p:first-of-type { grid-column: 1 / 3; grid-row: 1; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 18vw; }
  .hero-copy { margin-top: 36px; }
  .product-copy { min-height: 540px; padding: 28px; }
  .product-identity img { width: 58px; height: 58px; }
  .product-visual { min-height: 300px; padding-left: 20px; }
  .product-row { grid-template-columns: 34px 1fr auto; }
  .product-name { font-size: 30px; }
  .product-type { display: none; }
  .note-link { grid-template-columns: 52px 1fr auto; }
  .note-link strong { font-size: 25px; }
  .note-link small { font-size: 12px; }
  .site-footer { margin: 0 20px; }
}

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