/* UN Sustainable Development Goals: the ring on the homepage, the planks on About */

/* ═════════ homepage: the ring */
.sdg-sec { padding: clamp(48px, 6vw, 96px) 0 clamp(36px, 4vw, 64px); background: var(--white); overflow: hidden; }
.sdg-head { max-width: 720px; margin: 0 auto clamp(4px, 1.4vw, 16px); text-align: center; }
.sdg-head h2 { font-size: clamp(34px, 4vw, 60px); margin: 0 0 .25em; }
.sdg-head p { margin: 0 auto; max-width: 34em; color: var(--text-2); }
.sdg-more { margin: clamp(10px, 1.6vw, 20px) 0 0; text-align: center; }
.sdg-src, .ab-sdg-src { margin: 14px auto 0; max-width: 46em; text-align: center; font-size: .78em; color: var(--text-2); }
.sdg-src a, .ab-sdg-src a { color: inherit; }

.sdg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); align-items: center; gap: clamp(8px, 2vw, 28px); }
.sdg-side { display: grid; gap: 10px; transition: opacity .3s; }
.sdg-side-d { justify-items: end; text-align: right; align-self: start; padding-top: clamp(30px, 7vw, 110px); }
.sdg-side-s { justify-items: start; align-self: end; padding-bottom: clamp(30px, 7vw, 110px); }
.sdg-pill { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 10px 18px 10px 14px; border-radius: 999px; background: rgba(63,126,68,.1); color: var(--ink); transition: background .2s; }
.sdg-pill b { font: 800 clamp(36px, 3.2vw, 52px)/.8 var(--display); }
.sdg-pill span { font: 700 clamp(15px, 1.2vw, 19px)/1.15 var(--body); max-width: 7.5em; text-align: left; }
.sdg-side:hover .sdg-pill { background: rgba(63,126,68,.18); }
.sdg-side-t { margin: 0; max-width: 13em; color: var(--text-2); font-size: .95em; line-height: 1.4; }

.sdg-stage { position: relative; aspect-ratio: 1; container-type: inline-size; --R: 36.5cqw; --T: 16cqw; margin-block: 9.5%; }   /* room for the flake orbit, so it never sits on text */
.sdg-head, .sdg-more { position: relative; z-index: 1; }
.sdg-flakes { position: absolute; inset: -9%; width: 118%; height: 118%; pointer-events: none; }
/* each group on its own arc: direct on deep green, supporting on warm sand, named along the curve */
.sdg-bands { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sdg-band { fill: none; stroke-width: 22; stroke-linecap: round; transition: stroke .6s ease; }
.sdg-band-d { stroke: rgba(20,64,47,.09); }
.sdg-band-s { stroke: rgba(224,174,54,.17); }
.sdg.grp-d .sdg-band-d, .sdg.pick-d .sdg-band-d { stroke: rgba(20,64,47,.17); }
.sdg.grp-s .sdg-band-s, .sdg.pick-s .sdg-band-s { stroke: rgba(224,174,54,.32); }
.sdg-arc-t { font: 800 3.1px/1 var(--display); letter-spacing: .06px; }
.sdg-arc-td { fill: var(--ink); }
.sdg-arc-ts { fill: #8A6512; }
.sdg-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; flex: none; }
.sdg-side-d .sdg-dot, .sdg-dot-d { background: var(--ink); }
.sdg-side-s .sdg-dot, .sdg-dot-s { border: 2.5px solid #C8961E; }
.sdg-side-s .sdg-pill { background: rgba(224,174,54,.16); color: #6E500C; }
.sdg-side-s:hover .sdg-pill { background: rgba(224,174,54,.28); }
.sdg-mark { display: inline-block; width: .62em; height: .62em; border-radius: 50%; margin-right: .4em; vertical-align: .02em; }
.sdg-li-d .sdg-mark { background: #fff; }
.sdg-li-s .sdg-mark { border: 2px solid #fff; box-sizing: border-box; }
.sdg-key { display: flex; gap: 1.2em; font: 700 1.5cqw/1 var(--body); color: var(--text-2); }
.sdg-key span { display: inline-flex; align-items: center; gap: .45em; }
.sdg-key .sdg-dot { width: 1.25cqw; height: 1.25cqw; }
.sdg-key .sdg-dot-s { border-width: .3cqw; }
.sdg-ring { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.sdg-ring li { position: absolute; left: calc(50% + var(--x) * var(--R)); top: calc(50% + var(--y) * var(--R)); width: var(--T); aspect-ratio: 1; translate: -50% -50%; }

/* a tile: number, our symbol, the goal's name */
.sdg-t { all: unset; box-sizing: border-box; position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; width: 100%; height: 100%; padding: 9% 9% 8%; border-radius: 16%; background: var(--c); color: #fff; cursor: pointer; rotate: var(--tilt); transition: rotate .6s cubic-bezier(.22,.9,.3,1), scale .6s cubic-bezier(.22,.9,.3,1), opacity .5s ease, filter .5s ease; -webkit-tap-highlight-color: transparent; }
.sdg-num { font: 800 4.8cqw/.82 var(--display); }
.sdg-ic { width: 4.6cqw; height: 4.6cqw; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; justify-self: end; }
.sdg-name { grid-column: 1 / -1; align-self: end; font: 700 1.72cqw/1.12 var(--body); letter-spacing: .005em; }
.sdg-t:hover, .sdg-t.on { rotate: 0deg; scale: 1.1; z-index: 2; }
.sdg-t:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.sdg.picking .sdg-t:not(.on), .sdg.grp-d .sdg-t[data-group=s], .sdg.grp-s .sdg-t[data-group=d] { opacity: .5; filter: saturate(.55); }
.sdg.picking .sdg-side { opacity: .5; }

/* the middle: the story, or the picked goal flooding in from its side */
.sdg-hub { position: absolute; left: 50%; top: 50%; width: 45%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: #F3F6F2; display: grid; place-items: center; text-align: center; overflow: hidden; isolation: isolate; }
.sdg-floods { position: absolute; inset: 0; z-index: -1; }
.sdg-flood { position: absolute; inset: 0; background: var(--fc); }
.sdg-hub > div:not(.sdg-floods) { display: grid; justify-items: center; gap: .55em; padding: 0 12%; }
.sdg-hub > div[hidden] { display: none; }
.sdg-hub p { margin: 0; }
.sdg-big { font: 800 13cqw/.78 var(--display); color: var(--ink); }
.sdg-ttl { font: 800 2.9cqw/1 var(--display); color: var(--ink); max-width: 9em; }
.sdg-sub { font-size: 1.9cqw; line-height: 1.35; color: var(--text); max-width: 15em; }
.sdg-hint { font-size: 1.55cqw; color: var(--text-2); }
.sdg-hint-t { display: none; }
@media (hover: none) { .sdg-hint-p { display: none; } .sdg-hint-t { display: inline; } }
.sdg-goal { color: #fff; }
.sdg-g-k { font: 700 1.7cqw/1 var(--body); letter-spacing: .03em; opacity: .85; }
.sdg-g-name { font: 800 4.2cqw/.95 var(--display); max-width: 8.5em; }
.sdg-g-how { font-size: 1.95cqw; line-height: 1.4; max-width: 15em; }
.sdg-g-lvl { font: 700 1.55cqw/1 var(--body); padding: .5em 1em .45em; border-radius: 999px; background: rgba(255,255,255,.2); }
.sdg-goal.in > * { animation: sdg-up .65s cubic-bezier(.22,.9,.3,1) both; animation-delay: .12s; }
.sdg-goal.in > :nth-child(2) { animation-delay: .2s; } .sdg-goal.in > :nth-child(3) { animation-delay: .28s; } .sdg-goal.in > :nth-child(4) { animation-delay: .36s; }
.sdg-intro.in > * { animation: sdg-up .6s .15s cubic-bezier(.22,.9,.3,1) both; }
@keyframes sdg-up { from { opacity: 0; translate: 0 10px; } }
.sdg-note { display: none; }

/* arriving: flakes fly in (canvas) and each tile is pressed into place as they gather */
.sdg.arm:not(.in) .sdg-t, .sdg.arm:not(.in) .sdg-hub > div:not(.sdg-floods) { opacity: 0; }
.sdg.in .sdg-t { animation: sdg-press .9s cubic-bezier(.25,1.15,.4,1) backwards; animation-delay: calc(.9s + var(--k) * 110ms); }
.sdg.arm:not(.in) .sdg-bands { opacity: 0; }
.sdg.in .sdg-bands { transition: opacity 1s .6s ease; }
.sdg.in .sdg-intro { animation: sdg-up .8s 2s cubic-bezier(.22,.9,.3,1) backwards; }
@keyframes sdg-press { from { opacity: 0; scale: 1.35; filter: blur(3px); } 60% { opacity: 1; filter: none; } }

@media (max-width: 1100px) {
  .sdg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sdg-stage { grid-column: 1 / -1; grid-row: 2; width: min(100%, 680px); justify-self: center; }
  .sdg-side-d, .sdg-side-s { align-self: start; justify-items: center; text-align: center; padding: 0; }
  .sdg-side-t { display: none; }
}
/* phones: numbers and symbols on the tiles; the name in the middle, the details underneath */
@media (max-width: 640px) {
  .sdg { gap: 8px; }
  .sdg-pill { padding: 8px 14px 8px 12px; gap: 8px; }
  .sdg-pill b { font-size: 36px; }
  .sdg-pill span { font-size: 14px; }
  .sdg-stage { --R: 35.5cqw; --T: 17.5cqw; margin-block: 7%; }
  .sdg-bands { scale: .973; }
  .sdg-arc-t { display: none; }
  .sdg-key { font-size: 3.1cqw; }
  .sdg-key .sdg-dot { width: 2.6cqw; height: 2.6cqw; }
  .sdg-t { grid-template-rows: 1fr auto; padding: 12%; }
  .sdg-num { font-size: 7.6cqw; }
  .sdg-ic { width: 7.4cqw; height: 7.4cqw; grid-column: 1 / -1; justify-self: start; align-self: end; }
  .sdg-name { display: none; }
  .sdg-hub { width: 43%; }
  .sdg-big { font-size: 15cqw; }
  .sdg-ttl { font-size: 4.2cqw; }
  .sdg-sub { display: none; }
  .sdg-hint { font-size: 3.4cqw; }
  .sdg-g-k { font-size: 3.2cqw; }
  .sdg-g-name { font-size: 5.6cqw; }
  .sdg-hub .sdg-g-how, .sdg-hub .sdg-g-lvl { display: none; }
  .sdg-note { display: grid; grid-column: 1 / -1; justify-items: center; gap: 10px; text-align: center; min-height: 96px; }
  .sdg-note p { margin: 0; max-width: 24em; }
  .sdg-note .sdg-g-how { font-size: 16px; line-height: 1.45; color: var(--text); }
  .sdg-note .sdg-g-lvl { font: 700 13px/1 var(--body); padding: 6px 12px 5px; border-radius: 999px; background: color-mix(in srgb, var(--fc) 16%, #fff); color: color-mix(in srgb, var(--fc) 75%, #000); }
  .sdg-note.in > * { animation: sdg-up .4s cubic-bezier(.2,.8,.2,1) both; }
}
@media (prefers-reduced-motion: reduce) {
  .sdg-t { transition: none; }
  .sdg.in .sdg-t, .sdg.in .sdg-intro, .sdg-goal.in > *, .sdg-intro.in > *, .sdg-note.in > * { animation: none; }
}

/* ═════════ About: the planks. Ten pressed planks of recycled colour; one opens at a time. */
.ab-sdg { padding-top: clamp(44px, 5vw, 84px); padding-bottom: clamp(44px, 5vw, 84px); }
.ab-sdg-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 64px); align-items: end; margin-bottom: clamp(20px, 3vw, 40px); }
.ab-sdg-head .ab-h2 { margin: 0; }
.ab-sdg-lead { margin: 0; color: var(--text-2); max-width: 34em; }
.planks { display: flex; gap: clamp(14px, 2vw, 28px); }
.pl-group { flex: var(--gw, 1) 1 0; min-width: 0; display: grid; gap: 12px; transition: flex-grow .8s cubic-bezier(.25,.8,.25,1); }
.pl-head { margin: 0; display: flex; align-items: baseline; gap: 8px; font: 700 1em/1 var(--body); color: var(--text); }
.pl-head b { font: 800 2em/.8 var(--display); color: #3F7E44; }
.pl-row { display: flex; gap: 8px; height: clamp(290px, 24vw, 350px); }
/* smooth widening: the speckled surface lives on its own fixed-size layer (the plank just reveals more of it),
   the story text has a fixed width (no re-wrapping on every frame) and each plank's layout is contained */
.plank { --grow: 1; flex: var(--grow) 1 0; min-width: 0; position: relative; border-radius: 18px; overflow: hidden; color: #fff; background: var(--c);
  contain: layout paint style; transition: flex-grow .8s cubic-bezier(.25,.8,.25,1); }
.plank::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 680px; background: var(--tex) 0 0 / 180px 180px, linear-gradient(170deg, rgba(255,255,255,.12), rgba(0,0,0,.1)), var(--c); will-change: transform; pointer-events: none; }
.plank::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity .3s; pointer-events: none; }
.plank:not(.open):hover::after { opacity: .07; }
.plank.open { --grow: 5.2; }
.pl-btn { all: unset; box-sizing: border-box; position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 18px; cursor: pointer; }
.pl-btn:focus-visible { outline: 3px solid #fff; outline-offset: -6px; border-radius: 18px; }
.pl-num { font: 800 clamp(34px, 3vw, 46px)/.85 var(--display); }
.pl-ic { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pl-name { margin-top: auto; writing-mode: vertical-rl; rotate: 180deg; font: 700 14px/1.15 var(--body); max-height: clamp(150px, 12vw, 190px); transition: opacity .4s ease; }
/* open: the plank widens, its name lies down and the story appears */
.plank.open .pl-btn { align-items: flex-start; padding: 22px 26px; cursor: default; }
.plank.open .pl-num { font-size: clamp(56px, 5vw, 80px); }
.plank.open .pl-ic { position: absolute; top: 24px; right: 24px; width: 48px; height: 48px; }
.plank.open .pl-name { opacity: 0; }
.pl-body { position: absolute; z-index: 1; left: 26px; width: clamp(230px, 21vw, 320px); bottom: 22px; display: grid; gap: 9px; opacity: 0; translate: 0 14px; pointer-events: none; transition: opacity .3s, translate .3s; }
.plank.open .pl-body { opacity: 1; translate: 0 0; transition: opacity .55s .35s ease, translate .7s .35s cubic-bezier(.22,.9,.3,1); }
.pl-body p { margin: 0; }
.pl-title { font: 800 clamp(24px, 2vw, 32px)/.95 var(--display); max-width: 12em; }
.pl-how { font-size: 1.02em; line-height: 1.45; max-width: 24em; }
.pl-lvl { justify-self: start; font: 700 13px/1 var(--body); padding: 7px 12px 6px; border-radius: 999px; background: rgba(255,255,255,.22); }
/* arriving: planks slide up into the rack one by one, like boards off the press */
.planks.arm:not(.in) .plank { opacity: 0; translate: 0 48px; }
.planks.in .plank { transition: flex-grow .8s cubic-bezier(.25,.8,.25,1), opacity .7s ease, translate 1s cubic-bezier(.22,.9,.3,1); transition-delay: 0s, calc(var(--k) * 90ms), calc(var(--k) * 90ms); }

@media (max-width: 900px) {
  .ab-sdg-head { grid-template-columns: minmax(0, 1fr); }
  .planks { flex-direction: column; }
  .pl-group { flex: none; }
  .pl-row { flex-direction: column; height: auto; }
  .plank { flex: none; min-height: 64px; transition: none; }
  .pl-btn { position: relative; flex-direction: row; gap: 14px; padding: 14px 18px; min-height: 64px; }
  .pl-name { writing-mode: horizontal-tb; rotate: 0deg; margin: 0; white-space: normal; max-height: none; font-size: 16px; }
  .pl-num { width: 1.4em; }
  .plank.open .pl-btn { padding: 18px 18px 6px; align-items: center; }
  .plank.open .pl-num { font-size: 52px; }
  .plank.open .pl-ic { position: static; width: 34px; height: 34px; }
  .plank.open .pl-name { opacity: 1; font: 800 22px/1 var(--display); }
  .pl-body { position: static; width: auto; padding: 0 18px 0; max-height: 0; overflow: hidden; opacity: 0; translate: none; transition: max-height .6s cubic-bezier(.22,.9,.3,1), opacity .4s, padding .6s; }
  .plank.open .pl-body { max-height: 260px; padding: 4px 18px 18px; opacity: 1; transition: max-height .7s cubic-bezier(.22,.9,.3,1), opacity .55s .2s, padding .7s; }
  .pl-title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .plank, .pl-group, .pl-body, .plank.open .pl-body { transition: none !important; }
  .planks.arm:not(.in) .plank { opacity: 1; translate: none; }
}
