:root {
  color-scheme: light;
  --paper: #f4efe4;
  --paper-light: #fffaf0;
  --sand: #e9e0cf;
  --ink: #201714;
  --muted-ink: #6a5d55;
  --lacquer: #7e1719;
  --lacquer-dark: #3a0d0f;
  --brass: #b08a4c;
  --brass-light: #d9b174;
  --line: rgba(32, 23, 20, 0.16);
  --line-strong: rgba(32, 23, 20, 0.32);
  --display: "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --body: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
h1, h2, h3 { font-family: var(--display); }
p, dd { text-wrap: pretty; }
section[id] { scroll-margin-top: 24px; }

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

.skip-link {
  position: fixed;
  z-index: 3;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--paper-light);
  color: var(--lacquer);
  font-weight: 700;
  transform: translateY(-180%);
}

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

/* Header ------------------------------------------------------------- */

.site-header {
  min-height: 74px;
  padding: 0 max(24px, calc((100vw - 1360px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand span { display: grid; line-height: 1.15; }
.brand strong { font-family: var(--display); font-size: 20px; letter-spacing: 0.1em; }
.brand small { margin-top: 3px; color: var(--muted-ink); font-size: 10px; letter-spacing: 0.2em; }

.header-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--lacquer);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--lacquer);
  transition: box-shadow 180ms ease-out, color 180ms ease-out;
}

.header-action:hover { color: var(--lacquer-dark); box-shadow: inset 0 -2px 0 var(--brass); }

/* Hero --------------------------------------------------------------- */

.hero {
  max-width: 1600px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.hero-copy {
  align-self: center;
  padding: 76px clamp(28px, 4.4vw, 72px);
  animation: copy-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-line, .promise-line { display: block; }

.brand-line {
  color: var(--lacquer-dark);
  font-size: clamp(64px, 7.4vw, 112px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.05;
}

.promise-line {
  margin-top: 24px;
  font-size: clamp(29px, 3.1vw, 50px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.34;
}

.hero-lead {
  max-width: 26em;
  margin-top: 26px;
  color: var(--muted-ink);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.9;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.primary-action {
  min-height: 52px;
  padding: 13px 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--lacquer);
  color: var(--paper-light);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 1px 0 var(--lacquer-dark);
  transition: background-color 180ms ease-out, transform 180ms ease-out;
}

.primary-action:hover { background: var(--lacquer-dark); }
.primary-action:active { transform: translateY(1px); }

.arrow {
  font-size: 1.15em;
  line-height: 1;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-action:hover .arrow,
.text-link:hover .arrow,
.tool-card:hover .arrow { transform: translate(2px, -2px); }

.hero-note { color: var(--muted-ink); font-size: 12.5px; }

.store-links {
  margin-top: 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.store-lead {
  flex-basis: 100%;
  margin-bottom: -2px;
  color: var(--muted-ink);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.store-link {
  min-height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  transition: opacity 180ms ease-out;
}

.store-badge {
  display: block;
  height: 52px;
  width: auto;
}

.store-link:hover { opacity: 0.92; }

.store-link:focus-visible {
  outline: 2px solid var(--lacquer);
  outline-offset: 3px;
}

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

.scene-panel {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: stretch;
  background: #e0d3bd;
}

.hero-art { display: grid; align-content: center; }

.altar-scene {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.hero-art figcaption {
  padding: 10px 16px;
  border-top: 1px solid rgba(32, 23, 20, 0.14);
  color: var(--muted-ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: right;
}

.couplet {
  padding: 24px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lacquer);
  color: var(--brass-light);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.4em;
  line-height: 1;
  text-orientation: upright;
  writing-mode: vertical-rl;
}

/* Section shell ------------------------------------------------------ */

.section-nav {
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px clamp(24px, 6vw, 88px);
  border-bottom: 1px solid var(--line);
  background: var(--paper-light);
}

.section-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 180ms ease-out;
}

.section-nav a:hover { color: var(--lacquer); }

.content-section {
  width: min(calc(100% - 96px), 1160px);
  margin-inline: auto;
  padding-block: clamp(72px, 8vw, 116px);
}

.setup, .questions {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(40px, 6vw, 88px);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--lacquer);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.section-label::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--brass);
}

.section-heading h2 {
  max-width: 13em;
  margin-top: 18px;
  color: var(--lacquer-dark);
  font-size: clamp(34px, 3.5vw, 50px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.section-heading > p:not(.section-label) {
  max-width: 26em;
  margin-top: 20px;
  color: var(--muted-ink);
  font-size: 15.5px;
  line-height: 1.95;
}

.text-link {
  min-height: 44px;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lacquer);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 var(--line-strong);
  transition: box-shadow 180ms ease-out;
}

.text-link:hover { box-shadow: inset 0 -1px 0 var(--lacquer); }

.fine-print, .section-heading > .fine-print {
  margin-top: 22px;
  color: var(--muted-ink);
  font-size: 12px;
  line-height: 1.8;
}

/* Altar setup -------------------------------------------------------- */

.shelf {
  padding: 26px clamp(12px, 3vw, 34px) 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-bottom-color: var(--line-strong);
}

.shelf li { position: relative; padding-bottom: 22px; }

.shelf li::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 66%;
  height: 10px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(58, 13, 15, 0.22), rgba(58, 13, 15, 0) 70%);
}

.shelf img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 158px;
  object-fit: contain;
  object-position: center bottom;
}

.shelf li:nth-child(2) img { height: 104px; }
.shelf li:nth-child(3) img { height: 88px; }

.setup-options {
  margin: 30px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}

.setup-options > div { padding-block: 20px; border-bottom: 1px solid var(--line); }

dt { font-weight: 600; font-size: 17px; letter-spacing: 0.01em; }
dd { margin: 6px 0 0; color: var(--muted-ink); font-size: 14.5px; line-height: 1.85; }

/* Ritual tools ------------------------------------------------------- */

.tools-section { background: var(--sand); }

.tool-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  height: 100%;
  padding: 24px 52px 26px 24px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon text";
  align-content: start;
  column-gap: 22px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 180ms ease-out, transform 180ms ease-out;
}

.tool-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.tool-card:active { transform: translateY(0); }

.tool-icon {
  grid-area: icon;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.tool-icon img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

.tool-card h3 { grid-area: title; font-size: 23px; font-weight: 600; letter-spacing: 0.02em; }
.tool-card p { grid-area: text; margin-top: 8px; color: var(--muted-ink); font-size: 14.5px; line-height: 1.8; }

.tool-card .arrow {
  position: absolute;
  top: 24px;
  right: 22px;
  color: var(--lacquer);
  font-size: 19px;
}

/* Worship calendar --------------------------------------------------- */

.calendar-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(44px, 7vw, 104px);
}

.calendar-preview {
  padding: 44px 32px 26px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 999px 999px 2px 2px;
}

.calendar-preview img {
  width: min(100%, 258px);
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(58, 13, 15, 0.16);
}

.calendar-preview figcaption {
  margin-top: 22px;
  text-align: center;
  color: var(--muted-ink);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.calendar-features { margin-top: 30px; }
.calendar-features li { padding-block: 17px; border-bottom: 1px solid var(--line); }
.calendar-features li:first-child { border-top: 1px solid var(--line); }
.calendar-features strong { display: block; font-weight: 600; font-size: 16.5px; }
.calendar-features span { display: block; margin-top: 5px; color: var(--muted-ink); font-size: 14.5px; }

/* First run ---------------------------------------------------------- */

.start-section {
  background: var(--lacquer);
  color: #f6e6cd;
}

.start-section .section-label { color: var(--brass-light); }
.start-section .section-label::before { background: var(--brass-light); }
.start-section h2 { color: var(--paper-light); }
.start-section :focus-visible { outline-color: var(--paper-light); }

.start-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 88px);
}

.start-section .primary-action {
  margin-top: 34px;
  background: var(--paper-light);
  color: var(--lacquer-dark);
  box-shadow: none;
}

.start-section .primary-action:hover { background: var(--brass-light); }
.start-section .store-links { margin-top: 18px; }
.start-section .store-link:hover { opacity: 0.94; }

.start-steps li {
  padding-block: 22px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid rgba(246, 230, 205, 0.24);
}

.start-steps li:first-child { padding-top: 0; }
.start-steps li:last-child { border-bottom: 0; padding-bottom: 0; }

.start-steps li > span {
  padding-top: 4px;
  color: var(--brass-light);
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.start-steps h3 { font-size: 19px; font-weight: 600; color: var(--paper-light); }
.start-steps p { margin-top: 7px; color: rgba(246, 230, 205, 0.82); font-size: 14.5px; }

/* Questions ---------------------------------------------------------- */

.question-list > div { padding-block: 22px; border-bottom: 1px solid var(--line); }
.question-list > div:first-child { padding-top: 0; }

/* Footer ------------------------------------------------------------- */

footer {
  padding: 36px max(24px, calc((100vw - 1360px) / 2));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px 48px;
  align-items: end;
  border-top: 1px solid var(--line);
  background: var(--paper-light);
  color: var(--muted-ink);
  font-size: 12px;
}

.footer-brand { display: grid; line-height: 1.5; }
.footer-brand strong { color: var(--ink); font-family: var(--display); font-size: 18px; letter-spacing: 0.1em; }
footer nav { display: flex; align-items: center; gap: 24px; }
footer nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 var(--lacquer); transition: box-shadow 180ms ease-out; }
footer nav a:hover { box-shadow: inset 0 -1px 0 var(--lacquer); }
.disclaimer { max-width: 46em; }
.copyright { text-align: right; }

@keyframes copy-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 980px) {
  .hero-copy { padding: 52px 28px; }
  .brand-line { font-size: 66px; }
  .promise-line { font-size: 31px; }
  .scene-panel { grid-template-columns: 32px minmax(0, 1fr); }
  .couplet { font-size: 17px; padding-inline: 6px; }
  .content-section { width: calc(100% - 56px); }
  .setup, .questions { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px; }
  .setup-options { gap: 0 24px; }
  .shelf img { height: 128px; }
  .shelf li:nth-child(2) img { height: 86px; }
  .shelf li:nth-child(3) img { height: 74px; }
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-card { grid-template-columns: 66px minmax(0, 1fr); column-gap: 18px; padding: 20px 48px 22px 20px; }
  .tool-icon { height: 66px; }
  .calendar-section { gap: 36px; }
  .calendar-preview { padding: 34px 20px 22px; }
  .start-layout { gap: 36px; }
}

@media (max-width: 700px) {
  .site-header { min-height: 66px; padding-inline: 20px; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 18px; }
  .brand small { display: none; }
  .header-action { font-size: 13px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 44px 22px 38px; }
  .brand-line { font-size: clamp(56px, 15vw, 74px); }
  .promise-line { margin-top: 16px; font-size: clamp(30px, 8.2vw, 38px); }
  .hero-lead { margin-top: 20px; }
  .desktop-break { display: none; }
  .hero-actions { margin-top: 26px; gap: 12px; }
  .hero-note { flex-basis: 100%; }
  .store-links { margin-top: 18px; gap: 8px; }
  .store-link { flex: 1 1 0; min-width: 0; padding-inline: 14px; }
  .section-nav { padding: 6px 16px; justify-content: space-between; gap: 4px; }
  .section-nav a { font-size: 13px; }
  .content-section { width: calc(100% - 44px); padding-block: 60px; }
  .setup, .calendar-section, .start-layout, .questions { grid-template-columns: 1fr; gap: 30px; }
  .section-heading h2 { margin-top: 14px; font-size: 33px; }
  .section-heading > p:not(.section-label) { margin-top: 16px; }
  .shelf { padding-top: 16px; }
  .shelf img { height: 116px; }
  .shelf li:nth-child(2) img { height: 78px; }
  .shelf li:nth-child(3) img { height: 66px; }
  .setup-options { grid-template-columns: 1fr; margin-top: 22px; }
  .setup-options > div { padding-block: 17px; }
  .tool-grid { margin-top: 30px; }
  .tool-card { grid-template-columns: 58px minmax(0, 1fr); column-gap: 16px; padding: 18px 42px 20px 18px; }
  .tool-icon { height: 58px; padding: 6px; }
  .tool-card h3 { font-size: 21px; }
  .tool-card .arrow { top: 20px; right: 18px; font-size: 17px; }
  .calendar-section .section-heading { grid-row: 1; }
  .calendar-preview { width: min(100%, 330px); margin-inline: auto; padding: 32px 24px 20px; }
  .start-steps li:first-child { padding-top: 6px; }
  .question-list > div { padding-block: 19px; }
  footer { padding: 30px 22px; grid-template-columns: 1fr; gap: 16px; }
  footer nav { gap: 18px; flex-wrap: wrap; }
  .copyright { text-align: left; }
}

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