/*
Theme Name: Amberleaf
Theme URI: https://amberleafcounseling.example
Author: Amberleaf Counseling & Recovery
Description: A warm, unhurried theme for a counseling and recovery practice.
Version: 1.0
Requires PHP: 7.4
Text Domain: amberleaf
*/

:root {
	--paper: #faf5ec;
	--paper-2: #f3ebdd;
	--paper-3: #ede1cc;
	--paper-4: #e6d8bf;
	--ink: #3b2f26;
	--ink-dim: #6b5b4c;
	--ink-mute: #948374;
	--terracotta: #c1683f;
	--terracotta-2: #e0916a;
	--terracotta-dim: #a85a35;
	--sage: #728a68;
	--sage-2: #a9bca0;
	--gold: #d9a24e;
	--gold-2: #f0c98a;
	--line: rgba(59, 47, 38, 0.12);
	--line-strong: rgba(59, 47, 38, 0.24);
	--shadow: 0 24px 60px -30px rgba(59, 47, 38, 0.35);
	--ff-head: 'Lora', 'Iowan Old Style', Georgia, serif;
	--ff-body: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--ff-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
	--container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--ff-body);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

::selection { background: var(--terracotta); color: var(--paper); }

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

h1, h2, h3, h4 { font-family: var(--ff-head); font-weight: 500; line-height: 1.15; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 5.5vw, 4.6rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
p { margin: 0 0 1em; }
.eyebrow {
	font-family: var(--ff-mono);
	font-size: 12.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--terracotta-dim);
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--terracotta); }

.lede { font-size: 1.2rem; color: var(--ink-dim); max-width: 56ch; }

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 28px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	position: relative;
	overflow: hidden;
	border: 1px solid transparent;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.btn-primary { background: var(--terracotta); color: var(--paper); box-shadow: 0 14px 30px -14px rgba(193, 104, 63, 0.65); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(193, 104, 63, 0.75); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--terracotta); color: var(--terracotta-dim); }
.btn-shine::after {
	content: '';
	position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
	background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
	transform: skewX(-20deg);
	transition: left 0.7s ease;
}
.btn-shine:hover::after { left: 130%; }

/* ---------- ambient GPU layer: sitewide warm breathing glow ---------- */
#ambientGlow {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: -1;
	mix-blend-mode: multiply;
	opacity: 0.9;
	pointer-events: none;
}
.grain {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0.05;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	padding: 22px 0;
	transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
.site-header.is-scrolled {
	background: rgba(250, 245, 236, 0.86);
	backdrop-filter: blur(14px);
	box-shadow: 0 1px 0 var(--line);
	padding: 14px 0;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--ff-head); font-size: 1.3rem; color: var(--ink); }
.brand svg { width: 28px; height: 28px; color: var(--terracotta); }
.main-nav ul { display: flex; gap: 34px; }
.main-nav a { font-size: 14.5px; font-weight: 600; color: var(--ink-dim); position: relative; padding: 4px 0; }
.main-nav a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px; background: var(--terracotta); transition: width 0.3s ease; }
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.crisis-note { font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 150px 0 90px;
	overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
.hero-copy h1 { margin: 18px 0 22px; }
.hero-copy h1 em { font-style: italic; color: var(--terracotta-dim); }
.hero-actions { display: flex; gap: 16px; margin-top: 34px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; margin-top: 46px; flex-wrap: wrap; }
.hero-meta div { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); }
.hero-meta strong { display: block; font-family: var(--ff-head); font-size: 1.3rem; color: var(--ink); font-weight: 500; }

/* breathing guide */
.breathe-widget {
	position: relative;
	width: 100%;
	max-width: 380px;
	aspect-ratio: 1;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}
.breathe-ring {
	position: absolute; inset: 0;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
}
.breathe-ring.r2 { inset: 30px; opacity: 0.7; }
.breathe-ring.r3 { inset: 60px; opacity: 0.45; }
.breathe-orb {
	width: 46%;
	height: 46%;
	border-radius: 50%;
	background: radial-gradient(circle at 34% 30%, var(--gold-2), var(--terracotta) 62%, var(--terracotta-dim));
	box-shadow: 0 0 60px 10px rgba(193, 104, 63, 0.35);
	transform: scale(0.72);
	transition: transform 4s cubic-bezier(0.45, 0, 0.55, 1), box-shadow 4s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.breathe-orb span {
	font-family: var(--ff-mono);
	font-size: 12.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff8ee;
	text-align: center;
	padding: 0 20px;
}
.breathe-widget.inhale .breathe-orb { transform: scale(1); box-shadow: 0 0 90px 18px rgba(217, 162, 78, 0.45); }
.breathe-caption { text-align: center; margin-top: 22px; font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); letter-spacing: 0.05em; }

/* ---------- ticker ---------- */
.ticker-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; background: var(--paper-2); }
.ticker-track { display: flex; gap: 60px; width: max-content; animation: ticker 32s linear infinite; }
.ticker-track span { font-family: var(--ff-mono); font-size: 13px; color: var(--ink-mute); white-space: nowrap; letter-spacing: 0.03em; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- section shell ---------- */
.section { padding: 130px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 60px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin-top: 16px; }
.section-alt { background: var(--paper-2); }

/* ---------- story split ---------- */
.story-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; align-items: center; }
.story-media { position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); }
.story-media img { width: 100%; height: 560px; object-fit: cover; }
.story-badge {
	position: absolute; bottom: 26px; left: 26px;
	background: rgba(250, 245, 236, 0.92);
	backdrop-filter: blur(8px);
	border-radius: 18px;
	padding: 18px 22px;
	box-shadow: var(--shadow);
}
.story-badge strong { display: block; font-family: var(--ff-head); font-size: 1.8rem; color: var(--terracotta-dim); }
.story-badge span { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.story-copy p { color: var(--ink-dim); }
.story-list { margin-top: 28px; display: grid; gap: 16px; }
.story-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--ink-dim); }
.story-list svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--sage); margin-top: 2px; }

/* ---------- program grid ---------- */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 46px; }
.filter-pill {
	font-family: var(--ff-mono); font-size: 12.5px; letter-spacing: 0.03em;
	padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
	color: var(--ink-dim); background: transparent; transition: all 0.3s ease;
}
.filter-pill.is-active, .filter-pill:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.program-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.program-card {
	background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px;
	position: relative; overflow: hidden; transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), border-color 0.4s ease, box-shadow 0.4s ease;
}
.program-card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: var(--shadow); }
.program-card::before {
	content: ''; position: absolute; inset: 0; border-radius: 22px; padding: 1px;
	background: linear-gradient(135deg, var(--terracotta-2), var(--sage-2), var(--gold));
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor; mask-composite: exclude;
	opacity: 0; transition: opacity 0.4s ease;
}
.program-card:hover::before { opacity: 1; }
.program-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--paper-3); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; color: var(--terracotta-dim); }
.program-card h3 { margin-bottom: 10px; }
.program-meta { display: flex; gap: 14px; margin-top: 20px; font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); flex-wrap: wrap; }
.program-meta span { display: flex; align-items: center; gap: 6px; }
.program-card p.desc { color: var(--ink-dim); font-size: 14.5px; }
.program-link { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--terracotta-dim); }
.program-link svg { width: 15px; height: 15px; transition: transform 0.3s ease; }
.program-card:hover .program-link svg { transform: translateX(4px); }

/* ---------- path / journey section with firefly canvas ---------- */
.path-section { position: relative; background: #2c2418; color: #f3e6d2; overflow: hidden; }
.path-section canvas#fireflyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.path-section .wrap { position: relative; z-index: 2; }
.path-section .section-head h2 { color: #fbeed9; }
.path-section .eyebrow { color: var(--gold); }
.path-section .eyebrow::before { background: var(--gold); }
.path-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; margin-top: 50px; }
.path-step { position: relative; padding-top: 30px; }
.path-step::before { content: attr(data-n); position: absolute; top: 0; left: 0; font-family: var(--ff-mono); font-size: 12px; color: var(--gold); border: 1px solid rgba(217,162,78,0.4); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.path-step h4 { color: #fbeed9; font-size: 1.05rem; margin: 14px 0 8px; }
.path-step p { color: rgba(243, 230, 210, 0.68); font-size: 13.5px; }
.path-line { position: absolute; top: 12px; left: 5%; right: 5%; height: 1px; background: linear-gradient(90deg, transparent, rgba(217,162,78,0.4), transparent); }

/* ---------- grounding exercise widget ---------- */
.ground-panel {
	background: var(--paper-3); border-radius: 30px; padding: 60px; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 50px; align-items: center;
}
.ground-copy .eyebrow { margin-bottom: 16px; }
.ground-steps { display: grid; gap: 12px; margin-top: 26px; }
.ground-step-btn {
	display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
	background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px;
	font-family: var(--ff-body); color: var(--ink); transition: border-color 0.3s ease, background 0.3s ease;
}
.ground-step-btn .num { font-family: var(--ff-mono); font-size: 20px; color: var(--terracotta); width: 30px; }
.ground-step-btn.is-active { border-color: var(--terracotta); background: #fffaf1; }
.ground-step-btn .label strong { display: block; font-size: 14.5px; }
.ground-step-btn .label span { font-size: 12.5px; color: var(--ink-mute); }
.ground-display {
	background: var(--paper); border-radius: 22px; padding: 46px; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow);
}
.ground-display .n { font-family: var(--ff-head); font-size: 4.5rem; color: var(--terracotta-dim); line-height: 1; }
.ground-display .prompt { font-size: 1.1rem; margin-top: 18px; color: var(--ink); max-width: 30ch; }
.ground-display .hint { margin-top: 14px; font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); }

/* ---------- approach cards ---------- */
.approach-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.approach-card { text-align: center; padding: 38px 24px; border-radius: 20px; border: 1px solid var(--line); }
.approach-card .glyph { width: 52px; height: 52px; margin: 0 auto 20px; border-radius: 50%; background: linear-gradient(135deg, var(--terracotta-2), var(--gold)); display: flex; align-items: center; justify-content: center; color: #fff; }
.approach-card h4 { font-size: 1.05rem; margin-bottom: 10px; }
.approach-card p { font-size: 13.5px; color: var(--ink-dim); }

/* ---------- stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; text-align: center; }
.stat-num { font-family: var(--ff-head); font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--terracotta-dim); font-weight: 500; }
.stat-label { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; }

/* ---------- testimonials ---------- */
.testi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.testi-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 32px; }
.testi-quote { font-family: var(--ff-head); font-size: 1.15rem; font-style: italic; color: var(--ink); line-height: 1.5; }
.testi-who { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.testi-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--sage-2), var(--terracotta-2)); display: flex; align-items: center; justify-content: center; font-family: var(--ff-mono); font-size: 12px; color: #fff; }
.testi-who span { font-size: 13px; color: var(--ink-mute); }

/* ---------- access / insurance ---------- */
.access-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 50px; }
.access-list { display: grid; gap: 14px; margin-top: 20px; }
.access-list li { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.access-list li span { color: var(--ink-mute); font-family: var(--ff-mono); font-size: 12px; }

/* ---------- journal preview ---------- */
.journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.journal-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 18px; }
.journal-card .cat { font-family: var(--ff-mono); font-size: 11px; color: var(--terracotta-dim); text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 0 8px; }
.journal-card h3 { font-size: 1.15rem; }
.journal-card .date { margin-top: 12px; font-size: 12.5px; color: var(--ink-mute); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { display: flex; justify-content: space-between; align-items: center; padding: 26px 0; font-family: var(--ff-head); font-size: 1.1rem; }
.faq-q .plus { width: 22px; height: 22px; position: relative; flex-shrink: 0; }
.faq-q .plus::before, .faq-q .plus::after { content: ''; position: absolute; background: var(--terracotta); transition: transform 0.3s ease; }
.faq-q .plus::before { width: 100%; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
.faq-q .plus::after { height: 100%; width: 1.5px; left: 50%; top: 0; transform: translateX(-50%); }
.faq-item.is-open .plus::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-a p { padding-bottom: 24px; color: var(--ink-dim); max-width: 68ch; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--terracotta-dim), var(--terracotta)); border-radius: 34px; padding: 90px 70px; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff8ee; }
.cta-band p { color: rgba(255,248,238,0.82); }
.cta-band .btn-ghost { border-color: rgba(255,248,238,0.5); color: #fff8ee; }
.cta-band .btn-ghost:hover { border-color: #fff8ee; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(250, 245, 236, 0.7); padding: 90px 0 40px; }
.footer-crisis { background: rgba(250,245,236,0.06); border: 1px solid rgba(250,245,236,0.14); border-radius: 18px; padding: 22px 28px; margin-bottom: 60px; display: flex; align-items: center; gap: 18px; }
.footer-crisis strong { color: #fbeed9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h5 { font-family: var(--ff-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(250,245,236,0.5); margin-bottom: 18px; }
.footer-links li { margin-bottom: 10px; font-size: 14px; }
.footer-links a:hover { color: #fbeed9; }
.footer-bottom { margin-top: 70px; padding-top: 26px; border-top: 1px solid rgba(250,245,236,0.12); display: flex; justify-content: space-between; font-size: 12.5px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- page / article generic ---------- */
.page-hero { padding: 170px 0 70px; text-align: center; }
.page-hero .eyebrow { justify-content: center; }
.content-wrap { max-width: 760px; margin: 0 auto; padding: 60px 32px 140px; }
.content-wrap h2 { margin: 46px 0 18px; }
.content-wrap p { color: var(--ink-dim); }
.content-wrap img { border-radius: 20px; margin: 30px 0; }
.article-meta { display: flex; gap: 18px; align-items: center; font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); margin-bottom: 24px; }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; padding: 60px 0 140px; }

/* ---------- cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-dot { width: 6px; height: 6px; background: var(--terracotta); }
.cursor-ring { width: 34px; height: 34px; border: 1px solid var(--terracotta-2); transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease; }
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { display: block; }
.cursor-dot, .cursor-ring { display: none; }

@media (max-width: 980px) {
	.hero-grid, .story-split, .access-panel, .ground-panel { grid-template-columns: minmax(0, 1fr); }
	.program-grid, .approach-grid, .stats-row, .testi-row, .journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.path-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.main-nav { display: none; }
}
@media (max-width: 620px) {
	.program-grid, .approach-grid, .stats-row, .testi-row, .journal-grid, .archive-grid { grid-template-columns: minmax(0, 1fr); }
	.path-steps { grid-template-columns: minmax(0, 1fr); }
	.cta-band { padding: 60px 30px; }
	.ground-panel { padding: 34px; }
}

@media (prefers-reduced-motion: reduce) {
	.reveal { transition: none; opacity: 1; transform: none; }
	.breathe-orb { transition: none; }
	.ticker-track { animation: none; }
}
