/* Rhythm gallery (/recipes/) and rhythm page (/r/). Loaded after site.css, which brings the ocean palette and the type. */
:root{--panel:#0d3543;--well:#06222d;--line:#86a5ad;--on-link:#06242f;--warm:#f0b56a;
  --inhale:#8fe6d6;--full:#f4f1e6;--exhale:#58a9d0;--empty:#9a8fe0;--recovery:#e9b872;
  /* Glass: a panel lit from the upper left, as the orb in the app. */
  --glass-top:rgb(24 78 92/.74);--glass-low:rgb(9 42 54/.84);--rim:rgb(190 240 235/.36);--rim-low:rgb(134 165 173/.13);
  --sea-glass:linear-gradient(180deg,#dcfaeb,#b6efd5 46%,#a1e4c8)}
[hidden]{display:none!important}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* Three links beside the brand do not fit 320 px on one line. site.css may get this rule too; these pages do not wait for it. */
header,nav{flex-wrap:wrap;row-gap:.35rem}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid #fff;outline-offset:3px}

.rhythms{padding:clamp(2rem,6vw,4rem) 0}
.rhythms h1{font-size:clamp(2.8rem,7vw,5rem)}
.lead{max-width:38rem;margin:.6rem 0 0}

/* Controls */
/* One row when there is room: the search takes what the selects leave. A hidden field leaves no gap. */
.filters{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:end;margin:1.75rem 0 1.25rem}
.field{display:grid;gap:.35rem;min-width:0;flex:1 1 9.5rem}
.field:first-child{flex:3 1 18rem}
.field label,.bands legend{font-size:.9rem;font-weight:600;color:var(--muted)}
.filters input[type=search],.filters select{font:inherit;color:var(--ink);background-color:rgb(4 26 34/.62);border:1px solid rgb(134 165 173/.62);border-radius:.8rem;padding:.55rem .85rem;min-height:2.85rem;width:100%;box-shadow:inset 0 1px 2px rgb(0 0 0/.35),0 1px 0 rgb(255 255 255/.06)}
.filters input[type=search]:hover,.filters select:hover{border-color:rgb(190 240 235/.85)}
.filters input[type=search]:focus,.filters select:focus{border-color:var(--link);box-shadow:inset 0 1px 2px rgb(0 0 0/.35),0 0 0 4px rgb(180 241 220/.16)}
/* The arrow of a select is two small triangles: no picture is loaded. */
.filters select{-webkit-appearance:none;appearance:none;padding-right:2.4rem;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 1.3rem) 50%,calc(100% - .92rem) 50%;background-size:.38rem .38rem;background-repeat:no-repeat}
.filters select option{color:var(--ink);background:var(--well)}
.filters input::placeholder{color:#9db5b8;opacity:1}
.bands{flex:1 1 100%;border:0;padding:0;margin:0;min-width:0}
.bands legend{padding:0;margin-bottom:.35rem}
.pills{display:flex;flex-wrap:wrap;gap:.5rem}
.pill{position:relative;display:inline-flex}
.pill input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.pill span{display:inline-flex;align-items:center;min-height:2.75rem;padding:0 1.1rem;border:1px solid rgb(134 165 173/.62);border-radius:999px;color:var(--ink);background:rgb(4 26 34/.4);box-shadow:inset 0 1px 0 rgb(255 255 255/.07)}
.pill input:checked+span{background:var(--sea-glass);border-color:rgb(255 255 255/.6);color:var(--on-link);font-weight:650;box-shadow:inset 0 1px 0 rgb(255 255 255/.85),0 .5rem 1.3rem -.55rem rgb(120 235 195/.6)}
.pill input:focus-visible+span{outline:3px solid #fff;outline-offset:3px}
.pill:hover span{border-color:#fff}

/* Phase colours. A hold is hatched, so the strip does not rest on colour alone. */
.seg-inhale{background-color:var(--inhale)}
.seg-full{background-color:var(--full)}
.seg-exhale{background-color:var(--exhale)}
.seg-empty{background-color:var(--empty)}
.seg-recovery{background-color:var(--recovery)}
.seg.seg-full,.seg.seg-empty{background-image:repeating-linear-gradient(135deg,transparent 0 3px,rgb(8 43 56/.42) 3px 5px)}
/* The small marks beside the seconds differ in shape too: a disc for breathing, a ring for a hold, a square for recovery. */
.dot{display:inline-block;width:.62rem;height:.62rem;border-radius:50%;flex:none}
.dot.seg-full{background-color:transparent;box-shadow:inset 0 0 0 .17rem var(--full)}
.dot.seg-empty{background-color:transparent;box-shadow:inset 0 0 0 .17rem var(--empty)}
.dot.seg-recovery{border-radius:.12rem}
.legend{list-style:none;display:flex;flex-wrap:wrap;gap:.3rem 1rem;margin:0;padding:0;font-size:.86rem;color:var(--muted)}
.legend li{display:inline-flex;align-items:center;gap:.35rem}

/* Notes and states */
.notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.25rem;margin:1.1rem 0 0;padding:.85rem 1rem;background:linear-gradient(180deg,var(--glass-top),var(--glass-low));border:1px solid rgb(134 165 173/.5);border-left:.3rem solid var(--link);border-radius:.9rem;box-shadow:inset 0 1px 0 rgb(255 255 255/.1)}
.notice p{flex:1 1 16rem;margin:0;font-size:1rem;line-height:1.5;color:var(--ink)}
.notice-stale{background:#3b2f1c;border-color:var(--warm)}
.notice-stale strong{color:#ffdcae}
.status{margin:1.1rem 0 0;font-size:.95rem}
.state{margin:1.25rem 0 0;padding:2.4rem 1.25rem;text-align:center;border:1px dashed rgb(134 165 173/.7);border-radius:1.25rem;background:rgb(4 26 34/.3)}
.state p{max-width:34rem;margin:.7rem auto 1.2rem}
.state p:last-child{margin-bottom:0}
.more{display:flex;flex-direction:column;align-items:center;gap:.7rem;margin:1.75rem 0 0}
.more-error{color:#ffdcae;font-size:1rem}

/* Cards */
.cards{list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,19.5rem),1fr));gap:1.25rem;margin:.9rem 0 0;padding:0}
.cards.is-busy{opacity:.55}
/* Before the first rhythms arrive, the place of the list is one pane with a band of light crossing it. */
.cards[aria-busy=true]:empty{display:block;min-height:19rem;border:1px solid rgb(134 165 173/.2);border-radius:1.25rem;background:linear-gradient(100deg,transparent 35%,rgb(190 240 235/.12) 50%,transparent 65%) 150% 0/250% 100% no-repeat,linear-gradient(180deg,rgb(24 78 92/.4),rgb(9 42 54/.5))}
.card{display:grid;grid-template-rows:auto auto auto 1fr auto;gap:.95rem;min-width:0;padding:1.15rem 1.15rem 1.25rem;border:1px solid transparent;border-radius:1.25rem;background:linear-gradient(180deg,var(--glass-top),var(--glass-low)) padding-box,linear-gradient(160deg,var(--rim),var(--rim-low) 42%,rgb(134 165 173/.1)) border-box;box-shadow:inset 0 1px 0 rgb(255 255 255/.1),0 1.4rem 2.4rem -1.6rem rgb(0 10 14/.85)}
.card:hover{box-shadow:inset 0 1px 0 rgb(255 255 255/.16),0 1.6rem 2.8rem -1.4rem rgb(0 10 14/.9),0 0 2.6rem -.5rem rgb(143 230 214/.3)}
.card-title{font-size:1.9rem;line-height:1.1;overflow-wrap:anywhere}
.card-title:focus-visible{outline-offset:6px;border-radius:.2rem}

.rhythm{display:grid;gap:.6rem}
.progression{margin:0;color:var(--muted);font-size:.85rem}
.round{display:grid;gap:.3rem;min-width:0}
.round-name,.fact dt,.chip-kind,.eyebrow{font-size:.74rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.strip{display:flex;gap:2px;height:.9rem;min-width:3rem;max-width:100%}
.seg{flex:0 1 0;min-width:.3rem;border-radius:.25rem;box-shadow:inset 0 1px 0 rgb(255 255 255/.42),inset 0 -1px 0 rgb(0 20 28/.18)}
.beats{display:flex;flex-wrap:wrap;gap:.1rem .75rem;font-size:.86rem;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums}
.beat{display:inline-flex;align-items:center;gap:.3rem;white-space:nowrap}

.card-body{display:grid;grid-template-columns:minmax(0,1fr) clamp(6.5rem,40%,9.25rem);gap:.9rem;align-items:start}
.card-meta{display:grid;gap:.55rem;align-content:start;min-width:0}
.facts{display:grid;gap:.45rem;margin:0}
.fact dd{margin:0;font-size:1.02rem;line-height:1.35;color:var(--ink);font-variant-numeric:tabular-nums}
.difficulty{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:0;font-size:.88rem;line-height:1.2;color:var(--ink)}
.chip{display:inline-flex;align-items:center;gap:.4rem;padding:.3rem .6rem;border:1px solid var(--line);border-radius:999px;white-space:nowrap}
.chip-estimate{border-style:dashed}
.chip-rated{background:rgb(168 232 222/.16);border-color:rgb(168 232 222/.75)}
.chip-none{font-size:.84rem;color:var(--muted)}
.level{display:inline-flex;gap:2px}
.level i{width:.42rem;height:.42rem;border:1px solid currentColor;border-radius:50%}
.band-easy .level i:first-child,.band-moderate .level i:nth-child(-n+2),.band-demanding .level i{background:currentColor}
.contributions{margin:0;font-size:.92rem;line-height:1.3}

/* QR codes: black on white, the quiet zone inside the picture, the square reserved before the code exists. */
.qr{appearance:none;display:grid;gap:.3rem;justify-items:center;width:100%;margin:0;padding:0;border:0;border-radius:.7rem;background:none;font:inherit;color:var(--muted);cursor:zoom-in}
.qr:disabled{cursor:default}
.qr-tile{display:grid;place-items:center;width:100%;aspect-ratio:1;overflow:hidden;background:#fff;border-radius:.7rem;box-shadow:0 0 0 1px rgb(255 255 255/.55),0 .9rem 1.6rem -.9rem rgb(0 10 14/.9)}
.qr-tile svg,.scan-code svg{display:block;width:100%;height:100%}
.qr-hint{min-height:1.1rem;font-size:.8rem;line-height:1.1rem}
.qr:hover .qr-hint{color:#fff}
.qr:hover:enabled .qr-tile{box-shadow:0 0 0 1px #fff,0 0 1.6rem rgb(143 230 214/.45),0 .9rem 1.6rem -.9rem rgb(0 10 14/.9)}
.qr-none{margin:0;padding:.5rem;font-size:.8rem;line-height:1.3;text-align:center;color:#17323b}

.actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.button{appearance:none;display:inline-flex;align-items:center;justify-content:center;min-height:2.75rem;padding:.5rem 1.15rem;border:1px solid rgb(134 165 173/.72);border-radius:999px;background:rgb(255 255 255/.04);color:var(--ink);font:inherit;font-weight:600;line-height:1.2;text-align:center;text-decoration:none;cursor:pointer;box-shadow:inset 0 1px 0 rgb(255 255 255/.08)}
.button:hover{border-color:#fff;color:#fff;background:rgb(255 255 255/.1)}
/* The main action is sea glass with a lit upper edge; a band of light crosses it on hover. */
.button-main,.button-main:hover{position:relative;isolation:isolate;overflow:hidden;background:var(--sea-glass);border-color:rgb(255 255 255/.6);color:var(--on-link);box-shadow:inset 0 1px 0 rgb(255 255 255/.85),0 .55rem 1.5rem -.55rem rgb(120 235 195/.6)}
.button-main:hover{box-shadow:inset 0 1px 0 rgb(255 255 255/.9),0 .7rem 1.9rem -.5rem rgb(120 235 195/.85)}
.button-main::before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:-60%;width:46%;background:linear-gradient(100deg,transparent,rgb(255 255 255/.85),transparent);transform:skewX(-18deg);opacity:0;pointer-events:none}
.button.is-done{border-color:var(--link);color:var(--link)}
.button:disabled{opacity:.6;cursor:progress}
.card .actions .button{flex:1 1 auto}
.manual-copy{display:grid;gap:.4rem;font-size:.9rem;line-height:1.4;color:var(--muted)}
.manual-copy textarea{width:100%;padding:.5rem;font:.85rem/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ink);background:var(--well);border:1px solid var(--line);border-radius:.6rem;word-break:break-all;resize:vertical}
.copy-probe{position:fixed;top:0;left:-200vw;font-size:1rem;opacity:0}
.rhythm-id{margin:0;font-size:.84rem;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums}

/* The scan view */
.scan{width:min(34rem,calc(100vw - 1.5rem));max-width:none;max-height:calc(100vh - 1.5rem);max-height:calc(100dvh - 1.5rem);padding:1.25rem;overflow:auto;color:var(--ink);background:linear-gradient(180deg,#134556,#0a2f3c);border:1px solid rgb(190 240 235/.32);border-radius:1.4rem;box-shadow:inset 0 1px 0 rgb(255 255 255/.14),0 2.5rem 5rem -1.5rem rgb(0 8 12/.9)}
.scan::backdrop{background:rgb(2 14 20/.72);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.scan-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.scan-head h2{font-size:2rem;line-height:1.1;overflow-wrap:anywhere}
.scan-code{display:grid;place-items:center;width:min(100%,calc(100vh - 20rem));width:min(100%,calc(100dvh - 20rem));min-width:min(100%,12rem);aspect-ratio:1;margin:1rem auto;overflow:hidden;background:#fff;border-radius:.9rem;box-shadow:0 0 0 1px rgb(255 255 255/.55),0 0 3rem rgb(143 230 214/.22)}
.scan-hint{margin:0 0 1rem;font-size:1rem;line-height:1.5;text-align:center}
.scan .actions{justify-content:center}
.scan .rhythm-id{margin-top:1rem;text-align:center}
.scan .manual-copy{margin-top:1rem}

/* The rhythm page */
.sheet{max-width:50rem;padding:clamp(2rem,6vw,4rem) 0 0}
.sheet h1{font-size:clamp(2.8rem,9vw,5rem);overflow-wrap:anywhere}
.sheet h1:focus-visible{outline-offset:8px}
.eyebrow{margin:0 0 .5rem;line-height:1.4}
.sheet-main{display:grid;grid-template-columns:minmax(0,1fr) 11.5rem;gap:1.5rem clamp(1.5rem,5vw,3.5rem);align-items:start;margin-top:1.75rem}
.sheet-info{display:grid;gap:1.15rem;min-width:0}
.sheet-info .facts{grid-template-columns:repeat(auto-fit,minmax(8.5rem,1fr));gap:.9rem 1.5rem}
.sheet-info .strip{height:1.15rem}
.sheet-info .seg{border-radius:.32rem}
.sheet-help{margin:0;font-size:1rem;line-height:1.55}
.open-note{margin:0;padding:.7rem .9rem;font-size:1rem;line-height:1.5;color:var(--ink);background:linear-gradient(180deg,var(--glass-top),var(--glass-low));border:1px solid rgb(134 165 173/.5);border-left:.3rem solid var(--link);border-radius:.9rem;box-shadow:inset 0 1px 0 rgb(255 255 255/.1)}
.open-note:empty{display:none}
.sheet-scan{padding:.8rem;border:1px solid transparent;border-radius:1.25rem;background:linear-gradient(180deg,var(--glass-top),var(--glass-low)) padding-box,linear-gradient(160deg,var(--rim),var(--rim-low) 42%,rgb(134 165 173/.1)) border-box;box-shadow:inset 0 1px 0 rgb(255 255 255/.1),0 1.4rem 2.4rem -1.6rem rgb(0 10 14/.85)}
.sheet-scan p{margin:.6rem 0 0;font-size:.86rem;line-height:1.4;text-align:center}
.sheet-message{max-width:40rem;padding-bottom:clamp(2.5rem,7vw,5rem)}
.sheet-message h1{font-size:clamp(2.3rem,6.5vw,3.5rem);line-height:1.08}
.sheet-message p{margin:1rem 0 0}
.sheet-message .eyebrow{margin:0 0 .5rem}
.sheet-message .actions{margin-top:1.6rem}
.sheet-message .open-note{margin-top:1rem}
.sheet-message .rhythm-id{margin-top:1.4rem}
.sheet-after{margin:2rem 0 clamp(2rem,6vw,4rem)}

@media(max-width:650px){
  .sheet-main{grid-template-columns:1fr}
  .sheet-scan{width:min(100%,13rem)}
}
/* A phone: the four difficulty choices stay on one line, and each action is a full thumb wide. */
@media(max-width:480px){
  .rhythms{padding-top:1.6rem}
  .filters{gap:.85rem .75rem;margin-top:1.4rem}
  .field{flex:1 1 8.5rem}
  .pills{gap:.4rem}
  .pill{flex:1 1 auto}
  .pill span{flex:1;justify-content:center;padding:0 .7rem;font-size:.95rem}
  .legend{gap:.3rem .85rem}
  .card{padding:1.05rem 1rem 1.1rem}
  .sheet .actions .button,.sheet-message .actions .button,.scan .actions .button{flex:1 1 auto}
  .scan{padding:1rem}
}
.button:active,.pill:active span,.qr:active:enabled .qr-tile{scale:.97}
a,button,summary,label,select,input{-webkit-tap-highlight-color:transparent}
@media(prefers-reduced-motion:no-preference){
  .button,.pill span,.qr-hint,.qr-tile,.card,.filters input,.filters select{transition:background-color .15s,border-color .15s,color .15s,box-shadow .2s,scale .15s}
  .cards{transition:opacity .15s}
  .cards[aria-busy=true]:empty{animation:pane-light 1.5s linear infinite}
  .button-main:hover::before,.button-main:focus-visible::before{animation:button-light .8s ease-out}
  .scan[open]{animation:scan-in .18s ease-out}
  @keyframes scan-in{from{opacity:0;transform:translateY(.5rem)}}
  @keyframes pane-light{to{background-position:-100% 0,0 0}}
  @keyframes button-light{from{translate:0 0;opacity:1}to{translate:440% 0;opacity:1}}
}
@media print{
  :root{color:#000;background:#fff;--ink:#000;--muted:#333;--edge:#999;--line:#666;--panel:#fff;--link:#000}
  body{background:none}
  header,footer,.filters,.lead,.notice,.status,.more,.actions,.qr-hint,.sheet-help,.sheet-after{display:none}
  .card{break-inside:avoid;background:#fff;border-color:#999;box-shadow:none}
  .sheet-scan{background:none;border-color:transparent;box-shadow:none}
  .chip-rated{background:none}
  .seg,.dot,.level i{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .seg{box-shadow:none}
  .dot.seg-full{box-shadow:inset 0 0 0 .17rem #777}
}

.skip-board{position:absolute;left:1rem;top:1rem;transform:translateY(-180%);z-index:9;padding:.7rem 1rem;background:var(--well);color:var(--ink)}
.skip-board:focus{transform:none}
.board-intro{padding-bottom:clamp(1.8rem,4vw,3.5rem);border-bottom:1px solid var(--hair,rgb(214 240 232/.16))}
.board-intro h1{line-height:.98;letter-spacing:-.045em}
.board-intro .lead{margin-top:1.1rem;max-width:42ch}
.card-heading{display:flex;align-items:baseline;gap:.7rem}
.card-title a{color:inherit;text-decoration:none}
.card-title a:hover{text-decoration:underline}
.board-rank{line-height:1;color:var(--link);font-variant-numeric:tabular-nums;font-size:1.35rem}
.board-rank:before{content:"#";font-size:.68em}
.board-help{border-block:1px solid var(--hair,rgb(214 240 232/.16));padding:1.2rem 0;margin-top:2.5rem}
.board-help summary{cursor:pointer;color:var(--ink);font-weight:650}
.board-help p{max-width:62ch}
.state .button{margin:.25rem}
