/* Animations + new components additions */

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Dark midnight palette adjustments */
body.is-dark { color: var(--ivory); }
body.is-dark .nav { background: color-mix(in oklab, var(--ivory) 8%, var(--paper)); border-bottom-color: rgba(244,238,226,0.08); }
body.is-dark .nav-cta { border-color: var(--ivory); color: var(--ivory); }
body.is-dark .nav-cta:hover { background: var(--ivory); color: #1A1812; }
body.is-dark .nav-links { color: rgba(244,238,226,0.7); }
body.is-dark .btn-primary { background: var(--gold-soft); color: #1A1812; border-color: var(--gold-soft); }
body.is-dark .btn-primary:hover { background: var(--ivory); border-color: var(--ivory); }
body.is-dark .why, body.is-dark .menu, body.is-dark .reviews, body.is-dark .cta-strip { background: var(--ivory-warm); }
body.is-dark .receive, body.is-dark .about, body.is-dark .faq, body.is-dark .quiet-note, body.is-dark .how, body.is-dark .travel, body.is-dark .member-cta { background: var(--paper); }
body.is-dark .ethics { background: #15130E; }
body.is-dark .preview-card, body.is-dark .qn-card { background: var(--ivory-warm); border-color: rgba(244,238,226,0.12); }
body.is-dark .ink-mute, body.is-dark .why-item p, body.is-dark .receive-list p, body.is-dark .reading-card .rc-desc, body.is-dark .hero .lede, body.is-dark .about-text p, body.is-dark .ethics-points .pt p { color: rgba(244,238,226,0.7) !important; }
body.is-dark .hero { background: linear-gradient(180deg, var(--paper), var(--ivory-warm)); }
body.is-dark .reading-card { background: var(--ivory-warm); }
body.is-dark .reading-card:hover { background: var(--paper); }

/* Hero animated sigil + line reveals */
.hero { position: relative; overflow: hidden; }
.hero-sigil-bg {
  position: absolute;
  right: -160px; top: -120px;
  width: 800px; height: 800px;
  z-index: 0; pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
}
body.is-dark .hero-sigil-bg { mix-blend-mode: screen; opacity: 0.55; }
.hero-text { position: relative; z-index: 2; }
.hero-image { position: relative; z-index: 1; }

.sigil-svg { width: 100%; height: 100%; display: block; }
.sg-rot-slow { transform-origin: 200px 200px; animation: sgrot 80s linear infinite; }
.sg-rot-rev { transform-origin: 200px 200px; animation: sgrot 60s linear infinite reverse; }
.sg-pulse { transform-origin: 200px 200px; animation: sgpulse 6s ease-in-out infinite; }
@keyframes sgrot { to { transform: rotate(360deg); } }
@keyframes sgpulse { 0%,100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.18); opacity: 0.9; } }

/* H1 line reveal — padding-bottom + negative margin gives room for italic descenders without affecting layout */
.h-line {
  display: block;
  overflow: hidden;
  padding: 0.12em 0.08em 0.22em;
  margin: -0.12em -0.08em -0.22em;
}
.h-line > span {
  display: inline-block;
  animation: hline 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.h-line:nth-child(2) > span { animation-delay: 0.18s; }
@keyframes hline {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Nav signin */
.nav-signin {
  font-family: var(--f-caps); font-size: 11.5px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ink-soft); padding: 6px 0;
  position: relative; background: none; border: 0; cursor: pointer;
}
.nav-signin:hover { color: var(--bronze-deep); }
.nav-signin::before { content: "·"; margin-right: 18px; color: var(--ink-mute); opacity: 0.5; }

/* Travel marquee */
.travel { background: var(--paper); overflow: hidden; }
.travel-head { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end; margin-bottom: 64px; }
.travel-head h2 { font-size: clamp(48px, 5.2vw, 80px); margin: 14px 0 0; }
.travel-marquee {
  position: relative; overflow: hidden;
  margin: 0 -48px;
  padding: 12px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.travel-track {
  display: flex; gap: 0;
  animation: tmarq 60s linear infinite;
  width: max-content;
}
.travel-card {
  flex: 0 0 280px;
  padding: 36px 32px;
  border-right: 1px solid var(--line);
  text-align: left;
  color: var(--ink-soft);
  transition: background 0.4s ease;
}
.travel-card:hover { background: var(--ivory-warm); }
.tc-glyph { color: var(--bronze); width: 48px; height: 48px; margin-bottom: 22px; }
.tc-glyph svg { width: 100%; height: 100%; }
.tc-name { font-family: var(--f-display); font-style: italic; font-size: 36px; line-height: 1; color: var(--ink); margin-bottom: 6px; }
.tc-c { font-family: var(--f-caps); font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bronze); margin-bottom: 12px; }
.tc-y { font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; color: var(--ink-mute); }
@keyframes tmarq { to { transform: translateX(-50%); } }

/* Member CTA section */
.member-cta { background: var(--ivory-warm); position: relative; overflow: hidden; }
.member-cta::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 500px at 10% 50%, rgba(184,147,104,0.14), transparent 60%),
    radial-gradient(600px 400px at 90% 100%, rgba(107, 84, 137, 0.1), transparent 60%);
  pointer-events: none;
}
.mc-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; position: relative; align-items: center; }
.mc-art { position: relative; aspect-ratio: 1; }
.mc-sigil { width: 100%; height: 100%; }
.mc-text h2 { font-size: clamp(48px, 5.4vw, 84px); margin: 14px 0 24px; }
.mc-text > p { font-size: 17.5px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 40px; max-width: 580px; }
.mc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.member-tile {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.member-tile:hover { border-color: var(--bronze); transform: translateY(-2px); }
.mt-glyph { width: 28px; height: 28px; color: var(--bronze); margin-bottom: 18px; }
.mt-glyph svg { width: 100%; height: 100%; }
.member-tile h4 { font-family: var(--f-display); font-weight: 400; font-size: 22px; margin: 0 0 6px; letter-spacing: -0.005em; }
.member-tile p { font-size: 14.5px; line-height: 1.55; color: var(--ink-mute); margin: 0; }
.mc-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.mc-note { font-family: var(--f-display); font-style: italic; font-size: 16px; color: var(--ink-mute); }

/* Floating CTA (was sticky) */
.float-cta {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 80px);
  z-index: 40;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 28px;
  background: var(--ink); color: var(--ivory);
  font-family: var(--f-caps); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  box-shadow: 0 20px 60px -20px rgba(30, 26, 20, 0.5);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), background 0.3s ease;
  pointer-events: none; opacity: 0;
}
body.is-dark .float-cta { background: var(--gold-soft); color: #1A1812; }
.float-cta.show { transform: translate(-50%, 0); pointer-events: auto; opacity: 1; }
.float-cta:hover { background: var(--bronze-deep); }
.float-cta .arr { font-family: var(--f-display); font-style: italic; font-size: 18px; letter-spacing: 0; text-transform: none; }
.float-cta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-soft); box-shadow: 0 0 8px var(--gold-soft); animation: dotpulse 2.4s ease-in-out infinite; }
@keyframes dotpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* Member Portal */
.portal-back {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(20, 16, 12, 0.7);
  backdrop-filter: blur(12px);
  display: flex; justify-content: center; align-items: stretch;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.portal-back.open { opacity: 1; pointer-events: auto; }
.portal {
  width: min(1180px, 96vw); max-height: 96vh; margin: auto;
  background: var(--paper); position: relative;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
}
.portal-back.open .portal { transform: translateY(0) scale(1); }
.portal-auth { display: grid; grid-template-columns: 1fr 1fr; height: min(680px, 90vh); }

.pa-art {
  position: relative; padding: 56px 48px;
  background: linear-gradient(160deg, var(--ink) 0%, color-mix(in oklab, var(--ink) 92%, var(--bronze)) 100%);
  color: var(--ivory);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.pa-sigil {
  position: absolute; right: -200px; top: -100px;
  width: 700px; height: 700px;
  opacity: 0.35;
  mix-blend-mode: screen;
}
.pa-art-text { position: relative; z-index: 2; }
.pa-art .kicker { color: var(--gold-soft); margin-bottom: 16px; }
.pa-art h2 { font-size: 64px; margin: 0 0 18px; color: var(--ivory); line-height: 1; }
.pa-art h2 em { color: var(--gold-soft); }
.pa-art p { color: rgba(244,238,226,0.75); font-size: 16.5px; line-height: 1.6; margin: 0 0 32px; max-width: 380px; }
.pa-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.pa-list li { font-family: var(--f-display); font-size: 18px; color: var(--ivory); display: flex; gap: 14px; align-items: center; }
.pa-list li span { color: var(--gold-soft); font-style: italic; }

.pa-form {
  padding: 56px 56px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.pa-tabs { display: flex; gap: 0; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.pa-tabs button {
  flex: 1; padding: 14px 0; background: none; border: 0;
  font-family: var(--f-caps); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-mute); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pa-tabs button.on { color: var(--ink); border-bottom-color: var(--bronze); }
.pa-divider {
  text-align: center; margin: 24px 0 18px; position: relative;
}
.pa-divider span {
  font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--bronze); background: var(--paper); padding: 0 14px; position: relative; z-index: 2;
}
.pa-divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line);
}
.pa-submit { width: 100%; justify-content: space-between; margin-top: 14px; }
.pa-foot { display: flex; justify-content: space-between; margin-top: 22px; font-family: var(--f-caps); font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; }
.pa-foot a { color: var(--ink-mute); }
.pa-foot a:hover { color: var(--bronze-deep); }
.pa-fine { font-size: 12.5px; color: var(--ink-mute); margin: 16px 0 0; line-height: 1.55; }

/* Library view */
.portal-library { padding: 40px 56px 56px; overflow-y: auto; max-height: 96vh; }
.lib-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.lib-head h2 { font-size: clamp(38px, 4vw, 56px); margin: 12px 0 6px; }
.lib-sub { color: var(--ink-mute); font-family: var(--f-display); font-style: italic; font-size: 17px; margin: 0; }
.lib-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 22px 0; margin-bottom: 32px; }
.ls { padding: 0 20px; border-right: 1px solid var(--line-soft); }
.ls:last-child { border-right: 0; }
.ls .n { font-family: var(--f-display); font-style: italic; font-size: 32px; color: var(--bronze-deep); display: block; line-height: 1; }
.ls .l { font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-mute); margin-top: 8px; display: block; }

.lib-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.lib-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.lib-section-head h3 { font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 0; }
.lib-section-head a { font-family: var(--f-caps); font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bronze-deep); }
.lib-card {
  border: 1px solid var(--line); padding: 28px; margin-bottom: 18px;
  background: var(--paper);
  transition: border-color 0.3s ease;
}
.lib-card:hover { border-color: var(--bronze); }
.lc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.lc-title { font-family: var(--f-display); font-size: 22px; letter-spacing: -0.005em; }
.lc-date { font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; color: var(--ink-mute); }
.lc-ex { font-family: var(--f-display); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--ink-soft); margin: 0 0 18px; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.lc-meta { font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; color: var(--ink-mute); }
.lc-actions { display: flex; gap: 8px; }
.lc-btn {
  padding: 8px 16px; font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: all 0.25s ease;
}
.lc-btn:hover { border-color: var(--ink); }
.lc-btn.primary { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.lc-btn.primary:hover { background: var(--bronze-deep); }

.lib-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.lib-panel { border: 1px solid var(--line); padding: 24px; background: var(--paper); }
.lib-panel h4 { font-family: var(--f-display); font-weight: 400; font-size: 20px; margin: 0 0 16px; }
.chart-mini { width: 100%; aspect-ratio: 1; margin-bottom: 18px; }
.bc-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.bc-row:last-child { border-bottom: 0; }
.bc-row span:first-child { font-family: var(--f-caps); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-mute); }
.bc-row span:last-child { font-family: var(--f-display); font-style: italic; font-size: 16px; }

@media (max-width: 1100px) {
  .travel-head { grid-template-columns: 1fr; gap: 32px; }
  .mc-grid { grid-template-columns: 1fr; gap: 48px; }
  .mc-tiles { grid-template-columns: 1fr; }
  .portal-auth { grid-template-columns: 1fr; height: auto; }
  .pa-art { padding: 40px 32px; }
  .pa-form { padding: 40px 32px; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-stats { grid-template-columns: 1fr 1fr; }
  .ls:nth-child(2) { border-right: 0; }
}
