/* Carapace Risk home page (index.html). Harbor tokens come from site.css.
   Seven parts: the hero, what you can do with it, the renewal map, the sourced figures, the renewal step by step,
   a figure followed to its file, the user group.
   The map: one connected line from your files to the price. Everything in the map is sized in em,
   so the whole picture shrinks with its container instead of stacking early.
   Colours on navy use the dark-surface status values from docs/design/tokens.json. */

/* scale */
[data-page="index"] section.blk{padding-block:84px}
[data-page="index"] .sh{gap:12px;max-width:720px;margin-bottom:36px}
.does h2{font:800 clamp(26px,2.9vw,36px)/1.1 var(--sans);letter-spacing:-.03em}
.does-p{font-size:16.5px;color:var(--muted)}

/* hero */
.hero.home{background:var(--deep);padding-bottom:64px}
.hero.home .wrap{padding-block:56px 0}
.intro{max-width:760px;margin:0 auto;text-align:center}
.hero.home h1{margin:0;font-size:clamp(32px,4.2vw,52px);line-height:1.04;letter-spacing:-.035em}
.hero.home .lede{max-width:60ch;margin:18px auto 0;font-size:17px;line-height:1.6}
.hero.home .ctas{justify-content:center;margin-top:26px}
.hero.home .intro>.hero-note{margin-top:12px;font-size:13.5px;color:#C9D4E2;animation-delay:.18s}

/* what you can do with it: five cards (the shared .fact card), three across and then two */
.uses{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:20px}
.uses .fact{grid-column:span 2}
.uses .fact:nth-child(n+4){grid-column:span 3}
.uses .fact h3{font-size:18px}

/* the renewal section opens on Deep Navy, with the headline that used to open the page above the map */
.renewal{background:var(--deep);color:#fff;padding-block:72px 64px;overflow-x:clip}
.renewal ::selection{background:#fff;color:var(--deep)}
.renewal h2{font:800 clamp(26px,2.9vw,36px)/1.1 var(--sans);letter-spacing:-.03em}
.renewal .lede{max-width:60ch;margin:14px auto 0;font-size:17px;line-height:1.6;color:#C9D4E2}

/* the map: three states. Sent as it is (red), being checked (amber), checked (green). */
.map{--up:var(--mist);--down:#6FBF97;container-type:inline-size;margin:44px 0 0}
.map.s-without{--down:#E7837B}
.map.s-with:not(.verified){--down:#E0A64B}
.map-stage{display:flex;flex-direction:column;padding:16px 24px 20px;border:1px solid rgba(255,255,255,.09);border-radius:24px;background:rgba(255,255,255,.025)}
.map-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.seg{display:none;gap:2px;padding:3px;border-radius:999px;background:rgba(255,255,255,.08)}
.map.in .seg{display:inline-flex}
.seg button{height:32px;padding:0 14px;border:0;border-radius:999px;background:none;color:#C9D4E2;font:600 13px/1 var(--sans);cursor:pointer;transition:background-color .25s,color .25s}
.seg button:hover{color:#fff}
.seg button[aria-pressed="true"]{background:#fff;color:var(--deep)}
.map-pp{display:none;place-items:center;width:32px;height:32px;padding:0;border-radius:50%;border:1px solid rgba(255,255,255,.3);background:none;color:#fff;cursor:pointer}
.map.in .map-pp{display:grid}
.map-pp svg{width:13px;height:13px;fill:currentColor}
.map-pp .i-play,.map-pp[aria-pressed="true"] .i-pause{display:none}
.map-pp[aria-pressed="true"] .i-play{display:block}
.map-note{margin-left:auto;font-size:12.5px;color:var(--band-muted)}
.map-say{min-height:3em;margin-top:18px;padding-top:14px;border-top:1px solid rgba(255,255,255,.09);font-size:14px;line-height:1.5;color:#DCE6F2}

/* the first column is wide enough for a file name; minmax(0,..) lets a long name shorten instead of
   pushing its chip over the gap, so the line to the check always has room to show */
.map-grid{position:relative;display:grid;font-size:clamp(11.5px,1.2cqw,13px);grid-template-columns:19em minmax(0,1.45fr) minmax(0,1fr) 13.5em;grid-template-rows:auto 1fr;grid-template-areas:"c1 c2 c3 c4" "files checks pack market";column-gap:3.6em;row-gap:.8em}
.map-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.cap{font:600 .95em/1.2 var(--sans);color:var(--band-muted);transition:opacity .5s .2s}
.c1{grid-area:c1}.c2{grid-area:c2}.c3{grid-area:c3}.c4{grid-area:c4}
.files{grid-area:files}.checks{grid-area:checks}.pack{grid-area:pack}.market{grid-area:market}
.stn{align-self:center;min-width:0}

/* nodes sit above the connector lines; they arrive one after another on load */
.node{position:relative;z-index:1;transition:opacity .5s var(--ease) var(--d,0ms),transform .6s var(--ease) var(--d,0ms),background-color .5s,border-color .5s}
.map.pre .node{opacity:0;transform:translateY(-12px);transition:none}
.map.pre .cap{opacity:0;transition:none}

.files{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.55em}
.file{display:flex;align-items:center;gap:.65em;min-width:0;height:2.9em;padding:0 .9em;border-radius:.85em;background:var(--navy);border:1px solid rgba(255,255,255,.1);font-weight:600;line-height:1;color:#fff}
.file svg.i{width:1.2em;height:1.2em;color:var(--mist)}
.file .nm{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:.96em;line-height:1.3}
.file .tick{margin-left:auto;flex:none;display:grid;place-items:center;width:1.35em;height:1.35em;border-radius:50%;background:var(--ok-t);color:var(--ok);opacity:0;transform:scale(.4);transition:opacity .3s,transform .35s var(--ease)}
.file .tick svg{width:.8em;height:.8em;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.file.done .tick{opacity:1;transform:none}
.file.hit{border-color:rgba(255,255,255,.65)}

.card{display:grid;gap:.7em;padding:1.15em;border-radius:1.3em;background:var(--navy);border:1px solid rgba(255,255,255,.1);color:#fff}
.card-h{font-weight:700;font-size:1.08em;line-height:1.3}
.card-f{font-size:.95em;line-height:1.45;color:var(--band-muted)}
.rows{list-style:none;margin:0;padding:0}
.row{display:flex;align-items:center;justify-content:space-between;gap:.9em;padding:.7em 0;border-top:1px solid rgba(255,255,255,.09)}
.row:last-child{border-bottom:1px solid rgba(255,255,255,.09)}
.row b{display:block;font-weight:600;line-height:1.35}
.row .srcl{display:block;margin-top:.15em;font-size:.88em;line-height:1.35;color:var(--band-muted)}
.map.s-without .checks{background:transparent;border-style:dashed;border-color:rgba(255,255,255,.32)}
.map .badge{flex:none;justify-self:start;gap:.45em;height:1.8em;padding:0 .75em;font-size:.92em}
.map .badge::before{width:.45em;height:.45em}
.badge.pop{animation:pop .4s var(--ease)}
@keyframes pop{from{transform:scale(.7);opacity:.2}to{transform:none;opacity:1}}

.pack .big{display:flex;align-items:baseline;flex-wrap:wrap;gap:.1em .16em;font-weight:800;font-size:3.1em;line-height:1;letter-spacing:-.04em}
.pack .big small{font-weight:600;font-size:.31em;line-height:1.25;letter-spacing:0;color:var(--band-muted)}
.market{display:grid;gap:2.2em}
.broker{display:flex;align-items:center;justify-content:center;height:3.1em;border-radius:999px;background:var(--navy);border:1px solid rgba(255,255,255,.1);font-weight:600;line-height:1;color:#fff}
.uw-line{line-height:1.45;color:#DCE6F2}

/* connectors: a thin line, with dots drifting along it in the direction the data moves */
.map-lines .ln{fill:none;stroke:rgba(255,255,255,.2);stroke-width:1.5;stroke-dasharray:var(--len) var(--len);stroke-dashoffset:0;transition:stroke-dashoffset 1s var(--ease) .5s}
.map.pre .map-lines .ln{stroke-dashoffset:var(--len);transition:none}
.map.drawn .map-lines .ln{stroke-dasharray:none;transition:stroke .3s}
.map.drawn .map-lines .ln.hot{stroke:rgba(255,255,255,.8)}
.map-lines .fl{fill:none;stroke-width:4.5;stroke-linecap:round;stroke-dasharray:.01 24;opacity:0;transition:opacity .6s,stroke .6s;animation:flow 1.4s linear infinite}
.map-lines .fl.a{stroke:var(--up)}
.map-lines .fl.b{stroke:var(--down)}
.map.flowing .map-lines .fl{opacity:1}
.map.paused .map-lines .fl,.map.off .map-lines .fl{animation-play-state:paused}
@keyframes flow{to{stroke-dashoffset:-24.01}}

/* narrower containers (a side pane, a tablet): two rows of two, so the whole chain from files to price
   fits one screen. The sentence that says how it ends moves above the picture, where it is read first. */
@container (max-width:959px){
  .map-say{order:1;min-height:0;margin:0 0 16px;padding:0 0 14px;border-top:0;border-bottom:1px solid rgba(255,255,255,.09)}
  .map-grid{order:2;font-size:12px;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);grid-template-rows:none;grid-template-areas:"c1 c2" "files checks" "c3 c4" "pack market";column-gap:2.6em;row-gap:0}
  .map-bar{margin-bottom:14px}
  .cap{margin:1.5em 0 .6em}
  .cap.c1,.cap.c2{margin-top:0}
  .stn{align-self:start}
  .files{align-self:center}
  .market{gap:1.3em}
  .card{gap:.55em;padding:1em}
  .row{padding:.55em 0}
}
@container (max-width:519px){
  .map-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"c1" "files" "c2" "checks" "c3" "pack" "c4" "market"}
  .cap.c2{margin-top:1.5em}
  .files{align-self:start}
}

/* what it does: four steps that open, beside the screen each one is about */
.does{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:56px;align-items:start}
.does-p{margin-top:12px}
.acc{margin-top:26px;border-top:1px solid var(--line)}
.acc details{border-bottom:1px solid var(--line)}
.acc summary{display:flex;align-items:center;gap:14px;padding:15px 0;cursor:pointer;list-style:none;font:700 16.5px/1.3 var(--sans)}
.acc summary::-webkit-details-marker{display:none}
.acc summary::after{content:"+";margin-left:auto;font-weight:500;color:var(--muted)}
.acc details[open] summary::after{content:"\2212"}
.acc .n{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--line-strong);font:700 13px/1 var(--sans);color:var(--muted);transition:background-color .25s,border-color .25s,color .25s}
.acc details[open] .n{background:var(--navy);border-color:var(--navy);color:#fff}
.acc .d{display:grid;gap:10px;padding:0 0 18px 42px}
.acc .d p{font-size:15px;color:var(--muted)}
.acc .d .lnk{display:flex;gap:6px 18px;flex-wrap:wrap;font-weight:600;font-size:14.5px}
.acc .lnk a{color:var(--navy)}
/* the frame holds the wide run-through and one still per step; only the layer marked .on shows */
.shot .shots{position:relative;aspect-ratio:1600/1000;background:#fff}
.shot .shots>img,.shot .shots>.walk{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:top left;opacity:0;visibility:hidden;transition:opacity .35s ease,visibility 0s .35s}
.shot .shots>.on{opacity:1;visibility:visible;transition:opacity .35s ease,visibility 0s}
.does .shot{box-shadow:var(--shadow)}
/* Enlarge button for the step stills (zoom.js adds it; the run-through has its own in its bar) */
.shots-zoom{position:absolute;right:10px;bottom:10px;z-index:2;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border:0;border-radius:999px;background:var(--deep);color:#fff;font:600 12.5px/1 var(--sans);cursor:zoom-in;opacity:0;transform:translateY(4px);transition:opacity .15s ease-out,transform .15s ease-out}
.shots-zoom[hidden]{display:none}
.shots-zoom svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.shot:hover .shots-zoom,.shots-zoom:focus-visible{opacity:1;transform:none}
.shot .shots>img.on{cursor:zoom-in}
.next{display:flex;align-items:flex-start;gap:10px;margin-top:18px;font-size:14.5px;color:var(--muted)}
.next .status{flex:none;margin-top:1px}
.next a{color:var(--navy);font-weight:600}
.shot-bar b{font-weight:600;color:var(--ink)}

/* facts: each figure opens with its source line, the way the product shows a file and row */
.cites{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.stat.cite{gap:10px;padding:20px 22px;border:1px solid var(--line);border-radius:18px;background:#fff}
.stat.cite::before{display:none}
.by{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.45;color:var(--muted)}
.by svg{flex:none;width:14px;height:14px;margin-top:2px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.by b{font-weight:600;color:var(--ink)}
.stat.cite .big{margin-top:8px;font-size:40px}
.stat.cite h3{font:700 16.5px/1.3 var(--sans)}
.stat.cite p{font-size:14.5px;color:var(--muted)}
.stat.cite .lim{padding-top:10px;border-top:1px solid var(--line-soft);font-size:13px}
.lim b{margin-right:6px;font-weight:600;color:var(--ink)}
.ref{align-self:flex-start;margin-top:auto;font:600 13px/1.3 var(--sans);color:var(--navy)}
.example.slim{grid-template-columns:1.5fr 1fr;align-items:center;gap:32px;margin:0 0 20px;padding:22px 24px;border-radius:18px}
.example.slim .ex-h{margin-top:8px;font:700 18px/1.3 var(--sans);letter-spacing:-.01em}
.example.slim .ex-t{margin-top:10px;font-size:15.5px;line-height:1.55;color:var(--ink)}
.example.slim .by{margin-top:10px}
.ex-n{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.ex-n div{display:grid;gap:6px;align-content:start}
.ex-n b{font:800 28px/1 var(--sans);letter-spacing:-.03em}
.ex-n span{font-size:13px;line-height:1.35;color:var(--muted)}
.refs{margin-top:28px;padding-top:22px;border-top:1px solid var(--line)}
.refs h3{font:700 15px/1.3 var(--sans);color:var(--ink)}
.refs ol{gap:2px}
.refs li{margin-left:-8px;padding:5px 8px;border-radius:8px;transition:background-color .3s}
.refs li:target{background:var(--navy-t);color:var(--ink)}
.refs a{color:var(--navy);font-weight:600}

/* a figure followed to its file: the panel itself is styled in assets/trace.css */
.trace-slot{max-width:920px}
.trace-fallback{max-width:70ch;font-size:16px;color:var(--muted)}

@media (max-width:1000px){
  .uses{grid-template-columns:minmax(0,1fr)}
  .uses .fact,.uses .fact:nth-child(n+4){grid-column:auto}
}
@media (max-width:1040px){
  .does{grid-template-columns:minmax(0,1fr);gap:28px}
  .cites{grid-template-columns:minmax(0,1fr)}
  .example.slim{grid-template-columns:minmax(0,1fr);gap:18px}
}
@media (max-width:720px){
  [data-page="index"] section.blk{padding-block:60px}
  .hero.home{padding-bottom:48px}
  .hero.home .wrap{padding-block:32px 0}
  .hero.home .lede{margin-top:14px;font-size:16px}
  .hero.home .ctas{margin-top:20px}
  .renewal{padding-block:52px 48px}
  .renewal .lede{font-size:16px}
  .map{margin-top:26px}
  .map-stage{padding:14px 14px 16px;border-radius:18px}
  .acc .d{padding-left:0}
}
@media (max-width:560px){
  .map-note{margin-left:0;flex-basis:100%}
}
/* touch screens: the map's controls, the Enlarge button and the standalone text links meet the 44px target size */
@media (pointer:coarse){
  .seg button{height:44px;padding:0 16px}
  .map-pp{width:44px;height:44px}
  .shots-zoom{height:44px;padding:0 16px;opacity:1;transform:none}
  .ref,.acc .lnk a{display:inline-flex;align-items:center;min-height:44px}
  .acc .d .lnk{row-gap:0}
}
@media (prefers-reduced-motion:reduce){
  .map-lines .fl{display:none}
  .map.in .map-pp{display:none}
}
