:root {
  --bg: #f4f1ea;
  --bg-soft: #f9f7f2;
  --surface: #fffdf8;
  --surface-soft: #f5f0e6;
  --ink: #23262b;
  --ink-soft: #5d646d;
  --accent: #1e5e58;
  --accent-strong: #174843;
  --signal: #9d6530;
  --ok: #2f7455;
  --line: #d8cfc1;
  --line-strong: #c6b7a0;
  --shadow: 0 14px 34px rgba(45, 37, 26, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 760px at -6% -16%, rgba(30, 94, 88, 0.12), transparent 58%),
    radial-gradient(860px 520px at 108% -24%, rgba(157, 101, 48, 0.11), transparent 60%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 34px,
      rgba(198, 183, 160, 0.11) 35px,
      rgba(198, 183, 160, 0.11) 36px
    ),
    linear-gradient(180deg, #fbf9f4 0%, #f3efe6 58%, #eee8dd 100%);
  line-height: 1.56;
  background-size: 125% 125%;
  animation: paperShift 24s ease-in-out infinite alternate;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.52rem;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  line-height: 1.14;
  letter-spacing: 0;
}

p {
  margin: 0 0 0.84rem;
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(248, 245, 238, 0.9);
  border-bottom: 1px solid rgba(198, 183, 160, 0.72);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.42rem, 2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #253233;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.38rem 0.7rem;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #2f3e40;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.62);
}

main {
  padding: 2.4rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.95rem;
}

.hero-main,
.hero-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-main {
  position: relative;
  overflow: hidden;
  padding: clamp(1.18rem, 2.5vw, 1.95rem);
  background:
    radial-gradient(460px 180px at 94% -40%, rgba(30, 94, 88, 0.14), transparent 65%),
    var(--surface);
}

.hero-card {
  padding: 1.08rem 1.18rem;
  background:
    radial-gradient(320px 140px at 96% -24%, rgba(157, 101, 48, 0.12), transparent 67%),
    #fdfaf3;
}

.hero-card ol {
  margin: 0;
  padding-left: 1.16rem;
}

.hero-card li {
  margin-bottom: 0.56rem;
}

.eyebrow {
  margin-bottom: 0.44rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--signal);
  font-weight: 700;
  font-size: 0.72rem;
}

h1 {
  font-size: clamp(2.18rem, 4.5vw, 3.4rem);
  margin-bottom: 0.76rem;
}

.lead {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.28vw, 1.14rem);
}

.hero-floats {
  position: absolute;
  inset: 1rem 1rem auto auto;
  pointer-events: none;
}

.float-pill {
  position: absolute;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, 0.95);
  color: #3f4f52;
  box-shadow: 0 7px 20px rgba(45, 37, 26, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.24rem 0.62rem;
  animation: floatBob 5.4s ease-in-out infinite;
}

.float-a {
  top: 0.1rem;
  right: 0.5rem;
  animation-delay: 0s;
}

.float-b {
  top: 2.3rem;
  right: 6.8rem;
  animation-delay: 1.2s;
}

.float-c {
  top: 4.9rem;
  right: 1rem;
  animation-delay: 2.1s;
}

.button-row {
  margin-top: 1.14rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.66rem;
}

.hero-stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.stat-chip {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 0.53rem 0.63rem;
  transform: translateY(8px);
  opacity: 0;
  animation: popIn 0.7s cubic-bezier(0.24, 0.8, 0.28, 1) forwards;
}

.stat-chip:nth-child(1) {
  animation-delay: 0.08s;
}

.stat-chip:nth-child(2) {
  animation-delay: 0.18s;
}

.stat-chip:nth-child(3) {
  animation-delay: 0.28s;
}

.stat-value {
  margin: 0 0 0.08rem;
  color: #2f3b3c;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.stat-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.6rem 1.06rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(30, 94, 88, 0.25);
  outline-offset: 2px;
}

.btn-primary {
  color: #f7f9f9;
  background: linear-gradient(135deg, var(--accent) 0%, #24756d 100%);
  box-shadow: 0 10px 24px rgba(30, 94, 88, 0.24);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: -2px auto -2px -34%;
  width: 28%;
  transform: skewX(-24deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: sheen 4s ease-in-out infinite;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, #174843 0%, #1f645d 100%);
}

.btn-secondary {
  color: #2e3c3d;
  background: #eee7db;
  border-color: var(--line-strong);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #e5dccd;
}

.btn-ghost {
  color: var(--ink-soft);
  background: #fffcf7;
  border-color: var(--line-strong);
}

.section {
  margin-top: 2.84rem;
}

.section-head {
  margin-bottom: 0.9rem;
}

.section h2 {
  font-size: clamp(1.82rem, 2.8vw, 2.6rem);
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem 1.06rem;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 36px rgba(45, 37, 26, 0.14);
}

.formula-panel {
  margin-top: 0.95rem;
  border-style: dashed;
  background: #faf6ee;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.72rem;
  margin-bottom: 0.76rem;
}

.check-row input {
  margin-top: 0.22rem;
}

.pledge-form {
  max-width: 780px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 0.94rem;
  font-weight: 600;
}

.field-row input,
.field-row textarea,
.field-row select {
  width: 100%;
  border: 1px solid #cbc0af;
  border-radius: var(--radius-sm);
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  padding: 0.62rem 0.7rem;
}

.field-row textarea {
  resize: vertical;
}

input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}

.status-line,
.hint {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.gate-banner {
  margin: 0 0 0.98rem;
  padding: 0.74rem 0.88rem;
  border: 1px solid #d0c4b1;
  border-radius: var(--radius-sm);
  background: #f8f2e6;
  color: #6e5638;
  font-weight: 700;
}

.studio-content.locked {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.compact-form {
  margin-bottom: 1.08rem;
}

.subhead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.56rem;
}

.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.72rem;
}

.conviction-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 0.74rem;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.conviction-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(45, 37, 26, 0.12);
}

.conviction-item.active {
  border-color: #9c8c76;
  box-shadow: 0 0 0 2px rgba(157, 101, 48, 0.14) inset;
}

.conviction-item p:last-child {
  margin-bottom: 0;
}

.mini-summary {
  margin: 0 0 0.8rem;
  padding: 0.64rem 0.74rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f6f1e7;
  color: var(--ink-soft);
  font-size: 0.91rem;
}

.inline-field {
  max-width: 330px;
}

.counterpart-list {
  display: grid;
  gap: 0.74rem;
  margin-bottom: 1rem;
}

.counterpart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  padding: 0.75rem;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  animation: cardIn 0.46s ease forwards;
  animation-delay: var(--card-delay, 0s);
}

.counterpart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.score-pill {
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  border: 1px solid #c5b59d;
  background: #f0e8d9;
  color: #63513a;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.counterpart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid #cdbfab;
  background: #f8f3ea;
  color: #6a5a45;
  padding: 0.17rem 0.54rem;
  font-size: 0.78rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.56rem;
  font-size: 0.84rem;
}

.score-grid span {
  color: var(--ink-soft);
}

.session-head {
  margin-top: 0.35rem;
}

.threshold-note {
  margin-top: -0.28rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.threshold-note.triggered {
  color: var(--ok);
  font-weight: 700;
}

.threshold-note.neutral {
  color: #7a5f42;
}

.action-block.hidden {
  display: none;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.74rem;
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ledger-list {
  display: grid;
  gap: 0.74rem;
}

.ledger-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  padding: 0.8rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ledger-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(45, 37, 26, 0.1);
}

.ledger-item.done {
  border-color: #bcd3c6;
  background: #f2f8f3;
}

.ledger-meta {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 0.44rem;
}

.site-footer {
  border-top: 1px solid rgba(198, 183, 160, 0.74);
  color: var(--ink-soft);
  padding: 1.6rem 0 2.18rem;
}

.orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(60px);
  z-index: -1;
}

.orb-a {
  width: min(48vw, 560px);
  aspect-ratio: 1;
  left: -16%;
  top: 9%;
  background: rgba(30, 94, 88, 0.17);
  animation: driftA 12s ease-in-out infinite alternate;
}

.orb-b {
  width: min(34vw, 390px);
  aspect-ratio: 1;
  right: -8%;
  top: 31%;
  background: rgba(157, 101, 48, 0.15);
  animation: driftB 14s ease-in-out infinite alternate;
}

.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.99);
  filter: blur(2px);
}

.reveal.reveal-on {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity 0.52s ease, transform 0.52s ease, filter 0.52s ease;
  transition-delay: var(--reveal-delay, 0s);
}

@media (max-width: 1060px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

  .studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(1160px, calc(100% - 1.2rem));
  }

  .main-nav a {
    font-size: 0.87rem;
    padding: 0.34rem 0.58rem;
  }

  .rule-grid,
  .score-grid,
  .date-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-floats {
    display: none;
  }

  .ledger-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

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

@keyframes paperShift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 4% 5%;
  }
}

@keyframes driftA {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(20px, -16px, 0) scale(1.03);
  }
}

@keyframes driftB {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-20px, 16px, 0) scale(1.04);
  }
}

@keyframes floatBob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

@keyframes sheen {
  0% {
    transform: translateX(-180%) skewX(-24deg);
  }
  65% {
    transform: translateX(370%) skewX(-24deg);
  }
  100% {
    transform: translateX(370%) skewX(-24deg);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
