/* oak.css: the drawn parts of every Oak & Beech illustration (oak.js builds them). */
:root {
  --soil: color-mix(in oklab, var(--p-surface) 70%, #8a6a44 30%);
  --bark: color-mix(in oklab, var(--p-ink) 88%, #6b4a2a);
  --root: color-mix(in oklab, var(--p-ink) 62%, #8a6a44);
  --leaf-0: color-mix(in oklab, var(--p-accent) 78%, #10180c);
  --leaf-1: var(--p-accent);
  --leaf-2: color-mix(in oklab, var(--p-accent) 62%, #b7bf72);
  --spark: #c9d48f;
}

.ill, .hero-oak { display: block; overflow: visible; }

/* ---- the drawing: strokes draw, shapes open, the trunk and bars rise, washes fade */
[data-draw] .ln { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--t, 1s) cubic-bezier(.65, 0, .25, 1) var(--d, 0s), opacity 0s linear var(--d, 0s); }
[data-draw] .pop { transform-box: fill-box; transform-origin: center;
  transition: transform var(--t, .6s) cubic-bezier(.3, 1.45, .5, 1) var(--d, 0s), opacity .25s ease var(--d, 0s); }
[data-draw] .grow { transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform var(--t, .8s) cubic-bezier(.3, 1.2, .4, 1) var(--d, 0s); }
[data-draw] .fade { transition: opacity var(--t, .8s) ease var(--d, 0s); }

.ob-js [data-draw]:not(.is-drawn) .ln { stroke-dashoffset: 1; opacity: 0; }
.ob-js [data-draw]:not(.is-drawn) .pop { transform: scale(0); opacity: 0; }
.ob-js [data-draw]:not(.is-drawn) .grow { transform: scaleY(0); }
.ob-js [data-draw]:not(.is-drawn) .fade { opacity: 0; }
[data-draw].no-t .ln, [data-draw].no-t .pop, [data-draw].no-t .grow, [data-draw].no-t .fade { transition: none !important; }
.ob-safe [data-draw] .ln { stroke-dashoffset: 0; opacity: 1; }
.ob-safe [data-draw] .pop, .ob-safe [data-draw] .grow { transform: none; opacity: 1; }
.ob-safe [data-draw] .fade { opacity: 1; }
.ln:not([data-draw] .ln) { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the palette of the drawings */
.ink { stroke: var(--p-ink); }
.soft { stroke: color-mix(in oklab, var(--p-ink) 14%, transparent); }
.soft-ink { stroke: color-mix(in oklab, var(--p-ink) 38%, transparent); }
.dash { stroke: color-mix(in oklab, var(--p-ink) 40%, transparent); stroke-dasharray: .03 .03; }
[data-draw].is-drawn .dash { stroke-dasharray: .03 .03; }
.dot { fill: var(--p-accent); }
.node-o { fill: var(--p-bg); stroke: var(--p-ink); stroke-width: 2; }
.node-box { fill: var(--p-bg); stroke: var(--p-ink); stroke-width: 1.8; }
.page-box { fill: var(--p-bg); stroke: var(--p-ink); stroke-width: 1.6; }
.stem { stroke: var(--bark); }
.root { stroke: var(--root); }
.ring { stroke: var(--root); }
.ring--late { stroke: color-mix(in oklab, var(--root) 80%, var(--p-ink)); }
.ring--bark { stroke: var(--bark); }
.check { stroke: color-mix(in oklab, var(--root) 60%, transparent); }
.bar { fill: var(--p-accent); }
.bar:nth-of-type(even) { fill: var(--leaf-2); }
.trend { stroke: var(--p-ink); stroke-dasharray: .02 .025; }
[data-draw].is-drawn .trend { stroke-dasharray: 1 1; }
.grid { stroke: color-mix(in oklab, var(--p-ink) 32%, transparent); }
.cell { fill: color-mix(in oklab, var(--p-accent) 55%, transparent); }
.ground { stroke: color-mix(in oklab, var(--p-ink) 55%, transparent); stroke-width: 2; fill: none; }
.soil { fill: var(--soil); }
.strata { fill: none; stroke: var(--p-ink); stroke-opacity: .08; stroke-width: 1.2; stroke-dasharray: 2 7; }
.grass { fill: none; stroke: var(--p-accent); stroke-width: 1.6; stroke-linecap: round; stroke-opacity: .7; }
.hill { stroke: color-mix(in oklab, var(--p-ink) 22%, transparent); stroke-width: 1.6; }
.hill--far { stroke: color-mix(in oklab, var(--p-ink) 12%, transparent); }
.leaf.t0 { fill: var(--leaf-0); } .leaf.t1 { fill: var(--leaf-1); } .leaf.t2 { fill: var(--leaf-2); }
.acorn { fill: #8a6a3c; } .acorn path { fill: var(--bark); }
.oak-trunk { fill: var(--bark); }
.oak-limb { stroke: var(--bark); }
.acorn-body { fill: #a07a45; }
.acorn-cap { fill: var(--bark); }
.cap-lines { stroke: color-mix(in oklab, var(--p-bg) 40%, transparent); }
.shine { stroke: color-mix(in oklab, var(--p-bg) 55%, transparent); }
.node__ring { fill: var(--p-bg); stroke: var(--p-accent); stroke-width: 2; }
.node__dot { fill: var(--p-accent); }
.node__label { font: 500 14px/1 var(--font-text); fill: var(--p-ink); letter-spacing: .01em; }
.pulse { fill: var(--spark); stroke: var(--p-accent); stroke-width: 1.2; }

/* ---- loops: a drawing's own motion, only while the pointer is on its card (and never under reduced motion) */
.flow { fill: none; stroke: var(--spark); stroke-width: 4; stroke-linecap: round; stroke-dasharray: .07 .93; stroke-dashoffset: 1; opacity: 0; }
[data-draw-hover]:hover .flow { opacity: 1; animation: ob-flow 2.8s linear infinite; }
.flow--slow { stroke-dasharray: .05 .95; }
@keyframes ob-flow { to { stroke-dashoffset: 0; } }
.sprig { transform-box: fill-box; transform-origin: 0 50%; }
[data-draw-hover]:hover .sprig--l { animation: ob-sprig 3s ease-in-out infinite; }
[data-draw-hover]:hover .sprig--r { animation: ob-sprig 3s ease-in-out .4s infinite reverse; }
@keyframes ob-sprig { 50% { transform: rotate(-9deg); } }
.page { transition: transform 600ms cubic-bezier(.2, .9, .3, 1); transform-box: view-box; }
[data-draw-hover]:hover .page--0 { transform: translate(-22px, 8px) rotate(-4deg); }
[data-draw-hover]:hover .page--2 { transform: translate(20px, -6px) rotate(3deg); }
.sway-acorn { transform-box: fill-box; transform-origin: 50% 100%; }
[data-draw-hover]:hover .sway-acorn { animation: ob-rock 3s ease-in-out infinite; }
@keyframes ob-rock { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

/* ---- the hero's ambient motion: the crown sways, leaves fall now and then (the pause button stops both) */
.hero-oak .oak-canopy { animation: ob-sway 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes ob-sway { from { transform: rotate(-.7deg) translateX(-2px); } to { transform: rotate(.7deg) translateX(2px); } }
.fall { opacity: 0; animation-name: ob-fall; animation-timing-function: cubic-bezier(.4, .1, .6, .9); animation-iteration-count: infinite; animation-fill-mode: both; }
@keyframes ob-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  6% { opacity: .95; }
  30% { transform: translate(calc(var(--fx) * .35), calc(var(--fy) * .3)) rotate(140deg); }
  60% { transform: translate(calc(var(--fx) * -.1), calc(var(--fy) * .65)) rotate(260deg); }
  88% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(380deg); }
}
.fall { transform-box: fill-box; transform-origin: center; }
.ob-paused .hero-oak *, .ob-still .hero-oak * { animation-play-state: paused !important; }
.ob-still .fall { display: none; }
.ob-still .pulses { display: none; }

@media (prefers-reduced-motion: reduce) {
  [data-draw] .ln, [data-draw] .pop, [data-draw] .grow, [data-draw] .fade, .page { transition: none !important; }
  .flow, .fall, .pulses { display: none; }
  .hero-oak .sway > *, [data-draw-hover]:hover * { animation: none !important; }
}
