/* Decaf — Direction A "Sanctuary" */

/* ───── Tokens ───── */
.dir-a {
  --ink: #2C1810;
  --ink-soft: #6B4C3B;
  --ink-muted: #B8A08A;
  --bg: #F5EFE5;
  --bg-2: #EBE3D4;
  --paper: #FBF5EA;
  --rule: rgba(44, 24, 16, 0.12);
  --sage: #4A7C59;
  --sage-dark: #2F5738;
  --sage-soft: rgba(74, 124, 89, 0.12);
  --amber: #B8763A;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
.dir-a[data-mode="dark"] {
  --ink: #F5EFE5;
  --ink-soft: #C4AE93;
  --ink-muted: #6B5B47;
  --bg: #1A0F08;
  --bg-2: #261810;
  --paper: #221610;
  --rule: rgba(245, 239, 229, 0.12);
  --sage: #7FA88A;
  --sage-dark: #4A7C59;
  --sage-soft: rgba(127, 168, 138, 0.15);
}
.dir-a[data-palette="cool"] { --sage: #4A7592; --sage-dark: #2D4A60; --sage-soft: rgba(74,117,146,.12); --amber: #5B7A99; }
.dir-a[data-palette="mono"] { --sage: #2C1810; --sage-dark: #000; --sage-soft: rgba(44,24,16,.08); --amber: #6B4C3B; }
.dir-a[data-typo="sans"]    { --serif: var(--sans); }

/* ───── Base ───── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

.dir { color: var(--ink); background: var(--bg); font-family: var(--sans); -webkit-font-smoothing: antialiased; position: relative; overflow-x: hidden; min-height: 100vh; }
.dir a { color: inherit; text-decoration: none; }
.dir h1, .dir h2, .dir h3, .dir h4 { font-weight: 400; letter-spacing: -0.02em; }
.dir em { font-style: italic; }

/* paper grain */
.dir::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.dir > * { position: relative; z-index: 1; }

/* ───── Scroll reveal ───── */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

/* ───── Nav ───── */
.a-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 64px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}
.a-mark { display: flex; align-items: center; gap: 14px; font-family: var(--serif); font-size: 32px; letter-spacing: -0.02em; color: var(--ink); }
.a-logo-slot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: 10px;
  overflow: hidden;
}
.a-logo-slot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.a-foot-logo { width: 32px; height: 32px; object-fit: contain; display: block; border-radius: 6px; }

.a-nav-links { display: flex; align-items: center; gap: 32px; font-size: 13px; color: var(--ink-soft); list-style: none; }
.a-nav-links a { transition: color .2s; }
.a-nav-links a:hover { color: var(--ink); }
.a-nav-cta {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink) !important;
  padding: 4px 0;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  transition: color .2s;
}
.a-nav-cta::before, .a-nav-cta::after {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; line-height: 1;
  color: var(--sage);
  transform: translateY(3px);
  transition: transform .25s ease, color .2s;
}
.a-nav-cta::before { content: "("; }
.a-nav-cta::after  { content: ")"; }
.a-nav-cta:hover::before { transform: translate(-3px, 3px); }
.a-nav-cta:hover::after  { transform: translate(3px, 3px); }

/* ───── Hero ───── */
.a-hero {
  padding: 32px 64px 96px;
  max-width: 1280px; margin: 0 auto;
  position: relative;
}
.a-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  min-height: 580px;
}
.a-hero-text { text-align: left; padding-left: 96px; }
.a-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 32px;
}
.a-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); animation: pulse 2.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.a-hero-h {
  font-family: var(--serif);
  font-size: clamp(54px, 7.1vw, 99px);
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 0 0 32px;
  color: var(--ink);
}
.a-hero-h em { color: var(--sage); }
.a-hero-rot { font-size: 0.78em; display: inline-block; }

/* RotatingWord */
.rw { position: relative; display: inline-block; }
.rw-measure { visibility: hidden; white-space: nowrap; }
.rw-word { position: absolute; left: 0; top: 0; white-space: nowrap; transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.2,1); }
.rw-in  { opacity: 1; transform: translateY(0); }
.rw-out { opacity: 0; transform: translateY(-0.18em); }

.a-hero-sub {
  font-size: 22px; line-height: 1.55;
  color: var(--ink-soft);
  max-width: 480px; margin: 0 0 36px;
  font-weight: 300;
  text-wrap: balance;
}
.a-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.a-hero-foot {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-muted); letter-spacing: 0.1em; text-transform: uppercase;
}

/* hero illustration column — battery before/after */
.a-cup {
  display: flex; justify-content: center; align-items: center;
  position: relative;
}
.a-cup::before {
  content: ''; position: absolute; inset: -50px;
  background: radial-gradient(circle at center, var(--sage-soft), transparent 65%);
  z-index: -1; pointer-events: none;
  opacity: 0.6;
}
.a-batteries {
  flex-direction: column;
  gap: 28px;
  width: 100%;
  margin-top: 56px;
}
.a-batteries::before { display: none; }
.a-bat {
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%;
}
.a-bat img {
  width: 100%; max-width: 414px; height: auto;
  display: block;
}
.a-bat-before img { animation: batShake 4s ease-in-out infinite; transform-origin: center; }
.a-bat-after img  { animation: batBreathe 5.5s ease-in-out infinite; transform-origin: center bottom; }
@keyframes batShake {
  0%,92%,100% { transform: translate(0,0) rotate(0); }
  94% { transform: translate(-1.5px,0) rotate(-0.4deg); }
  96% { transform: translate(1.5px,0) rotate(0.4deg); }
  98% { transform: translate(-1px,0) rotate(-0.2deg); }
}
@keyframes batBreathe {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.015); }
}
.a-bat figcaption {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.a-bat-label {
  font-family: var(--serif); font-style: italic;
  font-size: 44px; line-height: 1;
  color: var(--ink);
}
.a-bat-before .a-bat-label { color: #C8442E; }
.a-bat-after  .a-bat-label { color: var(--sage-dark); }
.a-bat-meta {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted);
}
.a-bat-before .a-bat-meta { color: #C8442E; opacity: 0.85; }
.a-bat-after  .a-bat-meta { color: var(--sage-dark); opacity: 0.85; }

/* ───── Leaves ───── */
.dir-a-leaf {
  position: absolute; pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.dir-a[data-mode="dark"] .dir-a-leaf { filter: invert(1) hue-rotate(170deg) brightness(1.1); }
.dir-a .leaf-1 { top:   80px; left:  -50px; width: 170px; transform: rotate(-22deg);              opacity: 0.45; }
.dir-a .leaf-2 { top:  520px; right: -30px; width: 110px; transform: rotate(38deg) scaleX(-1);    opacity: 0.42; }
.dir-a .leaf-3 { top: 1180px; left:  -70px; width: 230px; transform: rotate(-35deg);              opacity: 0.38; }
.dir-a .leaf-4 { top: 1820px; right: -25px; width: 100px; transform: rotate(28deg) scaleX(-1);    opacity: 0.45; }
.dir-a .leaf-5 { top: 2480px; left:  -40px; width: 150px; transform: rotate(-18deg);              opacity: 0.42; }
.dir-a .leaf-6 { top: 3120px; right: -80px; width: 250px; transform: rotate(45deg) scaleX(-1);    opacity: 0.36; }
.dir-a .leaf-7 { top: 3780px; left:  -25px; width: 110px; transform: rotate(-42deg);              opacity: 0.45; }
.dir-a .leaf-8 { top: 4380px; right: -40px; width: 160px; transform: rotate(20deg) scaleX(-1);    opacity: 0.42; }

/* ───── Buttons (parentheses style) ───── */
.a-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color .2s;
  text-decoration: none;
}
.a-btn::before, .a-btn::after {
  font-family: var(--serif); font-style: italic;
  font-size: 44px; line-height: 0.6;
  font-weight: 400;
  color: var(--sage);
  transform: translateY(4px);
  transition: transform .3s cubic-bezier(.16,1,.3,1), color .2s;
  display: inline-block;
}
.a-btn::before { content: "("; }
.a-btn::after  { content: ")"; }
.a-btn:hover::before { transform: translate(-5px, 4px); }
.a-btn:hover::after  { transform: translate(5px, 4px); }
.a-btn-primary { font-style: italic; }
.a-btn-ghost { font-size: 18px; color: var(--ink-muted); }
.a-btn-ghost::before, .a-btn-ghost::after { font-size: 32px; color: var(--ink-muted); }
.a-btn-ghost:hover { color: var(--ink); }
.a-btn-ghost:hover::before, .a-btn-ghost:hover::after { color: var(--ink); }

/* ───── Sections ───── */
.a-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 64px;
  position: relative;
}
.a-marg {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 56px;
}
.a-col { max-width: 660px; margin-bottom: 64px; }
.a-h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}
.a-h2 em { color: var(--sage); }
.a-lede {
  font-size: 21px; line-height: 1.6;
  color: var(--ink-soft);
  max-width: 580px;
  font-weight: 300;
  text-wrap: pretty;
}

/* ───── Stats ───── */
.a-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.a-stat-num {
  font-family: var(--serif);
  font-size: 80px; line-height: 1;
  letter-spacing: -0.04em;
}
.a-stat-unit {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; color: var(--sage);
}
.a-stat-rule { width: 32px; height: 1px; background: var(--ink); margin: 18px 0; }
.a-stat-cap { font-size: 13px; color: var(--ink-soft); line-height: 1.5; max-width: 240px; }

/* ───── Modes ───── */
.a-modes {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
}
.a-mode { padding: 0; position: relative; }
.a-mode-num {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; color: var(--sage);
  margin-bottom: 16px;
}
.a-mode h3 {
  font-family: var(--serif);
  font-size: 40px; letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.a-mode p { font-size: 19px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 24px; max-width: 480px; font-weight: 300; }
.a-mode-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sage-dark); background: var(--sage-soft);
  padding: 6px 12px; border-radius: 100px;
}

/* ───── Demo frames ───── */
.a-demo-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 30px 80px -40px rgba(44,24,16,0.25);
}

/* ───── Steps (anti-tamper) ───── */
.a-cd-grid { display: grid; grid-template-columns: 1fr 380px; gap: 80px; align-items: center; }
.a-steps { list-style: none; padding: 0; margin: 32px 0 0; }
.a-steps li {
  padding: 12px 0;
  font-size: 16px; line-height: 1.65;
  color: var(--ink-soft);
  display: flex; gap: 16px;
}
.a-steps li:last-child { padding-bottom: 0; }
.a-steps li span {
  font-family: var(--serif); font-style: italic;
  color: var(--sage); flex-shrink: 0; min-width: 24px;
}

/* ───── FAQ ───── */
.faq-item { border-bottom: 0.5px solid color-mix(in oklab, var(--rule), transparent 50%); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0; background: none; border: none; cursor: pointer;
  font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em;
  color: var(--ink); text-align: left;
}
.faq-mark {
  font-family: var(--serif); font-size: 28px;
  color: var(--sage); width: 32px; text-align: center;
}
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.16,1,.3,1); }
.faq-open .faq-a { max-height: 360px; }
.faq-a-inner {
  padding: 0 0 24px;
  font-size: 16px; line-height: 1.65;
  color: var(--ink-soft); max-width: 720px;
  font-weight: 300;
}

/* ───── CTA + Footer ───── */
.a-cta { text-align: center; padding-top: 120px; padding-bottom: 120px; }
.a-cta-h {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 80px);
  line-height: 1.0; letter-spacing: -0.03em;
  margin: 0 auto 24px; max-width: 640px;
}
.a-cta-h em { color: var(--sage); }
.a-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.a-footer { padding: 40px 64px; }
.a-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.a-foot-mark { font-family: var(--serif); font-size: 24px; display: flex; align-items: center; gap: 10px; }
.a-foot-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-muted); letter-spacing: 0.05em; }
.a-foot-meta a { color: var(--ink-soft); transition: color .2s; }
.a-foot-meta a:hover { color: var(--ink); }

/* ───── YouTube before/after slider ───── */
.ba {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #fff; overflow: hidden; user-select: none; cursor: ew-resize;
  border-radius: 6px;
}
.ba-pane { position: absolute; inset: 0; }
.ba-divider {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--ink); transform: translateX(-1px);
  pointer-events: none; z-index: 5;
}
.ba-handle {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: var(--ink); color: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.ba-tag {
  position: absolute; top: 12px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 4px 8px; background: rgba(0,0,0,0.7); color: white;
  z-index: 4; border-radius: 3px;
}
.ba-tag-l { left: 12px; }
.ba-tag-r { right: 12px; background: var(--sage); }

/* YouTube mock */
.yt {
  width: 100%; height: 100%;
  background: #fff;
  font-family: 'Roboto', system-ui, sans-serif;
  display: flex; flex-direction: column;
  color: #0f0f0f;
  font-size: 11px;
}
.yt-after { background: #fafafa; }
.yt-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.yt-logo { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.yt-play { color: #ff0000; font-size: 14px; }
.yt-search { width: 160px; height: 22px; background: #f0f0f0; border-radius: 11px; }
.yt-body { display: flex; flex: 1; min-height: 0; padding: 12px; gap: 12px; }
.yt-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.yt-after .yt-main { max-width: 100%; }
.yt-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border-radius: 6px;
  position: relative;
}
.yt-player::after {
  content: '▶'; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.6); font-size: 32px;
}
.yt-title { height: 14px; background: #ddd; border-radius: 3px; width: 70%; }
.yt-meta { height: 10px; background: #eee; border-radius: 3px; width: 40%; }
.yt-side { width: 130px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.yt-side-card { height: 50px; background: #f0f0f0; border-radius: 4px; display: flex; }
.yt-side-card::before { content: ''; width: 60%; background: linear-gradient(135deg, #d0d0d0, #b0b0b0); border-radius: 4px 0 0 4px; }
.yt-side-card::after  { content: ''; flex: 1; padding: 6px; background-image: linear-gradient(#ccc 2px, transparent 2px), linear-gradient(#ddd 2px, transparent 2px); background-size: 80% 6px, 60% 6px; background-position: 6px 6px, 6px 16px; background-repeat: no-repeat; }
.yt-shorts { padding: 8px 14px; border-top: 1px solid #e5e5e5; background: #fff5f5; flex-shrink: 0; }
.yt-shorts-label { font-size: 10px; font-weight: 700; color: #ff0000; letter-spacing: 0.1em; margin-bottom: 6px; }
.yt-shorts-row { display: flex; gap: 6px; }
.yt-short { flex: 1; aspect-ratio: 9 / 16; background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4); border-radius: 4px; max-height: 60px; }
.yt-clean-note {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--sage-soft); color: var(--sage-dark);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.yt-clean-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }

/* ───── Tamper demo ───── */
.tamper {
  background: var(--ink); color: var(--bg);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  font-family: var(--sans);
  position: relative; overflow: hidden;
  transition: transform 0.1s;
}
.tamper-shake { animation: tamperShake 0.4s; }
@keyframes tamperShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.tamper-title {
  font-family: var(--serif); font-style: italic;
  font-size: 36px; line-height: 1.1;
  margin-bottom: 24px;
  color: var(--bg);
}
.tamper-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 100px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: all .2s;
}
.tamper-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.tamper-log {
  margin-top: 24px;
  font-family: var(--mono); font-size: 11px;
  color: rgba(255,255,255,0.5); letter-spacing: 0.05em;
}

/* ───── Density variants ───── */
.dir[data-density="packed"] .a-section { padding-top: 56px; padding-bottom: 56px; }
.dir[data-density="packed"] .a-marg { margin-bottom: 36px; }
.dir[data-density="packed"] .a-col { margin-bottom: 32px; }
.dir[data-density="airy"]   .a-section { padding-top: 112px; padding-bottom: 112px; }

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .a-hero-grid, .a-stats, .a-modes, .a-cd-grid { grid-template-columns: 1fr !important; }
  .a-hero-text { padding-left: 0; }
  .a-section { padding: 56px 24px; }
  .a-nav { padding: 16px 24px; }
  .a-hero { padding: 24px 24px 56px; }
  .a-mode { padding: 24px 0; border-bottom: 0.5px solid var(--rule); }
  .a-mode:last-child { border-bottom: none; }
  .a-batteries { margin-top: 32px; flex-direction: row; gap: 16px; }
  .a-bat img { max-width: 100%; }
  .a-bat-label { font-size: 32px; }
  .dir-a-leaf { opacity: 0.28 !important; }
}
@media (max-width: 600px) {
  .a-nav-links li:nth-child(-n+2) { display: none; }
  .a-hero-h { font-size: clamp(40px, 11vw, 64px); }
  .a-hero-sub { font-size: 18px; }
  .a-h2 { font-size: clamp(32px, 7vw, 48px); }
  .a-batteries { flex-direction: column; }
  .dir-a-leaf { display: none; }
  .a-cta { padding-top: 72px; padding-bottom: 72px; }
}
