/* Ancient Grove — illustrated, data-driven graphics */

/* growing tree: each branch level draws in after the one below it */
.grow-tree { color: var(--gold); }
.grow-tree .branches path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: grow 1.4s var(--ease) forwards; animation-delay: calc(var(--l) * .28s); opacity: .9; }
.grow-tree .leaves circle { fill: var(--sage); opacity: 0; transform-box: fill-box; transform-origin: center; animation: bud .9s var(--ease) forwards; animation-delay: calc(2.6s + var(--i) * .03s); }
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes bud { from { opacity: 0; transform: scale(0); } to { opacity: .75; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .grow-tree .branches path { stroke-dashoffset: 0; } .grow-tree .leaves circle { opacity: .75; } }



/* grove in cross-section */
.grove-rings { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, .65fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; }
@media (max-width: 900px) { .grove-rings { grid-template-columns: 1fr; } }
.ring-chart { position: relative; max-width: 900px; width: 100%; margin-inline: auto; }
.ring-chart svg { width: 100%; height: 100%; overflow: visible; }
.ring-chart .wood { fill: url(#woodGrad); }
.ring-chart .ring { fill: none; stroke: var(--gold); stroke-opacity: .28; transition: stroke-opacity .3s, stroke-width .3s; }
.ring-chart .ring.minor { stroke-opacity: .1; }
.ring-chart .tree-ring { fill: none; stroke: var(--gold-soft); stroke-width: 2.2; stroke-opacity: .85; cursor: pointer; transition: stroke .25s, stroke-width .25s; }
.ring-chart .tree-ring:hover, .ring-chart .tree-ring.active, .ring-chart .tree-ring:focus-visible { stroke: var(--copper); stroke-width: 5; stroke-opacity: 1; outline: none; }
.ring-chart .seed { fill: var(--gold); }
.ring-chart .crack { stroke: var(--night); stroke-width: 1.2; opacity: .55; fill: none; }
.ring-chart .year-label { fill: var(--parchment); font: 650 15px var(--body); letter-spacing: .04em; paint-order: stroke; stroke: rgba(16, 11, 6, .92); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; direction: ltr; }
.ring-chart .tick { stroke: var(--gold-soft); stroke-width: .8; stroke-opacity: .2; }
.ring-readout { min-height: 220px; }
.ring-readout .num { font-size: clamp(3.5rem, 6vw, 5.25rem); line-height: 1; color: var(--gold-soft); display: flex; align-items: baseline; flex-wrap: nowrap; gap: .12em; white-space: nowrap; }
.ring-readout h3 { margin-block: var(--s3) var(--s2); font-size: clamp(1.8rem, 3vw, 2.6rem); }
.ring-readout .sci { font: italic 1.15rem var(--display); color: var(--parchment-soft); }
.ring-readout .link-arrow { margin-top: var(--s4); }

/* heights to scale */
.heights { position: relative; border-bottom: 1px solid var(--line-strong); padding-top: var(--s5); }
.heights-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--moss) transparent; padding-bottom: var(--s3); }
.heights svg { display: block; width: 100%; height: auto; max-height: 560px; }
.heights .grid-line { stroke: var(--line); stroke-dasharray: 2 6; }
.heights .grid-label { fill: var(--muted); font: 500 11px var(--body); }
.heights .silhouette { color: var(--sage); transition: color .3s; cursor: pointer; }
.heights .silhouette:hover, .heights .silhouette:focus-visible { color: var(--gold-soft); outline: none; }
.heights .silhouette .crown { fill: currentColor; opacity: .5; transition: opacity .3s; }
.heights .silhouette:hover .crown { opacity: .75; }
.heights .silhouette .trunk { fill: #7a5a3a; }
.heights .silhouette text { fill: var(--parchment-soft); font: 500 12px var(--body); }
.heights .silhouette text.h { fill: var(--gold); font: italic 600 15px var(--display); }
.heights .person { fill: var(--copper); }
.heights .person-label { fill: var(--copper); font: 600 11px var(--body); }

/* tree page: single-tree scale figure */
.scale-fig svg { width: 100%; height: auto; display: block; }
.scale-fig .crown { fill: var(--sage); opacity: .55; }
.scale-fig .trunk { fill: #7a5a3a; }
.scale-fig .person { fill: var(--copper); }
.scale-fig .dim { stroke: var(--gold); stroke-width: 1; }
.scale-fig text { fill: var(--parchment-soft); font: 500 11px var(--body); }
.scale-fig text.big { fill: var(--gold-soft); font: italic 500 18px var(--display); }
.scale-fig .ground { stroke: var(--line-strong); }

/* canopy footprint */
.canopy svg { width: 100%; height: auto; }
.canopy .shade { fill: var(--sage); fill-opacity: .14; stroke: var(--sage); stroke-dasharray: 3 5; }
.canopy .trunk-dot { fill: var(--copper); }
.canopy text { fill: var(--parchment-soft); font: 500 11px var(--body); }
.canopy text.big { fill: var(--gold-soft); font: italic 500 18px var(--display); }

/* witness timeline */
.witness { position: relative; padding-block: var(--s6) var(--s4); }
.witness .track { position: relative; height: 4px; border-radius: 4px; background: var(--moss); margin-block: 140px 140px; }
.witness .life { position: absolute; inset-block: 0; inset-inline-end: 0; border-radius: 4px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); width: 0; transition: width 2.2s var(--ease); }
html[dir="rtl"] .witness .life { background: linear-gradient(270deg, var(--gold-deep), var(--gold-soft)); }
.witness.in .life { width: var(--w); }
.witness .ev { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: var(--night); border: 2px solid var(--gold); }
html[dir="rtl"] .witness .ev { transform: translate(50%, -50%); }
.witness .ev span { position: absolute; left: 50%; transform: translateX(-50%); width: max-content; max-width: 150px; text-align: center; font-size: .75rem; line-height: 1.35; color: var(--parchment-soft); }
.witness .ev span b { display: block; font: italic 600 1.05rem var(--display); color: var(--gold-soft); }
.witness .ev span.up { bottom: calc(22px + var(--lv, 0) * 46px); }
.witness .ev span.down { top: calc(22px + var(--lv, 0) * 46px); }
.witness .ev span::before { content: ""; position: absolute; left: 50%; width: 1px; background: var(--line-strong); height: calc(var(--lv, 0) * 46px); }
.witness .ev span.up::before { top: 100%; }
.witness .ev span.down::before { bottom: 100%; }
.witness .ev.root { background: var(--copper); border-color: var(--copper); width: 20px; height: 20px; }
.witness .ev.now { background: var(--sage); border-color: var(--sage); }
.witness .ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
@media (max-width: 640px) { .witness .ev span { max-width: 92px; font-size: .68rem; } }

/* age rings panel animation */
.age-rings svg path { stroke-dasharray: 900; stroke-dashoffset: 900; transition: stroke-dashoffset 2s var(--ease); transition-delay: calc(var(--i) * 40ms); }
.age-rings.in svg path { stroke-dashoffset: 0; }

html[lang="ar"] .heights .silhouette text.h, html[lang="ar"] .scale-fig text.big, html[lang="ar"] .canopy text.big, html[lang="ar"] .witness .ev span b { font-style: normal; }
.hero-media .hero-fallback-tree { position: absolute; inset: 12% 0 0 30%; width: 70%; height: 88%; opacity: .7; }
.heights { border-bottom: 0; }
.heights .silhouette image { transition: transform .4s var(--ease), filter .3s; transform-box: fill-box; transform-origin: bottom center; filter: saturate(.85) brightness(.95); }
.heights .silhouette:hover image, .heights .silhouette:focus-visible image { transform: scale(1.05); filter: none; }
.heights .silhouette text { font-size: 13px; }
.heights .silhouette text.h { font-size: 17px; }
.heights .grid-label { font-size: 13px; }
.heights .person-label { font-size: 13px; }
@media (max-width: 700px) { .heights .silhouette text:not(.h) { display: none; } }
.heights-fit svg { overflow: hidden; }

/* loupe over the person in the heights chart */
.heights .loupe-bg { fill: #1f2b25; }
.heights .loupe-ring { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.heights .loupe-lead { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.heights .loupe-ground { stroke: var(--line-strong); stroke-width: 1.5; }
.heights .loupe-x { fill: var(--night); font: 700 11px var(--body); paint-order: stroke; stroke: var(--gold); stroke-width: 14px; stroke-linejoin: round; }
