/* ═══════════════════════════════════════════════════════════
   TAO DYNAMICS — taodynamics.org
   The Eastern Library of Laks Industries
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  --bg:          #0a0a0a;
  --bg-elevated: #111111;
  --bg-card:     #0f0f0f;
  --bg-hover:    #1a1a1a;
  --gold:        #c9a84c;
  --gold-dim:    #9a7e3a;
  --gold-bright: #dfc06b;
  --jade:        #5a8a72;
  --jade-dim:    #3d6652;
  --text:        #d4d0c8;
  --text-dim:    #7a756b;
  --text-bright: #eae6de;
  --border:      #222222;
  --border-gold: #2a2418;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;

  --max-width:   820px;
  --max-wide:    1100px;
  --gutter:      clamp(1.5rem, 5vw, 4rem);
}

/* ─── Reset ─────────────────────────────────────────────── */

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--bg);
}

/* ─── Typography ────────────────────────────────────────── */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 300;
  letter-spacing: 0.06em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--gold);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

h4 {
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  margin-bottom: 0.6rem;
}

p {
  margin-bottom: 1.4rem;
  max-width: 65ch;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold-bright);
}

strong {
  color: var(--text-bright);
  font-weight: 500;
}

em {
  font-style: italic;
  color: var(--text-bright);
}

blockquote {
  border-left: 2px solid var(--gold-dim);
  padding: 0.8rem 0 0.8rem 1.6rem;
  margin: 2rem 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--gold);
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

/* ─── Layout ────────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--wide {
  max-width: var(--max-wide);
}

.section {
  padding: 5rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ─── Site Header ───────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s;
}

.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header__logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-bright);
  text-decoration: none;
}

.site-header__logo span {
  color: var(--gold);
}

.site-nav {
  display: flex;
  gap: 0.2rem;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--gold);
  background: var(--bg-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.4rem;
}

/* ─── Hero ──────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem var(--gutter) 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(201,168,76,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero__rule {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.7s forwards;
}

.hero__prose {
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

/* ─── Three Wings ───────────────────────────────────────── */

.wings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin: 4rem 0;
  border: 1px solid var(--border);
}

.wing {
  background: var(--bg);
  padding: 3rem 2rem;
  text-align: center;
  transition: background 0.3s;
  text-decoration: none;
  display: block;
}

.wing:hover {
  background: var(--bg-elevated);
}

.wing__number {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}

.wing__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.wing__desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 28ch;
  margin: 0 auto;
}

.wing--health .wing__title { color: var(--jade); }
.wing--capital .wing__title { color: var(--gold); }

/* ─── Page Header ───────────────────────────────────────── */

.page-header {
  padding: 10rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.2rem;
}

.page-header__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.page-header__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0 auto;
}

/* ─── Principle Blocks ──────────────────────────────────── */

.principle {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.principle:last-child {
  border-bottom: none;
}

.principle__number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  margin-bottom: 0.6rem;
}

.principle__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.principle__body {
  color: var(--text);
  line-height: 1.8;
}

/* ─── Affliction Grid ───────────────────────────────────── */

.affliction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 3rem 0;
}

.affliction-card {
  background: var(--bg);
  padding: 2rem 1.6rem;
  text-decoration: none;
  display: block;
  transition: background 0.2s;
}

.affliction-card:hover {
  background: var(--bg-elevated);
}

.affliction-card__number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--jade-dim);
  margin-bottom: 0.6rem;
}

.affliction-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
}

.affliction-card__desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ─── Affliction Detail Page ────────────────────────────── */

.affliction-detail {
  padding: 3rem 0;
}

.affliction-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.affliction-meta__item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.affliction-meta__item span {
  color: var(--jade);
}

.protocol-placeholder {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--jade-dim);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ─── Organ System Table ────────────────────────────────── */

.organ-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.organ-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.organ-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.organ-table td:first-child {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--jade);
  font-weight: 500;
  white-space: nowrap;
}

/* ─── Organ Clock ───────────────────────────────────────── */

.organ-clock {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 2rem 0;
}

.organ-clock__slot {
  background: var(--bg);
  padding: 1.2rem;
  text-align: center;
}

.organ-clock__time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.organ-clock__organ {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-bright);
}

/* ─── Texts / Canon ─────────────────────────────────────── */

.text-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.text-entry:last-child {
  border-bottom: none;
}

.text-entry__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-bright);
  font-style: italic;
}

.text-entry__meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ─── Capital Section ───────────────────────────────────── */

.capital-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.capital-section:last-child {
  border-bottom: none;
}

.capital-section h3 {
  color: var(--gold);
}

.capital-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--gold-dim);
  line-height: 1.7;
}

/* ─── Footer ────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.site-footer__links a {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-footer__copy {
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ─── Animations ────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
  html { font-size: 15px; }

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

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 85vh;
    padding-top: 6rem;
  }

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

  .affliction-meta {
    flex-direction: column;
    gap: 0.6rem;
  }

  .organ-clock {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero__title {
    letter-spacing: 0.08em;
  }

  .organ-clock {
    grid-template-columns: 1fr;
  }
}
