:root {
  --bg: #0d1117;
  --bg-soft: rgba(28, 36, 46, 0.85);
  --fg: #f5f7fa;
  --muted: rgba(245, 247, 250, 0.66);
  --accent: #f0b14c;
  --accent-soft: rgba(240, 177, 76, 0.2);
  --accent-strong: #ff8c42;
  --ink: #20232a;
  --card: rgba(17, 22, 30, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --font-serif: 'Crimson Text', 'Times New Roman', serif;
  --font-sans: 'Manrope', 'Segoe UI', sans-serif;
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 16px 32px rgba(7, 9, 14, 0.6);
}

:root[data-lang='zh'] .lang-en {
  display: none !important;
}

:root[data-lang='en'] .lang-zh {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 20%, rgba(66, 86, 117, 0.4), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(215, 94, 86, 0.3), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(130, 101, 179, 0.35), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.section-heading {
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.site-header {
  position: relative;
  padding-bottom: 6rem;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 1.5rem 2rem;
  position: relative;
}

.nav-controls {
  display: flex;
  align-items: center;
  flex: 1 1 520px;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 0.75rem;
  gap: 1rem;
}

.lang-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.lang-toggle:hover,
.lang-toggle:focus {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg);
  text-decoration: none;
}

.logo img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.logo-text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
  line-height: 1.1;
}

.logo-text .lang-zh {
  font-size: 0.66rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 0.6rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--fg);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.25rem;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 3rem;
}

.hero-copy h1 {
  font-size: clamp(3.2rem, 6vw, 5rem);
  margin: 0.5rem 0 1rem;
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-copy p {
  color: var(--muted);
  max-width: 540px;
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-actions a {
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-actions a.primary,
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a1005;
  box-shadow: 0 10px 40px rgba(240, 177, 76, 0.45);
}

.hero-actions a.ghost {
  border: 1px solid var(--border);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.hero-actions a:hover,
.primary:hover {
  transform: translateY(-4px);
}

.hero-visual {
  position: relative;
}

.hero-visual .orb {
  position: absolute;
  inset: -15% -10% -20% 5%;
  background: radial-gradient(circle, rgba(240, 177, 76, 0.35), transparent 70%);
  filter: blur(0px);
  z-index: -1;
  transform: rotate(12deg);
}

.hero-visual figure img {
  border-radius: 18px;
}

main section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

main.article,
main.policy {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  display: grid;
  gap: 2.5rem;
}

main.article section,
main.policy section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

main.article h2,
main.policy h2 {
  font-family: var(--font-serif);
  letter-spacing: 0.02em;
  font-size: 1.9rem;
  margin-top: 0;
}

main.article p,
main.article li,
main.policy p,
main.policy li {
  color: var(--muted);
}

.page-meta {
  margin: 0 auto 2.5rem;
  padding: 1.2rem 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(240, 177, 76, 0.22);
  background: rgba(240, 177, 76, 0.08);
  box-shadow: 0 14px 34px rgba(6, 8, 12, 0.22);
}

.page-meta-line {
  margin: 0;
  color: rgba(245, 247, 250, 0.82);
}

.page-meta-line + .page-meta-line {
  margin-top: 0.5rem;
}

.page-meta a {
  color: var(--fg);
}

.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0 auto -0.75rem;
  color: rgba(245, 247, 250, 0.72);
  font-size: 0.92rem;
}

.breadcrumb-nav a {
  color: rgba(245, 247, 250, 0.82);
  text-decoration: none;
}

.breadcrumb-nav a:hover,
.breadcrumb-nav a:focus {
  color: var(--fg);
}

.breadcrumb-separator {
  color: rgba(245, 247, 250, 0.36);
}

.editorial-note {
  border: 1px solid rgba(240, 177, 76, 0.18);
  background: linear-gradient(135deg, rgba(240, 177, 76, 0.08), rgba(255, 255, 255, 0.02));
}

.editorial-note h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.editorial-note ul {
  margin: 0;
  padding-left: 1.3rem;
}

.editorial-note li + li {
  margin-top: 0.8rem;
}

.editorial-note a {
  color: var(--fg);
}

main.policy ul,
main.article ul,
main.article ol {
  padding-left: 1.4rem;
}

.about {
  background: linear-gradient(135deg, rgba(16, 20, 27, 0.8), rgba(24, 31, 42, 0.6));
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.about p {
  margin-top: 1.2rem;
}

.highlight {
  color: var(--accent);
  font-weight: 600;
}

.domain-callout {
  margin-top: 1.8rem;
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
  background: rgba(240, 177, 76, 0.08);
  border: 1px solid rgba(240, 177, 76, 0.2);
  color: rgba(245, 247, 250, 0.85);
  box-shadow: 0 14px 34px rgba(6, 8, 12, 0.3);
}

.stories {
  margin-top: 4rem;
}

.insights {
  margin-top: 4rem;
}

.mission {
  margin-top: 4rem;
  background: linear-gradient(135deg, rgba(18, 24, 34, 0.9), rgba(36, 30, 48, 0.8));
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 3rem;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.mission-grid ul {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.analysis {
  margin-top: 3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.analysis + .analysis {
  margin-top: 2rem;
}

.analysis ul {
  padding-left: 1.4rem;
  color: var(--muted);
}

.analysis p {
  color: var(--muted);
}

.analysis,
.story-chapter,
.gallery figure,
main.article section,
main.policy section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 640px;
}

.featured-summary {
  margin-top: 4rem;
  background: var(--card);
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 3rem;
}

.featured-summary-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
}

.featured-summary figure img {
  border-radius: 20px;
}

.featured-summary-copy p {
  color: var(--muted);
}

.featured-summary-copy .primary {
  display: inline-flex;
  margin-top: 1.5rem;
}

.story-placeholder {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(68, 94, 122, 0.35), rgba(26, 32, 42, 0.6));
  border: 1px dashed rgba(255, 255, 255, 0.2);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 247, 250, 0.75);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  text-align: center;
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.story-placeholder span {
  max-width: 320px;
  line-height: 1.5;
}

.stories-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.story-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.story-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.story-card figure {
  margin: -0.5rem -0.5rem 0;
}

.story-card figure img {
  border-radius: 18px;
}

.story-card-body {
  position: relative;
  z-index: 1;
}

.story-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(240, 177, 76, 0.16);
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.story-card h3 {
  margin: 0.8rem 0 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.story-card p {
  color: var(--muted);
}

.link-card {
  min-height: 100%;
}

.link-card .story-card-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.link-card .story-link {
  margin-top: auto;
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
}

.story-link::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.2rem;
}

.story-card.upcoming {
  background: linear-gradient(135deg, rgba(26, 22, 42, 0.85), rgba(16, 27, 37, 0.82));
}

.story-card.upcoming::before {
  content: '';
  position: absolute;
  inset: auto -40% -40% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(240, 177, 76, 0.3), transparent 70%);
  z-index: 0;
  filter: blur(0px);
}

.story-note {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 247, 250, 0.6);
}

.featured-story {
  margin-top: 4rem;
}

.story-body {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.story-chapter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: 2.75rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.story-chapter::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.story-chapter h3 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.story-chapter.reverse figure {
  order: 2;
}

blockquote {
  margin: 2rem 0 0;
  padding-left: 1.75rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.gallery {
  margin-top: 2rem;
}

.gallery-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-note {
  margin-top: 2rem;
  color: var(--muted);
  text-align: center;
}

.related-reading {
  margin-top: 4rem;
}

.cta {
  padding-bottom: 6rem;
}

.cta-card {
  background: linear-gradient(135deg, rgba(35, 46, 64, 0.85), rgba(12, 20, 28, 0.8));
  border-radius: 28px;
  padding: 3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.cta-card h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin-bottom: 1rem;
}

.cta-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.cta-form input,
.cta-form button {
  border-radius: 999px;
  padding: 0.9rem 1.5rem;
  border: none;
  font-size: 1rem;
}

.cta-form input {
  min-width: 260px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--fg);
}

.cta-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a1005;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(240, 177, 76, 0.45);
  transition: transform 0.3s ease;
}

.cta-form button:hover {
  transform: translateY(-3px);
}

.form-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.2rem;
  color: var(--muted);
}

.form-message.success {
  color: var(--accent);
}

.form-message.error {
  color: #ff6b6b;
}

.form-message.pending {
  color: #89b4f8;
}

.oracle-hero {
  align-items: center;
}

.oracle-stage {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
}

.bagua-ring {
  width: min(420px, 78vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(240, 177, 76, 0.2);
  background:
    radial-gradient(circle at center, rgba(240, 177, 76, 0.12), transparent 22%),
    radial-gradient(circle at center, transparent 38%, rgba(240, 177, 76, 0.12) 38%, rgba(240, 177, 76, 0.12) 39%, transparent 40%),
    radial-gradient(circle at center, transparent 58%, rgba(255, 255, 255, 0.07) 58%, rgba(255, 255, 255, 0.07) 59%, transparent 60%),
    linear-gradient(135deg, rgba(33, 40, 52, 0.9), rgba(13, 17, 23, 0.7));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  position: relative;
}

.bagua-core {
  position: absolute;
  inset: 50%;
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at 50% 25%, #0f151d 0 8px, transparent 9px),
    radial-gradient(circle at 50% 75%, #f7f0e1 0 8px, transparent 9px),
    linear-gradient(90deg, #f7f0e1 0 50%, #0f151d 50% 100%);
  border: 1px solid rgba(255, 244, 214, 0.2);
  box-shadow:
    0 0 0 12px rgba(240, 177, 76, 0.08),
    0 18px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.bagua-core::before,
.bagua-core::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  border-radius: 50%;
}

.bagua-core::before {
  top: 0;
  background: #f7f0e1;
  box-shadow:
    inset 0 -8px 12px rgba(132, 96, 45, 0.16),
    0 0 0 0 transparent;
}

.bagua-core::after {
  bottom: 0;
  background: #0f151d;
  box-shadow:
    inset 0 8px 12px rgba(255, 255, 255, 0.08),
    0 0 0 0 transparent;
}

.bagua-label {
  position: absolute;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: rgba(245, 247, 250, 0.88);
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

.bagua-label.top {
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.bagua-label.right {
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
}

.bagua-label.bottom {
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.bagua-label.left {
  left: 10%;
  top: 50%;
  transform: translateY(-50%);
}

.oracle-stage-lines {
  position: absolute;
  inset: 22% 28%;
  display: grid;
  align-content: center;
  gap: 1rem;
  pointer-events: none;
}

.oracle-stage-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240, 177, 76, 0.95), rgba(255, 231, 190, 0.85));
  box-shadow: 0 10px 24px rgba(240, 177, 76, 0.18);
}

.oracle-stage-line.split {
  background: transparent;
  position: relative;
}

.oracle-stage-line.split::before,
.oracle-stage-line.split::after {
  content: '';
  position: absolute;
  top: 0;
  width: calc(50% - 14px);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240, 177, 76, 0.95), rgba(255, 231, 190, 0.85));
}

.oracle-stage-line.split::before {
  left: 0;
}

.oracle-stage-line.split::after {
  right: 0;
}

.oracle-page {
  max-width: 1100px;
}

.oracle-shell {
  background:
    radial-gradient(circle at top right, rgba(240, 177, 76, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(17, 23, 32, 0.92), rgba(20, 29, 41, 0.84));
}

.oracle-intro p {
  color: var(--muted);
  max-width: 780px;
}

.oracle-app-grid,
.oracle-result-grid,
.trigram-grid,
.line-role-grid {
  display: grid;
  gap: 1.4rem;
}

.oracle-app-grid {
  grid-template-columns: minmax(280px, 360px) minmax(300px, 1fr);
  align-items: start;
  margin-top: 2rem;
}

.oracle-result-grid {
  margin-top: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.oracle-panel,
.oracle-card,
.trigram-card,
.line-role-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.oracle-kicker {
  margin: 0 0 0.55rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.oracle-label {
  display: inline-block;
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.oracle-question {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 18, 0.65);
  color: var(--fg);
  font: inherit;
  line-height: 1.6;
}

.oracle-question:focus {
  outline: 2px solid rgba(240, 177, 76, 0.45);
  outline-offset: 2px;
}

.oracle-help,
.oracle-method-notes,
.oracle-card p,
.trigram-card p,
.line-role-card p {
  color: var(--muted);
}

.oracle-help {
  margin-top: 0.8rem;
  font-size: 0.95rem;
}

.oracle-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.oracle-mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.oracle-mode-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.oracle-mode-button.active,
.oracle-mode-button:hover,
.oracle-mode-button:focus {
  transform: translateY(-2px);
  background: rgba(240, 177, 76, 0.12);
  border-color: rgba(240, 177, 76, 0.36);
}

.manual-cast-panel {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.manual-cast-status {
  margin: 0 0 0.9rem;
  color: rgba(245, 247, 250, 0.88);
}

.manual-coin-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.45rem 0.2rem;
  perspective: 1200px;
}

.manual-stage-coin {
  position: relative;
  width: min(100%, 94px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0.8rem;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 248, 230, 0.98), rgba(255, 214, 126, 0.92) 22%, rgba(198, 128, 41, 0.94) 55%, rgba(102, 58, 23, 0.98) 100%);
  border: 1px solid rgba(255, 229, 173, 0.28);
  color: #2d1706;
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -7px 14px rgba(66, 34, 10, 0.38);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, filter 0.35s ease;
  overflow: hidden;
}

.manual-stage-coin::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 209, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -8px 14px rgba(79, 43, 11, 0.24);
  opacity: 0.92;
}

.manual-stage-coin::after {
  content: '';
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(88, 48, 17, 0.9), rgba(28, 16, 8, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 3px rgba(255, 231, 175, 0.16);
  transform: rotate(45deg) translateZ(2px);
}

.manual-stage-coin.spinning {
  animation: manual-coin-spin 0.72s cubic-bezier(0.36, 0.02, 0.26, 0.98) infinite;
  filter: saturate(1.08) brightness(1.03);
}

.manual-stage-coin.settling {
  animation: manual-coin-settle 0.42s cubic-bezier(0.2, 0.82, 0.24, 1) both;
}

.manual-stage-coin.face-head {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 249, 232, 0.98), rgba(255, 214, 126, 0.92) 22%, rgba(198, 128, 41, 0.94) 55%, rgba(102, 58, 23, 0.98) 100%);
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.24),
    0 0 18px rgba(240, 177, 76, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -7px 14px rgba(66, 34, 10, 0.38);
}

.manual-stage-coin.face-tail {
  background:
    radial-gradient(circle at 30% 26%, rgba(249, 252, 255, 0.98), rgba(196, 205, 216, 0.92) 24%, rgba(118, 130, 148, 0.94) 58%, rgba(48, 58, 72, 0.98) 100%);
  color: #10151f;
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.24),
    0 0 18px rgba(170, 187, 214, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    inset 0 -7px 14px rgba(16, 20, 29, 0.32);
}

@keyframes manual-coin-spin {
  0% {
    transform: rotateY(0deg) rotateX(0deg) translateY(0) scale(0.96);
  }
  35% {
    transform: rotateY(540deg) rotateX(18deg) translateY(-9px) scale(1);
  }
  100% {
    transform: rotateY(1080deg) rotateX(0deg) translateY(0) scale(0.98);
  }
}

@keyframes manual-coin-settle {
  0% {
    transform: rotateY(0deg) rotateZ(0deg) translateY(-1px) scale(1.02);
  }
  28% {
    transform: rotateY(0deg) rotateZ(-8deg) translateY(1px) scale(0.99);
  }
  54% {
    transform: rotateY(0deg) rotateZ(5deg) translateY(-1px) scale(1.01);
  }
  76% {
    transform: rotateY(0deg) rotateZ(-2deg) translateY(0) scale(0.997);
  }
  100% {
    transform: rotateY(0deg) rotateZ(0deg) translateY(0) scale(1);
  }
}

.manual-toss-button {
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid rgba(240, 177, 76, 0.24);
  background: linear-gradient(135deg, rgba(240, 177, 76, 0.18), rgba(255, 255, 255, 0.04));
  color: var(--fg);
  border-radius: 18px;
  padding: 0.95rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.manual-toss-button:hover,
.manual-toss-button:focus {
  transform: translateY(-2px);
  border-color: rgba(240, 177, 76, 0.42);
  background: linear-gradient(135deg, rgba(240, 177, 76, 0.24), rgba(255, 255, 255, 0.08));
}

.manual-toss-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.manual-coin-help {
  margin-bottom: 0;
}

.oracle-button,
.oracle-reset {
  min-width: 140px;
}

.oracle-reset {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.oracle-reset:hover,
.oracle-reset:focus {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.oracle-method-notes {
  margin: 1.25rem 0 0;
  padding-left: 1.25rem;
}

.oracle-method-notes li + li {
  margin-top: 0.65rem;
}

.oracle-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.oracle-line-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.oracle-line-row.moving {
  border: 1px solid rgba(240, 177, 76, 0.32);
  box-shadow: inset 0 0 0 1px rgba(240, 177, 76, 0.08);
}

.oracle-line-label,
.oracle-line-value,
.oracle-caption {
  color: rgba(245, 247, 250, 0.82);
}

.oracle-line-label {
  font-size: 0.92rem;
}

.oracle-line-graphic {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.oracle-line-graphic .segment {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240, 177, 76, 1), rgba(255, 237, 204, 0.92));
  box-shadow: 0 10px 24px rgba(240, 177, 76, 0.14);
}

.oracle-line-graphic .segment.full {
  width: 100%;
}

.oracle-line-graphic .segment.half {
  width: calc(50% - 0.4rem);
}

.oracle-line-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.oracle-caption {
  margin-bottom: 0;
}

.oracle-card h3,
.trigram-card h3,
.line-role-card h3 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-size: 1.4rem;
}

.trigram-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.trigram-symbol {
  display: inline-flex;
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.line-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.oracle-share-card {
  display: grid;
  gap: 0.9rem;
}

.oracle-share-preview {
  padding: 0;
  border-radius: 22px;
  background: transparent;
  border: none;
}

.oracle-share-preview p {
  margin: 0;
  white-space: pre-line;
}

.oracle-slip-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.96), rgba(232, 210, 173, 0.9)),
    linear-gradient(135deg, rgba(157, 94, 33, 0.08), rgba(89, 48, 15, 0.16));
  border: 1px solid rgba(145, 92, 42, 0.24);
  color: #2b1909;
  box-shadow:
    0 22px 34px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.oracle-slip-card,
.oracle-slip-card p,
.oracle-slip-card .oracle-slip-block p {
  color: #2b1909;
}

.oracle-slip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0, rgba(137, 83, 29, 0.08) 48%, transparent 100%),
    repeating-linear-gradient(180deg, rgba(122, 74, 28, 0.06) 0 1px, transparent 1px 28px);
  pointer-events: none;
}

.oracle-slip-header,
.oracle-slip-footer,
.oracle-slip-grid {
  position: relative;
  z-index: 1;
}

.oracle-slip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.oracle-slip-brand {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(85, 49, 18, 0.78);
}

.oracle-slip-mark {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f6d99e 0, #b9722f 55%, #6e3914 100%);
  color: #fff5e1;
  font-family: var(--font-serif);
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.oracle-slip-grid {
  display: grid;
  gap: 0.8rem;
}

.oracle-slip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.oracle-slip-block {
  padding: 0.82rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 251, 241, 0.62);
  border: 1px solid rgba(121, 72, 28, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.oracle-slip-question,
.oracle-slip-guidance {
  background: rgba(255, 247, 228, 0.78);
}

.oracle-slip-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(101, 61, 24, 0.72);
}

.oracle-slip-block p {
  margin: 0;
  line-height: 1.6;
}

.oracle-slip-footer {
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(112, 68, 29, 0.22);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(95, 57, 22, 0.68);
}

.oracle-share-button {
  justify-self: start;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  color: var(--muted);
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--fg);
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

.footnote {
  display: block;
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
}

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

@media (max-width: 768px) {
  .nav {
    padding: 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-controls {
    gap: 0.75rem;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    right: 20px;
    padding: 1.5rem;
    background: rgba(14, 18, 26, 0.95);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .oracle-stage {
    min-height: 360px;
  }

  .oracle-app-grid {
    grid-template-columns: 1fr;
  }

  .manual-coin-stage {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }

  .oracle-line-row {
    grid-template-columns: 96px 1fr 38px;
  }

  .oracle-slip-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 2rem;
  }

  main section {
    padding: 3rem 1.5rem;
  }

  .page-meta {
    padding: 1rem 1.1rem;
  }

  .story-chapter {
    padding: 2rem;
  }

  .oracle-panel,
  .oracle-card,
  .trigram-card,
  .line-role-card {
    padding: 1.15rem;
  }

  .oracle-stage {
    min-height: 300px;
  }

  .manual-stage-coin {
    width: min(100%, 78px);
    font-size: 0.76rem;
  }

  .oracle-line-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .oracle-line-value {
    text-align: left;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
