/* Time Your Peace — shared styles */

:root {
  --color-bg: #F7F3EC;          /* warm cream */
  --color-bg-alt: #EFE9DD;      /* slightly deeper cream for panels */
  --color-ink: #2B2E2C;         /* charcoal/slate text */
  --color-ink-soft: #565B57;    /* softer body text */
  --color-sage: #6E8770;        /* muted sage accent */
  --color-sage-deep: #4E6650;   /* deeper sage for text-on-sage / hover */
  --color-line: #DCD4C3;        /* hairline borders */
  --color-focus: #1B4B3A;       /* visible focus outline, high contrast */

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --measure: 68ch;
  --radius: 2px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle grain, sitewide, for tactile depth instead of flat color */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  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");
}

img { max-width: 100%; display: block; }

a {
  color: var(--color-sage-deep);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--color-ink); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 0; }
h3 { font-size: 1.25rem; }

p { max-width: var(--measure); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-line);
  background: var(--color-bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--color-sage-deep); }

nav.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

nav.primary-nav a {
  color: var(--color-ink-soft);
  text-decoration: none;
  font-size: 0.98rem;
}

nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"] {
  color: var(--color-sage-deep);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--color-ink);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(110,135,112,0.22), rgba(110,135,112,0) 70%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sage-deep);
  margin-bottom: 1rem;
}

.hero h1 { margin: 0 0 1.1rem; }

.hero p.lede {
  font-size: 1.15rem;
  color: var(--color-ink-soft);
  margin-bottom: 1.75rem;
}

.hero-figure {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #5C7A5E, #3E5540);
  display: flex;
  align-items: flex-end;
  padding: 1.75rem;
  box-shadow: 0 24px 60px -20px rgba(43,46,44,0.35);
}

.hero-figure svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-figure span {
  position: relative;
  font-family: var(--font-display);
  color: #F7F3EC;
  font-size: 1.05rem;
  line-height: 1.4;
}

/* Literal callback to the "three minutes" promise: one ring quietly sweeps
   a full circle every 180s (3 minutes), and the center dot breathes. Pure
   CSS, no images/JS, negligible cost, disabled under reduced-motion. */
.hero-figure .breath-ring {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-90deg);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  animation: breath-sweep 180s linear infinite;
}

.hero-figure .breath-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: breath-pulse 5.5s ease-in-out infinite;
}

@keyframes breath-sweep {
  to { stroke-dashoffset: 0; }
}

@keyframes breath-pulse {
  0%, 100% { transform: scale(1); fill: #F7F3EC; }
  50% { transform: scale(9.8); fill: #F2D878; }
}

/* Box-breathing variant: same card/rings, reused inline in articles with a
   paced 4s-in / 4s-hold / 4s-out / 0.5s-pause cycle instead of the ambient
   home page pulse. Independent class + keyframes so home is never touched. */
.breath-tool {
  max-width: 320px;
  margin: 2rem auto;
}

.box-breath-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: box-breath-pulse 12.5s ease-in-out infinite;
}

@keyframes box-breath-pulse {
  0%   { transform: scale(1);   fill: #F7F3EC; }
  32%  { transform: scale(9.8); fill: #F2D878; }
  64%  { transform: scale(9.8); fill: #F2D878; }
  96%  { transform: scale(1);   fill: #F7F3EC; }
  100% { transform: scale(1);   fill: #F7F3EC; }
}

/* Decorative organic blob backgrounds, reused behind sections for depth */
.blob-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob-field svg { position: absolute; }

section { position: relative; }
section > .wrap { position: relative; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-sage-deep);
  color: #FBF9F4;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--color-sage-deep);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #FBF9F4;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
}

.btn-ghost:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-sage-deep);
  color: var(--color-ink);
  transform: none;
}

/* Sections */
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--color-line); }

.section-head { max-width: 42rem; margin-bottom: 2.25rem; }
.section-head p { color: var(--color-ink-soft); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.pillar {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  padding: 1.75rem;
}

.pillar {
  position: relative;
  overflow: hidden;
}

.pillar-icon {
  width: 40px;
  height: 40px;
  color: var(--color-sage-deep);
  margin-bottom: 0.9rem;
}

.pillar .tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-sage-deep);
  margin-bottom: 0.6rem;
}

.pillar h3 { margin: 0 0 0.5rem; }
.pillar p { margin: 0; color: var(--color-ink-soft); font-size: 0.98rem; }

.why-block {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: start;
}

.why-block .label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sage-deep);
}

.cta-band {
  position: relative;
  overflow: hidden;
  background: var(--color-sage-deep);
  color: #FBF9F4;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
}

.cta-band::before,
.cta-band::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(251,249,244,0.18);
}

.cta-band::before { width: 340px; height: 340px; right: -120px; top: -140px; }
.cta-band::after { width: 220px; height: 220px; left: -80px; bottom: -100px; border-color: rgba(251,249,244,0.12); }

.cta-band > * { position: relative; z-index: 1; }

.cta-band h2 { color: #FBF9F4; }
.cta-band p { color: rgba(251,249,244,0.85); margin: 0 auto 1.75rem; }
.cta-band .btn { background: #FBF9F4; color: var(--color-sage-deep); border-color: #FBF9F4; }
.cta-band .btn:hover { background: var(--color-ink); color: #FBF9F4; border-color: var(--color-ink); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 3rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--color-ink-soft);
}

.site-footer .footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.site-footer a { color: var(--color-ink-soft); }
.site-footer a:hover { color: var(--color-sage-deep); }

.legal-note {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  max-width: 60rem;
}

.copyright {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
}

/* Reveal animation, applied once on load */
.reveal {
  animation: rise 0.6s ease both;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.16s; }
.reveal-3 { animation-delay: 0.27s; }

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

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .hero-figure .breath-ring,
  .hero-figure .breath-dot,
  .box-breath-dot { animation: none; }
}

/* Mobile */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  /* Text column first on phones: eyebrow, headline, and button make the first screen */
  .hero-figure { order: 2; aspect-ratio: 16/10; }
  .pillars { grid-template-columns: 1fr; }
  .why-block { grid-template-columns: 1fr; }
  nav.primary-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Article table of contents (sidebar).
   Opt-in per article: wrap the existing .article-hero/h1/body markup in
   <article class="article-main"> and add an <aside class="article-toc"> with
   an <a href="#slug"> per H2 (each H2 needs a matching id). Put the .wrap
   at max-width:68rem instead of 44rem so both columns fit. Full copy-paste
   pattern (including the scroll-spy script) lives in
   website-build/templates/article-toc-template.html — kept outside site/
   on purpose so it never gets swept into a deploy. */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-areas: "main toc";
  gap: 3rem;
}

.article-main { grid-area: main; min-width: 0; }
.article-toc { grid-area: toc; }

.article-toc-inner {
  position: sticky;
  top: 2rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 1.5rem;
}

.article-toc .label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--color-sage-deep);
  margin-bottom: 0.9rem;
  display: block;
}

.article-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  counter-reset: toc;
}

.article-toc a {
  color: var(--color-ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
}

.article-toc a:hover,
.article-toc a.is-active {
  color: var(--color-sage-deep);
}

.article-toc a.is-active { font-weight: 600; }

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "toc" "main";
  }
  .article-toc-inner { position: static; margin-bottom: 2rem; }
}
