/* Film grain over the whole page. One fixed layer of SVG fractal noise,
   multiplied over the warm ground so it reads as paper tooth rather than
   a grey wash. It never intercepts clicks. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.082;
  /* No mix-blend-mode: a blended full-viewport layer forces the browser to
     re-composite the entire page underneath it on every single frame, which
     is what made scrolling feel heavy. Instead the turbulence is reduced to
     pure black at a sparse alpha (feColorMatrix zeroes RGB and keeps the
     shaped alpha), so painting it normally darkens exactly the way multiply
     did - measured to within a pixel level on cream, card and honey, and
     still invisible over the dark footer. */
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feComponentTransfer><funcA type='linear' slope='6' intercept='-3.4'/></feComponentTransfer><feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  /* One tile, rasterised once and repeated, instead of one rect stretched
     over four viewports' worth of area. Own layer, so it never repaints. */
  background-size: 180px 180px;
  transform: translateZ(0);
}

/* ---- Page container ---------------------------------------------------
   One gutter and one content rail for the whole page. Section bands stay
   full-bleed so their colour still runs edge to edge; everything *inside*
   a band sits on `.shell`, and that is what makes the copy and card edges
   line up from the nav all the way down to the footer. Change --rail here
   and the whole page follows. */
:root { --rail: 1280px; }
.shell { width: 100%; max-width: var(--rail); margin-inline: auto; }

/* Lucide icons are stroke-drawn: without these they render as black fills. */
.icon { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.icon-brand { fill: currentColor; stroke: none; }

/* Hero doodles - the pen marks in the notebook margin around the headline.
   Three jobs, three wrappers, so no two of them ever fight over `transform`:
   the pointer drift lives on the outer [data-drift], the entry tween on the
   [data-enter] inside it, and the idle float on the innermost `.prop`. Each
   drift layer travels its own distance; that difference is the depth. */
.prop-layer { transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes prop-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, var(--rise, -12px), 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .prop { animation: prop-float var(--dur, 8s) ease-in-out var(--delay, 0s) infinite; }
}

/* A CSS animation set to `infinite` keeps asking the compositor for frames
   even after it has scrolled out of view, so the hero's doodles and the team
   wall's drifting columns go on costing the whole page for their entire
   life. `.is-still` is switched on by an observer once a section is off
   screen, and off again before it comes back. */
.is-still .prop,
.is-still .bee-wing, .is-still .hero-bee svg { animation-play-state: paused; }

/* The marked word. The honey block sits behind the glyphs on its own span,
   so the motion layer can wipe it in while the letters flick up on top.
   Sized in em off the headline, so it tracks the type at every width. */
.hl-pill {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding-inline: 0.16em 0.2em;
}
.hl-pill-bg {
  position: absolute;
  inset: 0.06em 0 -0.1em;
  z-index: -1;
  border-radius: 0.2em;
  background-image: linear-gradient(135deg, #FFC24D 0%, #F5A521 62%, #E8931A 100%);
  box-shadow: 0 0.16em 0.4em -0.2em rgba(138, 101, 8, 0.55);
}

/* Its wingbeat. Each wing sits in its own <g> so the flap doesn't
   overwrite the rotate() already on the ellipse, and pivots on its root,
   which is just inside the body so the joint never shows. One cycle holds
   seven beats of uneven height, so the loop reads as a live buzz rather
   than a metronome, and the front wing trails the back by a hair. The
   body gets a quicker, smaller hover on top of the slow `.prop` float
   the other doodles share - a couple of pixels, no more. */
.bee-wing { transform-box: view-box; }
.bee-wing--back  { --tilt: -13deg; transform-origin: 49px 56px; }
.bee-wing--front { --tilt: 10deg;  transform-origin: 56px 53px; }
@keyframes bee-flap {
  0%, 14%, 28.5%, 42.5%, 57%, 71.5%, 86%, 100% { transform: rotate(0deg) scaleY(1); }
  7%    { transform: rotate(var(--tilt)) scaleY(0.82); }
  21.5% { transform: rotate(calc(var(--tilt) * 0.75)) scaleY(0.87); }
  35.5% { transform: rotate(calc(var(--tilt) * 0.95)) scaleY(0.83); }
  50%   { transform: rotate(calc(var(--tilt) * 0.6)) scaleY(0.9); }
  64%   { transform: rotate(var(--tilt)) scaleY(0.8); }
  78.5% { transform: rotate(calc(var(--tilt) * 0.8)) scaleY(0.86); }
  93%   { transform: rotate(calc(var(--tilt) * 0.9)) scaleY(0.84); }
}
@keyframes bee-hover {
  0%, 100% { transform: translate3d(0, 0, 0); }
  28%      { transform: translate3d(0, -2.4%, 0); }
  52%      { transform: translate3d(0, 0.6%, 0); }
  76%      { transform: translate3d(0, -1.4%, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .bee-wing { animation: bee-flap 1.05s ease-in-out infinite; }
  .bee-wing--front { animation-delay: -0.03s; }
  .hero-bee svg { animation: bee-hover 1.7s ease-in-out infinite; }
}

/* ---- Motion layer (js/motion.js) --------------------------------------
   Nothing here animates on its own. These are the states the page holds
   *before* the motion layer boots, plus the two pieces of structure GSAP
   cannot express in a tween: the word clipping box and the wipe panels.
   `html.motion-ready` is added the moment motion.js has built its tweens
   (or decided not to), and every pre-state below is scoped to its absence,
   so a blocked CDN or reduced-motion preference leaves a plain page. */

html:not(.motion-ready) [data-reveal],
html:not(.motion-ready) [data-enter],
html:not(.motion-ready) [data-reveal-group] > * { opacity: 0; }
html:not(.motion-ready) [data-reveal="clip"] { opacity: 1; clip-path: inset(46% 8% 46% 8% round 36px); }

/* Type splitting. A word stays one unit so lines still break on spaces,
   and the characters inside it are what actually move. No clipping box:
   each glyph rotates as it rises, and a mask would shear the corners. */
.rv-w { display: inline-block; white-space: nowrap; }

/* One clipping box per word, split further into characters. Each glyph
   pivots about a point near its own baseline (50% 90%) as it rises, which
   is what gives the reveal its flick rather than a flat slide. */
.rv-c { display: inline-block; transform-origin: 50% 90%; }
/* will-change only while a heading is actually typing. Left on permanently
   it hands every single glyph on the page its own compositor layer, which
   costs memory and slows every frame for motion that has already finished.
   motion.js adds .is-typing for the length of the tween and takes it off. */
.is-typing .rv-c { will-change: transform, opacity; }

/* The curtain covers the viewport from first paint. Its path is drawn at
   the covered position so there is no flash of page before motion.js
   takes over; the failsafe below hides the whole layer if it never does. */
#curtain { display: block; }

/* Sticker eyebrows - the rotated, offset-shadowed label CRAV uses to tag a
   section. Kept to honey on ink so it reads as a label, not a callout. */
.sticker {
  display: inline-block;
  transform: rotate(-2.5deg);
  border-radius: 999px;
  background: #FFFFFF;
  padding: 0.3rem 0.85rem;
  box-shadow: 2px 2px 0 rgba(20, 20, 15, 0.82);
}


/* Footer. Links sit at cream on the ink sheet and warm to honey on hover;
   keyboard focus gets its own honey ring, since the hover shift alone is
   too quiet to find on a dark ground. */
.footer-link {
  color: rgba(253, 252, 247, 0.78);
  text-decoration: none;
  width: fit-content;
  border-radius: 6px;
  transition: color 0.2s ease;
}
.footer-link:hover { color: #FFC24D; }
.footer-link:focus-visible { outline: 2px solid #FFC24D; outline-offset: 3px; }
/* The comb only shows at the top-right corner and thins out across the
   sheet, so it reads as texture behind the columns, never under the copy. */
.footer-comb {
  -webkit-mask-image: radial-gradient(75% 110% at 100% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
  mask-image: radial-gradient(75% 110% at 100% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
}

/* ---- Nav dropdowns ----------------------------------------------------
   Courses and Resources each gather their links behind one button.
   From `menu` up the list drops as a card under the button; below that,
   inside the Menu sheet, it opens in place as an indented group. The
   button's aria-expanded is the only state - the script flips it and
   everything here reads it. */
.nav-dd { position: relative; }
.nav-dd-link {
  display: block;
  white-space: nowrap;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: #55554B;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav-dd-link:hover,
.nav-dd-link[aria-current="page"] { background: #F2EEE3; color: #14140F; }
/* Current page in the main nav: ink text over a honey bar the width of the label, rather
   than the grey chip that hover already uses. The mobile menu stacks the
   links, so there the bar moves to the left edge over a honey wash. */
#navLinks > li > a[aria-current="page"],
#navLinks > li > button[data-current] { position: relative; color: #14140F; }
#navLinks > li > a[aria-current="page"]::after,
#navLinks > li > button[data-current]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #F5A521;
}
@media (max-width: 1023.98px) {
  #navLinks > li > a[aria-current="page"],
  #navLinks > li > button[data-current] {
    background: linear-gradient(135deg, rgba(255,194,77,0.26) 0%, rgba(245,165,33,0.17) 62%, rgba(232,147,26,0.14) 100%);
  }
  #navLinks > li > a[aria-current="page"]::after,
  #navLinks > li > button[data-current]::after {
    left: 0; right: auto; top: 50%; bottom: auto;
    width: 3px; height: 60%;
    transform: translateY(-50%);
  }
}
@media (min-width: 1024px) {
  .nav-dd-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    min-width: 180px;
    padding: 6px;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(20, 20, 15, 0.05), 0 18px 44px rgba(138, 101, 8, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  /* bridges the gap under the button, so the pointer can cross to the card
     without the group closing on the way */
  .nav-dd-panel::before { content: ''; position: absolute; inset: -10px 0 auto; height: 10px; }
  [aria-expanded="true"] + .nav-dd-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
  }
}
@media (max-width: 1023.98px) {
  .nav-dd-panel { margin: 2px 0 4px 14px; padding-left: 10px; border-left: 2px solid #E9E3D3; }
  [aria-expanded="false"] + .nav-dd-panel { display: none; }
  .nav-dd-link { padding: 10px 14px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-dd-panel { transition: none !important; }
}

/* ---- Menu sheet (below `menu`) ----------------------------------------
   Stays laid out while closed so it can animate: it unrolls downward from
   the bar and the rows follow one after another. On close it rolls back
   up quicker than it came down. The script only toggles .is-open. */
@media (max-width: 1023.98px) {
  #navLinks {
    display: flex;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    clip-path: inset(0 0 100% 0);
    transition: clip-path .32s cubic-bezier(.4,0,.2,1), transform .32s cubic-bezier(.4,0,.2,1), opacity .24s ease .06s, visibility 0s linear .32s;
  }
  #navLinks.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    clip-path: inset(0 -60px -60px -60px);
    transition: clip-path .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1), opacity .2s ease, visibility 0s;
  }
  #navLinks > li { opacity: 0; transform: translateY(-8px); transition: opacity .15s ease, transform .15s ease; }
  #navLinks.is-open > li {
    opacity: 1;
    transform: none;
    transition: opacity .35s ease var(--d, 0s), transform .5s cubic-bezier(.22,1,.36,1) var(--d, 0s);
  }
  #navLinks.is-open > li:nth-child(1) { --d: .06s; }
  #navLinks.is-open > li:nth-child(2) { --d: .1s; }
  #navLinks.is-open > li:nth-child(3) { --d: .14s; }
  #navLinks.is-open > li:nth-child(4) { --d: .18s; }
  #navLinks.is-open > li:nth-child(5) { --d: .22s; }
  #navLinks.is-open > li:nth-child(6) { --d: .26s; }
  #navLinks.is-open > li:nth-child(7) { --d: .3s; }
  #navLinks.is-open > li:nth-child(8) { --d: .34s; }
}
@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce) {
  #navLinks, #navLinks > li { transform: none !important; transition: none !important; }
}


/* Back to top. Held out of sight until the reader is most of a screen down,
   then it rises into the corner. The honey ring fills with how far through
   the page they are - pathLength="1" on the circle makes its dash offset a
   plain 0-1 fraction. Visibility flips at the end of the fade, so a hidden
   button can be neither clicked nor tabbed to. */
.to-top {
  margin-bottom: env(safe-area-inset-bottom);
  opacity: 0;
  visibility: hidden;
  translate: 0 14px;
  scale: 0.9;
  transition: opacity 0.25s ease, translate 0.35s cubic-bezier(0.22, 1, 0.36, 1), scale 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, visibility 0s linear 0.35s;
}
.to-top.is-shown { opacity: 1; visibility: visible; translate: 0 0; scale: 1; transition-delay: 0s; }
.to-top.is-shown:hover { translate: 0 -2px; box-shadow: 0 16px 34px -10px rgba(20,20,15,0.6); }
.to-top-ring { stroke-dasharray: 1; stroke-dashoffset: 1; }
@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top.is-shown, .to-top.is-shown:hover { translate: none; scale: none; }
}

