:root {
  --bg: #f5f4ee;
  --bg-line: rgba(23, 35, 31, 0.035);
  --surface: #ffffff;
  --surface-soft: #fbfaf5;
  --surface-strong: #eef4ef;
  --ink: #17231f;
  --muted: #607067;
  --muted-strong: #43534b;
  --primary: #176b50;
  --primary-dark: #0f4737;
  --accent: #9a6a16;
  --link: #245f9f;
  --border: #d9e1da;
  --warning: #fff7e6;
  --warning-border: #e4c875;
  --focus: #9a6a16;
  --dark: #0d1a15;
  --dark-soft: #14251f;
  --radius: 8px;
  --shadow: 0 24px 64px rgba(23, 35, 31, 0.12);
  --header-height: 68px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--bg-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-line) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
}

body,
button,
select {
  font: inherit;
}

a {
  color: var(--link);
  touch-action: manipulation;
}

img,
svg {
  max-width: 100%;
}

button,
select,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid rgba(154, 106, 22, 0.36);
  outline-offset: 3px;
}

::selection {
  background: rgba(23, 107, 80, 0.18);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  text-decoration: none;
  transition: transform 180ms ease;
}

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

.global-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  border-bottom: 1px solid rgba(217, 225, 218, 0.72);
  background: rgba(245, 244, 238, 0.88);
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(100% - 32px, 1080px);
  min-height: var(--header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  min-width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
}

.brand-mark::before {
  content: "";
  width: 17px;
  height: 12px;
  display: block;
  background:
    linear-gradient(#ffffff, #ffffff) 0 0 / 100% 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 0 5px / 100% 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 0 10px / 100% 2px no-repeat;
}

.nav-links,
.nav-actions,
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links a,
.mobile-panel a,
.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-links a {
  padding: 0 10px;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  background: rgba(23, 107, 80, 0.08);
  color: var(--primary-dark);
}

.nav-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.language {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(23, 107, 80, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  padding: 0 12px;
}

.language-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1.7px solid var(--primary);
  border-radius: 50%;
  position: relative;
}

.language-icon::before,
.language-icon::after {
  content: "";
  position: absolute;
  background: var(--primary);
}

.language-icon::before {
  width: 10px;
  height: 1.5px;
  top: 6px;
  left: 2px;
}

.language-icon::after {
  width: 1.5px;
  height: 10px;
  top: 2px;
  left: 6px;
}

.language select {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.language select:focus-visible {
  outline: 0;
}

.nav-download,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-weight: 740;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-download {
  padding: 0 16px;
  font-size: 14px;
}

.button {
  padding: 0 18px;
}

.button.secondary {
  background: var(--surface);
  color: var(--primary-dark);
}

.button.subtle {
  border-color: var(--border);
  background: transparent;
  color: var(--primary-dark);
}

.nav-download:hover,
.nav-download:focus-visible,
.button:hover,
.button:focus-visible {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.mobile-menu {
  position: relative;
  display: none;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--primary-dark);
  cursor: pointer;
  list-style: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  position: relative;
}

.menu-lines::before,
.menu-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-lines::before {
  top: -6px;
}

.menu-lines::after {
  top: 6px;
}

.mobile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: min(290px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 8px;
}

.mobile-panel a {
  padding: 0 12px;
}

.mobile-panel a:hover,
.mobile-panel a:focus-visible,
.mobile-panel a.active,
.mobile-panel a[aria-current="page"] {
  background: rgba(23, 107, 80, 0.08);
  color: var(--primary-dark);
}

.site-main {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.hero {
  min-height: calc(100dvh - var(--header-height) - 40px);
  display: grid;
  align-items: center;
  gap: 32px;
  padding: 72px 0 56px;
}

.home-hero {
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
}

.page-hero {
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.82fr);
  min-height: auto;
  padding-bottom: 48px;
}

.hero-copy,
.section-header,
.flow-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 780;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.98;
  font-weight: 820;
}

.page-hero h1 {
  font-size: clamp(38px, 7vw, 76px);
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.08;
  font-weight: 780;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.24;
  font-weight: 760;
}

p {
  color: var(--muted);
  text-wrap: pretty;
}

.lead,
.subhead {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.52;
}

.hero-actions,
.inline-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--link);
  font-weight: 720;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.section {
  padding: 72px 0;
}

.section + .section {
  border-top: 1px solid rgba(217, 225, 218, 0.74);
}

.section-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.hero-stage {
  min-width: 0;
  min-height: 540px;
  position: relative;
  display: grid;
  place-items: center;
}

.product-orbit {
  position: absolute;
  width: min(92%, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(154, 106, 22, 0.2);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(154, 106, 22, 0.14) 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, rgba(154, 106, 22, 0.14) 50%, transparent 50.2%);
}

.product-orbit::before,
.product-orbit::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(23, 107, 80, 0.14);
  border-radius: 50%;
}

.product-orbit::after {
  inset: 33%;
}

.device,
.tablet,
.phone-preview,
.scope-panel,
.principle-panel,
.release-panel,
.code-panel {
  border: 1px solid rgba(217, 225, 218, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.device {
  width: min(100%, 350px);
  min-height: 470px;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 28px;
}

.app-title {
  margin-bottom: 0;
  font-size: 30px;
}

.app-note,
.release-kicker,
.panel-kicker {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.app-list,
.principle-list,
.scope-list,
.flow-list,
.clause-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-row,
.principle-list li,
.scope-list li,
.flow-list li,
.clause {
  min-width: 0;
  display: flex;
  gap: 12px;
}

.app-row {
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.app-row span:last-child,
.principle-list div,
.scope-list div,
.flow-list div,
.clause div {
  min-width: 0;
}

.app-row strong,
.app-row span span {
  display: block;
}

.app-row span span {
  color: var(--muted);
  font-size: 14px;
}

.glyph {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background:
    linear-gradient(var(--primary), var(--primary)) 6px 7px / 14px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 6px 12px / 14px 2px no-repeat,
    linear-gradient(var(--primary), var(--primary)) 6px 17px / 14px 2px no-repeat,
    #e2f2ec;
}

.floating-card {
  position: absolute;
  z-index: 2;
  width: min(190px, 42vw);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  box-shadow: 0 12px 36px rgba(23, 35, 31, 0.1);
}

.floating-card strong,
.floating-card span {
  display: block;
}

.floating-card span {
  color: var(--muted);
  font-size: 14px;
}

.floating-card.left {
  left: 0;
  top: 72px;
}

.floating-card.right {
  right: 0;
  bottom: 78px;
}

.screen-lineup,
.flow-layout,
.terms-layout,
.product-grid {
  display: grid;
  gap: 24px;
}

.screen-lineup,
.flow-layout,
.terms-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  align-items: start;
}

.tablet {
  min-height: 280px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 24px;
}

.screen-heading strong,
.screen-heading span {
  display: block;
}

.screen-heading strong {
  font-size: 24px;
}

.screen-heading span {
  color: var(--muted);
}

.screen-grid,
.trust-grid,
.matrix,
.action-grid,
.platform-grid,
.principles-grid,
.method-grid,
.layer-grid,
.summary-grid {
  display: grid;
  gap: 12px;
}

.screen-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.screen-grid div,
.trust-card,
.matrix-card,
.help-card,
.status-card,
.principle-card,
.method-card,
.layer-card,
.summary-card,
.product-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.screen-grid span,
.method-card span,
.layer-card span,
.summary-card span,
.product-card span,
.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border-radius: 999px;
  background: #e1f0ea;
  color: var(--primary-dark);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
}

.small-phone,
.phone-preview {
  min-height: 280px;
  position: relative;
  padding: 20px;
}

.small-phone::before,
.phone-preview::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--primary), var(--primary)) 24px 28px / 88px 8px no-repeat,
    linear-gradient(#dfe8e2, #dfe8e2) 24px 54px / 150px 8px no-repeat,
    linear-gradient(#e7eee8, #e7eee8) 24px 78px / calc(100% - 48px) 48px no-repeat,
    linear-gradient(#e7eee8, #e7eee8) 24px 142px / calc(100% - 48px) 48px no-repeat,
    linear-gradient(#e7eee8, #e7eee8) 24px 206px / calc(100% - 48px) 48px no-repeat,
    var(--surface-soft);
}

.dark-band {
  padding: 72px 24px;
  background: var(--dark);
  color: #ffffff;
}

.dark-band h2,
.dark-band h3,
.dark-band .eyebrow {
  color: #ffffff;
}

.dark-band p {
  color: rgba(255, 255, 255, 0.72);
}

.dark-band .matrix-card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.dark-band .status {
  background: rgba(215, 239, 229, 0.16);
  color: #d7efe5;
}

.matrix,
.trust-grid,
.action-grid,
.platform-grid,
.principles-grid,
.method-grid,
.layer-grid,
.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trust-grid,
.action-grid,
.method-grid,
.layer-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.help-card {
  min-height: 206px;
  display: grid;
  gap: 10px;
  align-content: start;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.help-card span:not(.glyph),
.help-card em {
  color: var(--muted);
  font-style: normal;
}

.help-card em {
  align-self: end;
  color: var(--link);
  font-weight: 760;
}

.help-card:hover,
.help-card:focus-visible {
  border-color: rgba(23, 107, 80, 0.42);
  background: var(--surface-soft);
  transform: translateY(-2px);
}

.soft-section {
  padding: 64px 0;
  background: rgba(255, 255, 255, 0.36);
}

.principle-panel,
.scope-panel,
.release-panel,
.code-panel {
  padding: 24px;
}

.principle-list li,
.scope-list li,
.flow-list li,
.clause {
  border-bottom: 1px solid var(--border);
  padding: 0 0 14px;
}

.principle-list li:last-child,
.scope-list li:last-child,
.flow-list li:last-child,
.clause:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.step-number,
.scope-number,
.step,
.clause-num {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.release-panel dl {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.release-title {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.16;
}

.support-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.support-meta li {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted-strong);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 720;
}

.release-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.release-row dt {
  color: var(--muted);
}

.release-row dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.status-ready,
.badge {
  color: var(--primary-dark);
  font-weight: 780;
}

.badge.pending {
  background: var(--warning);
  color: #725010;
}

.code-box {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-index {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  display: grid;
  gap: 6px;
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

.term-index a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  font-weight: 720;
  text-decoration: none;
}

.term-index a:hover,
.term-index a:focus-visible {
  color: var(--link);
}

.clause {
  scroll-margin-top: 96px;
}

.clause-note,
.notice {
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  background: var(--warning);
  color: #5a4212;
  padding: 16px;
}

.clause-note {
  margin-top: 12px;
}

.notice {
  margin: 32px 0 0;
}

.footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.54);
}

.footer-inner {
  width: min(100% - 32px, 1080px);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  padding: 0 6px;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-links a[aria-current="page"] {
  color: var(--primary-dark);
}

section[id],
article[id] {
  scroll-margin-top: 92px;
}

.wrap-anywhere {
  overflow-wrap: anywhere;
}

[translate="no"] {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .home-hero,
  .page-hero,
  .screen-lineup,
  .flow-layout,
  .terms-layout,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 460px;
  }

  .term-index {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    border-top: 2px solid var(--border);
    padding: 12px 0 0;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    width: min(100% - 24px, 1080px);
    gap: 10px;
  }

  .brand span:last-child {
    font-size: 15px;
  }

  .language {
    max-width: 48px;
    padding: 0;
    justify-content: center;
  }

  .language::after {
    content: "Aa";
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .language-icon {
    display: none;
  }

  .language select {
    position: absolute;
    width: 44px;
    opacity: 0.01;
  }

  .nav-download {
    display: none;
  }

  .site-main,
  .footer-inner {
    width: min(100% - 24px, 1080px);
  }

  .hero {
    min-height: auto;
    padding: 54px 0 44px;
  }

  h1 {
    font-size: clamp(40px, 15vw, 66px);
  }

  .page-hero h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  h2 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .lead,
  .subhead {
    font-size: 18px;
  }

  .hero-actions,
  .inline-actions,
  .section-actions {
    display: grid;
  }

  .button,
  .text-link {
    width: 100%;
  }

  .hero-stage {
    min-height: 420px;
  }

  .device {
    width: min(100%, 318px);
    min-height: 430px;
    padding: 22px;
  }

  .floating-card {
    display: none;
  }

  .screen-grid,
  .matrix,
  .trust-grid,
  .action-grid,
  .platform-grid,
  .principles-grid,
  .method-grid,
  .layer-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dark-band {
    padding-inline: 14px;
  }

  .section {
    padding: 54px 0;
  }

  .term-index {
    grid-template-columns: 1fr;
  }

  .release-row {
    display: grid;
    gap: 4px;
  }

  .release-row dd {
    text-align: left;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
  }

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

@media (max-width: 390px) {
  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand span:last-child {
    max-width: 104px;
    overflow-wrap: anywhere;
  }

  .nav-inner {
    width: calc(100% - 18px);
  }

  .site-main,
  .footer-inner {
    width: calc(100% - 18px);
  }
}

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