/* ============================================================
   theword.tools: home page (Canopy, light edition). theword-only; not synced.
   A sibling of jesustools.org's Canopy home (its css/home.css): the same
   --hero-sky green hero with three layered leaves, a glass headline panel,
   glass "stones" for the guides and tools, and the emerald footer.
   Loaded by index.html only, after site.css. Uses site.css tokens only
   (no hex); the art tokens (--hero-sky, --leaf-*, --dapple*, --hill-back,
   --section-tint) live in site.css so dark mode is handled there.
   Contract: jesustools.org docs/CANOPY.md + docs/DESIGN.md.
   ============================================================ */

/* ---------- Page frame: the home is full-bleed ---------- */
body.home-canopy {
  padding: 0 0 max(var(--space-5), env(safe-area-inset-bottom));
  row-gap: 0;
}
.canopy { position: relative; z-index: 1; width: 100%; overflow-x: clip; }
.canopy h1, .canopy h2 {
  margin: 0; text-wrap: balance;
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
}
.canopy p { max-width: none; }

/* Shell controls line up with the hero's wordmark row */
.home-canopy .top-controls {
  top: max(22px, env(safe-area-inset-top));
  right: max(24px, calc((100% - 1120px) / 2));
  gap: 8px; padding: 0; background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.home-canopy .site-footer {
  /* body.home-canopy has no side padding, so 100% is the true full width */
  z-index: 1; margin-top: 90px; width: 100%;
}

/* ---------- Home pills: larger than the shell default ---------- */
.canopy .pill:not(.pill--sm) {
  min-height: 54px; padding: 0 26px; gap: 10px;
  font-size: 16.5px; letter-spacing: -.005em;
}
.canopy .pill svg { width: 19px; height: 19px; }
.canopy .pill:focus-visible { outline-offset: 4px; border-radius: var(--radius-pill); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 3; max-width: 1120px; min-height: 44px; margin: 0 auto 30px;
}
.topbar .wordmark { margin: 0; }

/* ---------- Hero: sunlight through a few leaves ---------- */
.canopy-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 22px 24px 140px;
  background: var(--hero-sky);
}
.hero__light {
  position: absolute; inset: -20% -10% 0 -10%; pointer-events: none; z-index: -1;
  background:
    radial-gradient(30% 36% at 20% 18%, color-mix(in srgb, var(--gold-soft) 55%, transparent), transparent 70%),
    radial-gradient(26% 30% at 70% 30%, color-mix(in srgb, var(--gold) 28%, transparent), transparent 70%);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-3%, 0, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }

.hero__leaves { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; z-index: -1; }
.lf--far  { fill: var(--leaf-far);  color: var(--leaf-far-line); }
.lf--mid  { fill: var(--leaf-mid);  color: var(--leaf-mid-line); }
.lf--near { fill: var(--leaf-near); color: var(--leaf-near-line); }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 10s ease-in-out infinite alternate; }
.sway--b { animation-duration: 13s; animation-delay: -5s; }
.sway--c { animation-duration: 9s; animation-delay: -2s; }
@keyframes sway { from { transform: rotate(-2.4deg); } to { transform: rotate(2.6deg); } }

/* dappled light: three soft gold pools drifting */
.dapples { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.dapples i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(closest-side, var(--dapple), var(--dapple-2) 55%, transparent);
  mix-blend-mode: screen; filter: blur(6px);
  animation: dapple 20s ease-in-out infinite alternate;
}
.dapples i:nth-child(1) { width: 380px; height: 320px; left: 4%;  top: 2%; }
.dapples i:nth-child(2) { width: 260px; height: 240px; left: 56%; top: 8%;  animation-duration: 26s; animation-delay: -8s; }
.dapples i:nth-child(3) { width: 300px; height: 260px; left: 74%; top: 46%; animation-duration: 30s; animation-delay: -12s; opacity: .8; }
@keyframes dapple {
  0%   { transform: translate(0, 0) scale(1); opacity: .75; }
  50%  { opacity: 1; }
  100% { transform: translate(40px, 26px) scale(1.15); opacity: .6; }
}

.hero__inner {
  position: relative; max-width: 1120px; min-height: 400px; margin: 0 auto;
  display: grid; place-items: center;
}
.glass-panel {
  position: relative; width: 100%; max-width: 720px;
  padding: 46px 48px 44px; border-radius: var(--radius-sheet);
  text-align: center;
  background: var(--panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
}
.glass-panel::before { /* sun catching the panel's top-left edge */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 55%, transparent), transparent 28%);
  -webkit-mask: linear-gradient(black 0 0) content-box, linear-gradient(black 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(black 0 0) content-box exclude, linear-gradient(black 0 0);
  padding: 1.5px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px;
  padding: 6px 14px 6px 10px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--accent-text);
  background: color-mix(in srgb, var(--lime) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-text) 22%, transparent);
}
.kicker__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft), var(--gold) 60%, var(--coral));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent), 0 0 14px 2px color-mix(in srgb, var(--gold) 60%, transparent);
}
.canopy-hero h1 {
  font-size: clamp(38px, 4.9vw, 60px); line-height: 1.05; letter-spacing: -.035em;
  max-width: 15ch; margin-inline: auto; text-align: center; color: var(--text);
}
.hero__text .lead {
  font-size: clamp(18px, 1.6vw, 20px); line-height: 1.6; color: var(--muted);
  text-align: center; max-width: 38ch; margin: 20px auto 30px;
}
.canopy .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 0; }

.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; max-width: none; height: 110px; }
.hills__back { fill: var(--hill-back); }
.hills__front { fill: var(--surface-2); }

/* ---------- Welcome strip (?from=jesustools | ?from=qr), inside the panel ---------- */
.welcome-strip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) auto 0;
  max-width: 30rem;
  padding: var(--space-4) var(--space-7) var(--space-4) var(--space-5);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--glass));
  text-align: center;
}
.welcome-strip[hidden] { display: none; }
.welcome-strip__text { margin: 0; font-size: var(--fs-small); line-height: 1.5; color: var(--text); }
.welcome-strip__close { position: absolute; top: var(--space-2); right: var(--space-2); color: var(--muted); }
@media (min-width: 560px) {
  .welcome-strip { flex-direction: row; text-align: left; padding-right: var(--space-8); }
  .welcome-strip .pill { flex-shrink: 0; }
  .welcome-strip__close { top: 0; bottom: 0; margin-block: auto; }
}

/* ---------- Sections (shared) ---------- */
.section { position: relative; isolation: isolate; padding: 72px 24px; }
.section__head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text);
}
.label svg { display: inline-block; width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.section h2 { font-size: clamp(31px, 3.8vw, 46px); line-height: 1.1; text-align: center; color: var(--text); }
.canopy .sub { margin: 14px auto 0; color: var(--muted); font-size: 18px; max-width: 46ch; }
.more { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 44px 0 0; }

/* Programmatic focus target for "Start here" (not a control). */
.section h2[tabindex="-1"]:focus { outline: none; }

/* Start here: the sunlit understory band under the hills */
.circle {
  padding-top: 40px; padding-bottom: 96px;
  background: linear-gradient(var(--surface-2), var(--surface-2) 70%, var(--bg));
}
.circle::before,
.journey::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--section-tint);
}
.circle::before {
  -webkit-mask-image: linear-gradient(black 55%, transparent);
  mask-image: linear-gradient(black 55%, transparent);
}
.journey::before {
  -webkit-mask-image: linear-gradient(transparent, black 20%, black 80%, transparent);
  mask-image: linear-gradient(transparent, black 20%, black 80%, transparent);
}
.connect { padding-bottom: 24px; }

/* ---------- Glass stones ---------- */
.stones { display: grid; gap: 24px; align-items: start; margin: 0 auto; }
.stones--3 { max-width: 1120px; grid-template-columns: repeat(3, 1fr); }
.stones--2 { max-width: 760px; grid-template-columns: repeat(2, 1fr); }
.stones--3 .stone:nth-child(2) { margin-top: 34px; }
.stone {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 26px 24px 26px; border-radius: var(--radius-sheet);
  color: var(--text); text-decoration: none;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--glass-edge), var(--shadow);
  transition: transform .45s var(--ease-lift), box-shadow .45s, background-color .45s;
}
.stone:focus-visible { border-radius: var(--radius-sheet); }
@media (hover: hover) {
  .stone:hover { transform: translateY(-6px); background: var(--glass-strong); box-shadow: 0 0 0 1px var(--glass-edge), var(--shadow-hover); }
}
.leaf-icon {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; margin-bottom: 12px;
  color: var(--accent-text); background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px 50% 6px 50%;
  box-shadow: 0 0 0 1px var(--glass-edge), var(--glass-shadow);
  transition: transform .5s var(--ease-lift), color .3s;
}
.leaf-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.leaf-icon--sun { background: var(--gold-soft); color: var(--gold-ink); }
.stone:hover .leaf-icon { transform: rotate(-12deg); color: var(--coral-text); }
.stone__title { font-size: 19.5px; font-weight: 750; line-height: 1.25; letter-spacing: -.015em; }
.stone__text { color: var(--muted); font-size: 16px; line-height: 1.55; }
.stone__host { margin-top: 4px; font-size: var(--fs-caption); font-weight: 700; letter-spacing: .04em; color: var(--accent-text); }
.stone__go {
  position: absolute; top: 26px; right: 22px; width: 34px; height: 34px; padding: 7px; border-radius: 50%;
  fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  transition: background .35s, transform .35s;
}
.stone:hover .stone__go { background: var(--cta); stroke: var(--cta-ink); transform: translateX(2px); }

/* ---------- Load motion ---------- */
.glass-panel { animation: rise 1s var(--ease-lift) both; }
.hero__text > * { animation: rise .9s var(--ease-lift) both; }
.hero__text > :nth-child(1) { animation-delay: .12s; }
.hero__text > :nth-child(2) { animation-delay: .2s; }
.hero__text > :nth-child(3) { animation-delay: .28s; }
.hero__text > :nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stones--3 { grid-template-columns: 1fr; max-width: 560px; gap: 20px; }
  .stones--3 .stone:nth-child(2) { margin-top: 0; }
}
@media (max-width: 860px) {
  .canopy-hero { padding-bottom: 120px; }
  .hero__inner { min-height: 0; }
}
@media (max-width: 640px) {
  .stones--2 { grid-template-columns: 1fr; max-width: 560px; gap: 20px; }
}
@media (max-width: 600px) {
  .home-canopy .top-controls { top: max(16px, env(safe-area-inset-top)); right: 16px; }
  .topbar { margin-bottom: 20px; }
  .topbar .wordmark { font-size: 18px; }
  .canopy-hero { padding: 16px 16px 100px; }
  .glass-panel { padding: 26px 22px 24px; border-radius: var(--radius); }
  .canopy-hero h1 { font-size: 36px; }
  .hero__text .lead { font-size: 18px; margin: 16px auto 24px; }
  .canopy .actions { flex-direction: column; align-items: stretch; }
  .canopy .pill { justify-content: center; }
  .section { padding-left: 16px; padding-right: 16px; }
  .section h2 { font-size: 31px; }
  .canopy .sub { font-size: 17px; }
  .circle { padding-bottom: 72px; }
  .stone:nth-child(odd) { margin-left: 12px; }
  .stone:nth-child(even) { margin-right: 12px; }
  .more .pill { flex: 1 1 auto; }
  .home-canopy .site-footer { margin-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .canopy *, .canopy *::before, .canopy *::after { animation: none !important; transition: none !important; }
  .stone:hover, .stone:hover .leaf-icon, .stone:hover .stone__go,
  .canopy .pill:hover, .canopy .pill:hover svg { transform: none; }
}
