/* Homepage — styles home.hbs
 * ---------------------------------------------------------------------
 * Loaded after figtree-cream.css, so every colour here comes from the
 * palette tokens rather than a literal. The deep-green hero panel is the
 * one documented exception -- see --on-deep below.
 *
 * The type scale is copied from the static site rather than re-judged:
 * hero clamp(2.8rem, 5vw, 5.2rem), section headings clamp(2rem, 3.5vw,
 * 3rem), card copy 0.875rem/1.75, persona copy 0.85rem/1.75. Those are the
 * numbers the live page has been running for months; picking new ones here
 * is how the two pages drift apart.
 *
 * Breakpoints match figtree.css (960 / 600) so the whole site steps
 * together rather than each page choosing its own.
 */

:root {
  /* Foreground for the deep-green hero panel.
   *
   * That panel is --green-deep in BOTH palettes -- it does not lighten when
   * the rest of the page goes cream. So its text cannot use --text, which
   * flips from near-white to near-black between the two. These two tokens
   * are the panel's own foreground and stay put whatever the page does. */
  --on-deep:       #ddeacc;
  --on-deep-muted: #7a9a64;
}

/* ---- Hero ---- */

/* Wraps the split and the stat band so the band lands at the foot of the
   first screen instead of wherever the hero happens to end. */
.ft-home-hero-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 68px); /* 68px = .ft-nav height */
}

.ft-home-hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.ft-home-hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 4rem 6rem 5rem;
  position: relative;
  z-index: 2;
}

.ft-home-hero-copy { max-width: 34rem; }

.ft-home-hero h1 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  line-height: 1.05;
  margin: 0.5rem 0 1.5rem;
  max-width: 18ch;
}

.ft-home-sub {
  max-width: 460px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.ft-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.5rem 0 0;
}

/* The green panel. The diagonal is a clip-path rather than a rotated
   pseudo-element so the pattern and the tree stay upright inside it. */
.ft-home-hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  background: var(--green-deep);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.ft-home-hero-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%235a9e2f' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.ft-hero-visual {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* The FigTree illustration, in place of the tree emoji.
 *
 * PATH: relative to THIS stylesheet, which the pod serves from assets/css/,
 * so ../img/ resolves to assets/img/ -- where theme-seed puts any image key
 * from the theme ConfigMap. Not {{asset "img/..."}}: a .css file is not a
 * Handlebars template and Ghost does not run helpers in here.
 *
 * ?v= IS LOAD-BEARING, NOT DECORATION. Ghost serves this file correctly --
 * from inside ghost-0 the bare path returns 200 and 29,298 bytes, identical
 * to the source. Through Cloudflare the bare path returns 404, while the
 * same path with ANY query string returns 200 and the real bytes. Every bare
 * request under /assets/img/ behaves that way; /assets/css/ does not, which
 * is exactly the difference {{asset}} makes -- it emits ?v=<hash> for the
 * stylesheets and there is no helper doing that here. cf-cache-status says
 * DYNAMIC on the 404, so a cached negative response does not explain it and
 * the cause is still open (Cache Rule or Worker route on /assets/img/*).
 *
 * Bump the number when the image changes. Cloudflare caches brand assets for
 * four hours -- the same thing that bit the Authentik branding swap.
 *
 * font-size: 0 suppresses the emoji that is still the text node of this div
 * in home.hbs. That character should come out of the markup next time that
 * file is edited. The div has no content of its own, so the box needs an
 * explicit width and the source's own 646x433 ratio.
 *
 * The drop-shadow and float were already here and now do something better:
 * they follow the tree's real silhouette instead of an emoji's square. */
.ft-hero-tree {
  width: 320px;
  max-width: 100%;
  aspect-ratio: 646 / 433;
  margin: 0 auto 2rem;
  font-size: 0;
  background: url("../img/figtree-tree-hero.png?v=1") center / contain no-repeat;
  filter: drop-shadow(0 20px 60px rgba(90, 158, 47, 0.25));
  animation: ft-float 5s ease-in-out infinite;
}

.ft-hero-visual-line {
  font-family: 'Courier Prime', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--on-deep-muted);
}

.ft-hero-visual-line strong { color: var(--on-deep); }

.ft-hero-dba {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  font-family: 'Courier Prime', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  color: rgba(122, 154, 100, 0.4);
}

@keyframes ft-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* A drifting tree is decoration, not information. */
@media (prefers-reduced-motion: reduce) {
  .ft-hero-tree { animation: none; }
}

/* ---- Stat rows ---- */

.ft-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}

.ft-stat { display: flex; flex-direction: column; gap: 0.2rem; }

.ft-stat strong {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--green-dark);
}

.ft-stat span {
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ft-stats-compact { gap: 1.5rem; }
.ft-stats-compact .ft-stat strong { font-size: 1.35rem; }

/* The band under the hero: centred, hairline-separated. */
.ft-statband {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0;
}

.ft-statband .ft-stats {
  gap: 0;
  justify-content: center;
}

.ft-statband .ft-stat {
  align-items: center;
  text-align: center;
  padding: 0.25rem 3rem;
  border-left: 1px solid var(--border);
}

.ft-statband .ft-stat:first-child { border-left: none; }

/* ---- Section frame ---- */

.ft-home-section { padding: 4.5rem 0; }
.ft-home-section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ft-home-section h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  margin: 0.4rem 0 1.25rem;
}

.ft-section-intro {
  max-width: 580px;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 3rem;
}

.ft-home-body { padding: 3rem 0; }

/* ---- Card grids ---- */

.ft-home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.ft-home-grid-3 { grid-template-columns: repeat(3, 1fr); }

.ft-home-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

/* Only the linked service cards lift. The personas are not clickable and
   should not pretend to be. */
a.ft-home-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.ft-home-card-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.9rem; }

.ft-home-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
  color: var(--green-dark);
}

.ft-home-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 1.25rem;
}

/* ---- Personas ---- */

.ft-persona { padding: 2rem 1.75rem; }
.ft-persona h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.ft-persona p { font-size: 0.85rem; line-height: 1.75; margin-bottom: 0; }

.ft-persona-role {
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

/* ---- Pills ---- */

.ft-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.1rem; }

.ft-pills span {
  font-family: 'Courier Prime', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---- Scripture ---- */

.ft-scripture {
  padding: 4.5rem 0;
  text-align: center;
}

.ft-scripture blockquote {
  max-width: 44ch;
  margin: 0 auto;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.5;
  color: var(--green-dark);
}

.ft-scripture cite {
  display: block;
  margin-top: 1.25rem;
  font-family: 'Courier Prime', monospace;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ---- Prose ---- */

.ft-prose p {
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

/* ---- The FigTree Method ---- */

.ft-method {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
}

.ft-method li { position: relative; padding-left: 3.5rem; }

.ft-method-num {
  position: absolute;
  left: 0;
  top: -0.15rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--green);
  opacity: 0.45;
}

.ft-method h3 { font-size: 1.15rem; margin: 0 0 0.5rem; color: var(--green-dark); }
.ft-method p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.75; margin: 0; }

/* ---- Founder ---- */

.ft-founder-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2.5rem;
}

.ft-founder-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2rem 1.75rem;
  text-align: center;
}

.ft-founder-avatar {
  width: 68px; height: 68px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
}

.ft-founder-card strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
}

.ft-founder-card > span {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.ft-founder-card .ft-pills { justify-content: center; }
.ft-founder-card .ft-stats { justify-content: center; }
.ft-founder-bio p { font-size: 1rem; line-height: 1.8; color: var(--text-muted); margin: 0 0 1.25rem; }
.ft-founder-bio .ft-btn { margin-top: 0.5rem; }

/* ---- Breakpoints ---- */

@media (max-width: 960px) {
  /* The split stacks: copy, then the green panel as a shorter band. The
     diagonal only reads as a diagonal across a wide viewport -- kept at
     phone width it just clips the left edge of the panel. */
  .ft-home-hero-wrap { min-height: 0; }
  .ft-home-hero { grid-template-columns: 1fr; }
  .ft-home-hero-left { padding: 4rem 2rem 2.5rem; }
  .ft-home-hero-copy { max-width: none; }
  .ft-home-hero-right { clip-path: none; min-height: 240px; padding: 3rem 2rem; }
  .ft-hero-tree { width: 210px; margin-bottom: 1.5rem; }

  .ft-statband .ft-stat { padding: 0.25rem 1.5rem; }

  .ft-home-grid,
  .ft-home-grid-3,
  .ft-method { grid-template-columns: 1fr; }
  .ft-founder-grid { grid-template-columns: 1fr; gap: 2rem; }
  .ft-stats { gap: 2rem; }
  .ft-home-card { padding: 2rem 1.75rem; }
}

@media (max-width: 600px) {
  .ft-home-section { padding: 3rem 0; }
  .ft-home-actions { flex-direction: column; align-items: stretch; }
  .ft-home-actions .ft-btn { text-align: center; }
  .ft-stats { gap: 1.5rem; }
  .ft-stat strong { font-size: 1.6rem; }

  /* Two up, and the vertical rules go -- they read as noise once the row
     wraps and the columns no longer line up. */
  .ft-statband .ft-stats { gap: 1.5rem 2rem; }
  .ft-statband .ft-stat { border-left: none; padding: 0; flex: 1 1 40%; }
}
