:root {
  --bg: #f5efe6;
  --paper: #fbf8f3;
  --ink: #1d1a16;
  --muted: #6f6558;
  --line: #d8cbb9;
  --accent: #b49362;
  --dark: #0f0e0c;
  --light: #ffffff;
}

html, body {
  height: 100%;
}

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* prevent horizontal scroll on mobile */
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; background: var(--paper); padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 6px; }

.container {
  width: min(1100px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(245, 239, 230, .92);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand-mark { display: block; }
.brand-name {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  letter-spacing: .02em;
  font-size: 1.25rem;
}
.hanzi { font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); font-size: .95rem; margin-left: .35rem; }

.nav { display: inline-flex; align-items: center; gap: 1rem; }
.nav-links { display: inline-flex; gap: 1rem; align-items: center; }
.nav-cta { display: inline-flex; gap: .6rem; align-items: center; }
.nav-toggle { display: none; width: 34px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%); position: relative; }
.nav-toggle::before, .nav-toggle::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--ink); }
.nav-toggle::before { top: 8px; }
.nav-toggle::after { bottom: 8px; }
.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem;
}
.nav-link:hover { color: var(--ink); }

.button {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  border-radius: 8px;
  padding: .45rem .8rem;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .05s ease;
}
.button:hover { border-color: var(--muted); background: rgba(0,0,0,.02); }
.button:active { transform: translateY(1px); }
.button-solid { background: var(--ink); color: var(--light); border-color: var(--ink); }
.button-solid:hover { background: var(--dark); border-color: var(--dark); }
.button-outline { background: transparent; }
.button.small { padding: .3rem .6rem; font-size: .8rem; border-radius: 7px; }

.x-btn { display: inline-flex; align-items: center; gap: .4rem; }
.x-icon { width: 16px; height: 16px; fill: currentColor; display: block; }

.site-main { padding: 2.25rem 0 4rem; }
.eyebrow { color: var(--muted); margin: 1.5rem 0 3.5rem; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 1rem 0 2.25rem; }

.section { margin: 2.25rem 0; }
.prose { max-width: 68ch; }
.prose h2, .prose h3 { font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .015em; }
.prose h2 { font-size: 1.35rem; margin: 0 0 1rem; }
.prose h3 { font-size: 1.1rem; margin: 0 0 .6rem; }
.prose p { margin: .65rem 0; }
.prose .cite { color: var(--muted); font-size: .9rem; }
.prose a { color: inherit; text-underline-offset: 2px; }

.grid.two {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.2rem;
  align-items: start;
}

/* Center the contract card when it is the only item */
#contract.grid.two { grid-template-columns: 1fr; justify-items: center; }
#contract .yin-yang-card { justify-self: center; max-width: 640px; width: 100%; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}
.panel-light { background: var(--paper); }
.panel-dark {
  background: #141313;
  color: var(--light);
  border-color: #24221f;
}
.panel-balance { background: linear-gradient(180deg, #141313 0%, #10100f 100%); color: var(--light); border-color: #22211f; }
.bullets { padding-left: 1.1rem; margin: .5rem 0 0; }
.bullets li { margin: .35rem 0; }

/* Yin–Yang card */
.yin-yang-card { position: relative; overflow: hidden; }
.yin-yang-card { display: grid; grid-template-rows: auto auto; gap: .75rem; }
.yin-yang-card .card-copy { z-index: 2; }

/* Create the circle and S-curve using layered backgrounds */
.yin-yang-card::before {
  content: "";
  display: block;
  aspect-ratio: 1/1;
  width: 86%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, var(--light) 18%, transparent 19%)
    ,radial-gradient(circle at 50% 75%, var(--dark) 18%, transparent 19%)
    ,radial-gradient(circle at 50% 25%, var(--dark) 50%, transparent 51%)
    ,radial-gradient(circle at 50% 75%, var(--light) 50%, transparent 51%)
    ,linear-gradient(180deg, var(--dark) 50%, var(--light) 0);
  border: 1px solid #2a2825;
  margin: .9rem auto .75rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

/* Decorative hanzi watermark to tie brand */
.yin-yang-card::after {
  content: "阴阳";
  position: absolute;
  right: 1rem;
  top: .6rem;
  color: rgba(255, 255, 255, 0.664);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2.2rem;
  letter-spacing: .1em;
}

.address-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.address-row { justify-content: center; }
.address {
  background: rgba(255,255,255,.07);
  color: inherit;
  border: 1px dashed rgba(255,255,255,.2);
  padding: .35rem .5rem;
  border-radius: 8px;
  word-break: break-all;
  text-align: center;
}
.yin-yang-card .card-copy h3 { text-align: center; }
.yin-yang-card .button-outline { background: var(--light); color: var(--ink); border-color: var(--light); }
.yin-yang-card .button-outline:hover { background: #f0f0f0; border-color: #f0f0f0; }
.subtle { color: #c9c3ba; font-size: .92rem; margin-top: .25rem; }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 3rem; color: var(--muted); font-size: .95rem; }

/* Images and media */
img, svg, video { max-width: 100%; height: auto; display: block; }

/* Principles */
.principles { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
.principles-title { font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; color: var(--muted); margin: 0 0 .35rem; }
.principles-grid { list-style: none; padding: 0; margin: .25rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem 1rem; }
.pair { display: flex; align-items: baseline; gap: .45rem; justify-content: center; font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pair .yin { color: var(--muted); }
.pair .yang { color: var(--ink); }
.pair .divider { color: var(--line); }
.principles-note { margin-top: .6rem; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  .nav { width: 100%; justify-content: flex-end; gap: .6rem; }
  .nav-toggle { display: inline-block; }
  .nav-links { position: absolute; top: 56px; right: 0; background: rgba(245,239,230,.98); backdrop-filter: blur(6px); border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: .6rem; display: none; flex-direction: column; gap: .4rem; }
  .nav.open .nav-links { display: inline-flex; }
  .nav-cta { display: none; }
}

@media (max-width: 520px) {
  .header-inner { gap: .75rem; }
  .nav { gap: .6rem; }
  .brand-name { font-size: 1.1rem; }
  .button { padding: .4rem .65rem; }
  .container { width: calc(100% - 2rem); }
}

/* Accessibility and motion */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


