:root {
  --ink: #251f1b;
  --ink-soft: #574d46;
  --paper: #fcf8f2;
  --paper-deep: #f1e6d8;
  --white: #ffffff;
  --copper: #b96d49;
  --copper-dark: #844126;
  --gold: #d7ae5b;
  --teal: #345f61;
  --teal-dark: #214547;
  --line: rgba(37, 31, 27, 0.16);
  --shadow: 0 24px 70px rgba(43, 31, 24, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body.dialog-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.section-shell,
.header-inner,
.hero-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  color: var(--ink);
  border-bottom: 1px solid rgba(37, 31, 27, 0.2);
  background: #b9974b;
  backdrop-filter: blur(14px);
}

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

.wordmark {
  display: inline-flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-name,
.footer-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.05;
}

.wordmark-year {
  margin-top: 4px;
  color: rgba(37, 31, 27, 0.72);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:not(.nav-action):hover,
.site-nav a:not(.nav-action):focus-visible {
  color: var(--white);
}

.nav-action {
  padding: 10px 16px;
  border: 1px solid rgba(37, 31, 27, 0.7);
  border-radius: 4px;
}

.nav-action:hover,
.nav-action:focus-visible {
  color: var(--white) !important;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: 90svh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  background-color: #44362e;
  background-image: url(../img/hero-threshold.png);
  background-position: center center;
  background-size: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: rgba(22, 19, 17, 0.38);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 170px 0 92px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--copper-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero-eyebrow {
  color: #f2cb7f;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 84px;
  font-weight: 400;
  line-height: 0.98;
}

.hero-statement {
  margin: 28px 0 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.3;
}

.primary-action,
.submit-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 22px;
  color: var(--white);
  border: 1px solid var(--copper);
  border-radius: 4px;
  background: var(--copper);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible,
.submit-action:hover,
.submit-action:focus-visible {
  border-color: var(--copper-dark);
  background: var(--copper-dark);
  transform: translateY(-2px);
}

.hero-side-note {
  position: absolute;
  right: 24px;
  bottom: 80px;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.ritual-section,
.choice-section,
.alignment-section {
  scroll-margin-top: 76px;
}

.ritual-section {
  padding: 112px 0;
  background: var(--paper);
}

.ritual-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 110px;
  align-items: start;
}

.ritual-heading {
  position: sticky;
  top: 120px;
}

.ritual-heading h2,
.choice-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 400;
  line-height: 1.08;
}

.section-intro {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.ritual-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.ritual-steps li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 26px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.ritual-steps > li > span {
  color: var(--copper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.ritual-steps h3 {
  margin: 0 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
}

.ritual-steps p {
  margin: 0;
  color: var(--ink-soft);
}

.choice-section {
  padding: 104px 0 120px;
  background: var(--paper-deep);
}

.choice-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 48px;
  align-items: end;
  margin-bottom: 52px;
}

.choice-heading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.number-tile {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--ink);
  border: 1px solid rgba(132, 65, 38, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 24px rgba(88, 59, 42, 0.05);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  cursor: pointer;
  overflow: hidden;
  transition: color 180ms ease, transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.number-tile::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px;
  height: 2px;
  background: var(--copper);
  transform: scaleX(0.24);
  transform-origin: center;
  transition: transform 180ms ease;
}

.number-tile:hover,
.number-tile:focus-visible {
  color: var(--copper-dark);
  border-color: var(--copper);
  background: var(--white);
  transform: translateY(-3px);
  outline: none;
}

.number-tile:hover::after,
.number-tile:focus-visible::after {
  transform: scaleX(1);
}

.alignment-section {
  padding: 112px 0;
  color: var(--white);
  background: var(--teal);
}

.alignment-inner {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 60px;
  align-items: start;
}

.alignment-section .eyebrow {
  color: #f2cb7f;
}

.alignment-section blockquote {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 43px;
  line-height: 1.25;
}

.site-footer {
  padding: 52px 0;
  color: rgba(37, 31, 27, 0.78);
  background: #b9974b;
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
}

.footer-inner p {
  margin: 4px 0 0;
  font-size: 13px;
}

.footer-brand {
  color: var(--ink);
  font-size: 24px !important;
}

.principle-dialog {
  width: min(980px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100svh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: auto;
}

.principle-dialog::backdrop {
  background: rgba(22, 18, 16, 0.76);
  backdrop-filter: blur(7px);
}

.dialog-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 630px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: var(--copper-dark);
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.result-panel,
.form-panel {
  padding: 68px 54px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  color: var(--white);
  background: var(--teal-dark);
}

.result-panel .eyebrow {
  color: #f2cb7f;
}

.result-number {
  margin: 54px 0 18px;
  color: rgba(255, 255, 255, 0.38);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.result-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.result-copy {
  margin: 24px 0 40px;
  color: rgba(255, 255, 255, 0.75);
}

.text-action {
  margin-top: auto;
  padding: 0 0 6px;
  align-self: flex-start;
  color: var(--white);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  color: #f2cb7f;
  border-color: #f2cb7f;
  outline: none;
}

.form-panel {
  background: var(--paper);
}

.form-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
}

.form-heading > p:last-child {
  margin: 14px 0 30px;
  color: var(--ink-soft);
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

.form-row input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid rgba(37, 31, 27, 0.3);
  border-radius: 4px;
  background: var(--white);
}

.form-row input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(185, 109, 73, 0.16);
  outline: none;
}

.form-row input[aria-invalid="true"] {
  border-color: #a12f29;
}

.selected-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.selected-field span {
  color: var(--ink-soft);
  font-size: 13px;
}

.selected-field strong {
  color: var(--teal);
  text-align: right;
}

.submit-action {
  width: 100%;
}

.form-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--teal);
  font-size: 13px;
  text-align: center;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

@media (max-width: 980px) {
  .hero h1 {
    font-size: 66px;
  }

  .ritual-layout {
    gap: 64px;
  }

  .ritual-heading h2,
  .choice-heading h2 {
    font-size: 46px;
  }

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

  .alignment-section blockquote {
    font-size: 36px;
  }

  .result-panel,
  .form-panel {
    padding: 60px 38px;
  }
}

@media (max-width: 720px) {
  .section-shell,
  .header-inner,
  .hero-inner {
    width: min(100% - 32px, 1180px);
  }

  .header-inner {
    min-height: 68px;
  }

  .wordmark-name {
    font-size: 20px;
  }

  .site-nav > a:first-child {
    display: none;
  }

  .nav-action {
    padding: 8px 11px;
    font-size: 12px !important;
  }

  .hero {
    min-height: 86svh;
    background-position: 62% center;
  }

  .hero-inner {
    padding: 136px 0 64px;
  }

  .hero h1 {
    font-size: 48px;
    line-height: 1;
  }

  .hero-statement {
    margin: 22px 0 28px;
    font-size: 22px;
  }

  .hero-side-note {
    display: none;
  }

  .ritual-section,
  .choice-section,
  .alignment-section {
    scroll-margin-top: 68px;
  }

  .ritual-section,
  .choice-section,
  .alignment-section {
    padding: 76px 0;
  }

  .ritual-layout,
  .choice-heading,
  .alignment-inner {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .ritual-heading {
    position: static;
  }

  .ritual-heading h2,
  .choice-heading h2 {
    font-size: 38px;
  }

  .section-intro {
    font-size: 17px;
  }

  .choice-heading {
    margin-bottom: 34px;
  }

  .number-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }

  .number-tile {
    font-size: 21px;
  }

  .alignment-section blockquote {
    font-size: 30px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 30px;
  }

  .principle-dialog {
    width: calc(100% - 20px);
    max-height: calc(100svh - 20px);
  }

  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .dialog-close {
    color: var(--white);
  }

  .result-panel,
  .form-panel {
    padding: 48px 26px;
  }

  .result-panel {
    min-height: 400px;
  }

  .result-number {
    margin-top: 32px;
  }

  .result-panel h2 {
    font-size: 42px;
  }

  .form-heading h3 {
    font-size: 34px;
  }
}

@media (max-width: 360px) {
  .wordmark-year {
    display: none;
  }

  .nav-action {
    padding: 8px 9px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
