/* Tide Deck: floating pocket-player style deck, in the site's navy, sea and sand */
.tdeck { --hi: #0f2c55; --mid: #001842; --lo: #000d26; --line: #000a1f;
  --silk: #dfe6e1; --legend: #9fb1b9; --sand: #BDB89C;
  --led: #3fa3b6; --led-mid: #d9cf9e; --led-hot: #e0956f; --led-off: #142b4d;
  --lcd: #000a1c; --lcd-ink: #e6eee9; --lcd-dim: #7f9bab; --lcd-line: #0c2244;
  position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 392px; max-width: calc(100vw - 32px); border-radius: 22px; padding: 16px 18px 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 60' preserveAspectRatio='none'%3E%3Cpath d='M0 20Q52.5 6 105 20T210 20' fill='none' stroke='%233fa3b6' stroke-opacity='.5' stroke-width='1.6'/%3E%3Cpath d='M0 34Q52.5 22 105 34T210 34' fill='none' stroke='%23BDB89C' stroke-opacity='.4'/%3E%3Cpath d='M0 48Q52.5 38 105 48T210 48' fill='none' stroke='%23dfe6e1' stroke-opacity='.14'/%3E%3C/svg%3E") 0 calc(100% - 4px) / 168px 48px repeat-x, linear-gradient(180deg, var(--hi), var(--mid) 40%, var(--lo));
  box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 -1px 0 rgba(0,0,0,.5) inset, 0 18px 40px rgba(0,24,66,.3), 0 2px 6px rgba(0,24,66,.25);
  color: var(--silk); font-family: 'Hanken Grotesk', system-ui, sans-serif;
  transition: width .45s cubic-bezier(.2,.7,.2,1), border-radius .45s, padding .45s; }
.tdeck * { box-sizing: border-box; }
.tdeck button:focus-visible, .td-wheel:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; }
.td-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.td-brand { font-family: 'Newsreader', Georgia, serif; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--silk); }
.td-collapse { appearance: none; border: 0; background: none; color: var(--legend); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.td-collapse:hover { color: var(--silk); background: rgba(255,255,255,.06); }
.td-monitor { display: none; position: relative; margin-top: 12px; width: 100%; height: 0; padding-top: max(200px, 56.25%); border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); }
.tdeck.has-video .td-monitor { display: block; }
.td-monitor iframe, .td-monitor > div { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.td-face { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 16px; align-items: center; margin-top: 12px; }
/* screen: list while browsing, now playing otherwise */
.td-screen { position: relative; min-width: 0; height: 128px; background: var(--lcd); border-radius: 7px; box-shadow: inset 0 1px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.07); font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; overflow: hidden; }
.td-view { position: absolute; inset: 0; padding: 9px 10px; transition: opacity .25s; }
.td-view[aria-hidden="true"] { opacity: 0; pointer-events: none; }
.td-head { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--lcd-dim); padding-bottom: 6px; border-bottom: 1px solid var(--lcd-line); }
.td-list { margin-top: 6px; position: relative; height: 92px; overflow: hidden; }
.td-list ul { list-style: none; margin: 0; padding: 0; transition: transform .18s cubic-bezier(.2,.7,.2,1); }
.td-list li { height: 18.4px; display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 11.5px; color: var(--lcd-ink); white-space: nowrap; overflow: hidden; border-radius: 3px; cursor: pointer; }
.td-list li .n { color: var(--lcd-dim); font-size: 10px; width: 16px; flex: none; }
.td-list li .x { overflow: hidden; text-overflow: ellipsis; }
.td-list li.sel { background: var(--sand); color: #0b1d36; }
.td-list li.sel .n { color: #0b1d36; }
.td-list li .eq { margin-left: auto; flex: none; display: none; gap: 1.5px; align-items: flex-end; height: 9px; }
.td-list li.cur .eq { display: inline-flex; }
.td-list li .eq i { width: 2px; height: 3px; background: currentColor; }
.tdeck.playing .td-list li.cur .eq i { animation: td-eq .8s ease-in-out infinite alternate; }
.tdeck.playing .td-list li.cur .eq i:nth-child(2) { animation-delay: -.3s; }
.tdeck.playing .td-list li.cur .eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes td-eq { from { height: 2px; } to { height: 9px; } }
.td-np-title { margin-top: 10px; font-size: 13px; color: var(--lcd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-np-proj { margin-top: 4px; font-size: 10px; color: var(--lcd-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
.td-meters { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.td-meter { display: flex; gap: 2px; height: 5px; }
.td-meter i { flex: 1; border-radius: 1px; background: var(--led-off); }
.td-meter i.on { background: var(--led); }
.td-meter i.on.mid { background: var(--led-mid); }
.td-meter i.on.hot { background: var(--led-hot); }
.td-scrub { margin-top: 9px; height: 3px; background: var(--lcd-line); border-radius: 2px; overflow: hidden; }
.td-scrub i { display: block; height: 100%; width: 0; background: var(--led); }
.td-tc { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10px; color: #a9c3cc; font-variant-numeric: tabular-nums; }
/* wheel: machined disc with a finger dimple and a centre button */
.td-wheel { position: relative; width: 128px; height: 128px; border-radius: 50%; touch-action: none; cursor: grab;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.04) 0 1px, rgba(0,0,0,.06) 1px 2.4px), radial-gradient(circle at 50% 38%, #1c3a66, #08234d 55%, #001536);
  box-shadow: 0 6px 14px rgba(0,16,40,.55), 0 1px 0 rgba(255,255,255,.14) inset, 0 -2px 6px rgba(0,0,0,.4) inset, 0 0 0 1px var(--line); }
.td-wheel:active { cursor: grabbing; }
.td-arc { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); pointer-events: none; }
.td-dimple { position: absolute; inset: 0; pointer-events: none; }
.td-dimple::before { content: ''; position: absolute; left: 50%; top: 11px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #000d26, #0f2c55); box-shadow: inset 0 1px 2px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.08); }
.td-centre { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 0; cursor: pointer; color: var(--silk); display: grid; place-items: center;
  background: radial-gradient(circle at 42% 32%, #14335f, #011a3d 70%); box-shadow: 0 2px 5px rgba(0,16,40,.6), 0 1px 0 rgba(255,255,255,.12) inset, 0 0 0 1px var(--line); transition: transform .08s; }
.td-centre:active { transform: scale(.96); }
.td-centre svg { width: 15px; height: 15px; }
.tdeck.playing .td-centre { color: var(--sand); }
.td-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.td-btns { display: flex; gap: 10px; }
.td-hw { appearance: none; border: 0; cursor: pointer; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--silk);
  background: radial-gradient(circle at 40% 30%, #14335f, #021b3f 70%); box-shadow: 0 3px 6px rgba(0,16,40,.5), 0 1px 0 rgba(255,255,255,.1) inset, 0 0 0 1px var(--line); transition: transform .08s; }
.td-hw:active { transform: translateY(1px) scale(.97); }
.td-hw svg { width: 13px; height: 13px; }
.td-hint { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--legend); text-align: right; }
.td-status { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 3px; font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--legend); }
.td-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.tdeck.playing .td-dot { background: var(--sand); box-shadow: 0 0 8px rgba(189,184,156,.7); }
/* collapsed puck */
.tdeck.mini { width: 84px; padding: 10px; border-radius: 42px; }
.tdeck.mini .td-top, .tdeck.mini .td-monitor, .tdeck.mini .td-screen, .tdeck.mini .td-controls { display: none !important; }
.tdeck.mini .td-face { margin: 0; grid-template-columns: 1fr; }
.tdeck.mini .td-wheel { width: 64px; height: 64px; }
.tdeck.mini .td-dimple::before { top: 5px; width: 8px; height: 8px; margin-left: -4px; }
.tdeck.mini .td-centre { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.tdeck.mini .td-centre svg { width: 10px; height: 10px; }
.td-expand { display: none; }
.tdeck.mini .td-expand { display: block; position: absolute; inset: 0; border: 0; background: none; cursor: pointer; border-radius: 42px; z-index: 3; }
.yt.td-current { box-shadow: 0 0 0 2px var(--sea, #0B6079); }
@media (max-width: 480px) {
  .tdeck { width: auto; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding: 12px 14px; border-radius: 18px; }
  .tdeck.mini { left: auto; width: 84px; padding: 10px; border-radius: 42px; }
  .tdeck:not(.mini) .td-face { grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; }
  .tdeck:not(.mini) .td-wheel { width: 104px; height: 104px; }
  .tdeck:not(.mini) .td-screen { height: 104px; }
  .td-list { height: 70px; }
  .td-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tdeck, .td-hw, .td-list ul, .td-view { transition: none; } .tdeck.playing .td-list li.cur .eq i { animation: none; height: 6px; } }
/* tide lines drift while music plays */
@keyframes td-tide { to { background-position: -168px calc(100% - 4px), 0 0; } }
.tdeck.playing { animation: td-tide 16s linear infinite; }
/* free-floating: drag by the top bar, or the puck */
.td-top { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.tdeck.mini .td-expand { touch-action: none; }
.tdeck.dragging { transition: none; box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 26px 50px rgba(0,24,66,.38), 0 4px 10px rgba(0,24,66,.3); }
.tdeck.dragging, .tdeck.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.tdeck.dragging .td-monitor iframe { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tdeck.playing { animation: none; } }

/* phones: the deck spans the screen, so let it */
@media (max-width: 480px) { .tdeck { max-width: none; } }


/* ---- hardware finish: chamfered anodised casing, visible thickness, recessed parts, moving light ---- */
.tdeck { --lx: 30%; --ly: -10%;
  background:
    radial-gradient(130% 95% at var(--lx) var(--ly), rgba(255,255,255,.12), rgba(255,255,255,.035) 38%, rgba(255,255,255,0) 62%) 0 0 / 100% 100% no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 60' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23000814' stroke-opacity='.55' transform='translate(0 1)'%3E%3Cpath d='M0 20Q52.5 6 105 20T210 20' stroke-width='1.6'/%3E%3Cpath d='M0 34Q52.5 22 105 34T210 34'/%3E%3Cpath d='M0 48Q52.5 38 105 48T210 48'/%3E%3C/g%3E%3Cpath d='M0 20Q52.5 6 105 20T210 20' fill='none' stroke='%233fa3b6' stroke-opacity='.5' stroke-width='1.6'/%3E%3Cpath d='M0 34Q52.5 22 105 34T210 34' fill='none' stroke='%23BDB89C' stroke-opacity='.4'/%3E%3Cpath d='M0 48Q52.5 38 105 48T210 48' fill='none' stroke='%23dfe6e1' stroke-opacity='.14'/%3E%3C/svg%3E") 0 calc(100% - 4px) / 168px 48px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 160px 160px repeat,
    linear-gradient(180deg, var(--hi), var(--mid) 40%, var(--lo));
  box-shadow: 0 1px 0 #0a234a, 0 3px 0 #00081a, 0 4px 1px rgba(0,8,26,.6), 0 7px 10px rgba(0,16,40,.35), 0 22px 46px rgba(0,24,66,.28); }
/* diamond-cut chamfer: a bright edge, strongest along the top */
.tdeck::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.16) 22%, rgba(255,255,255,.05) 62%, rgba(255,255,255,.15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
/* the cut line just inside the chamfer */
.tdeck::after { content: ''; position: absolute; inset: 1.5px; border-radius: inherit; border: 1px solid rgba(0,6,20,.55); pointer-events: none; z-index: 1; }
@keyframes td-tide { to { background-position: 0 0, -168px calc(100% - 4px), 0 0, 0 0; } }
.tdeck.dragging { box-shadow: 0 1px 0 #0a234a, 0 3px 0 #00081a, 0 12px 20px rgba(0,16,40,.32), 0 32px 64px rgba(0,24,66,.32); }
/* screen and video sit behind a dark gasket, the screen under glass */
.td-screen { box-shadow: 0 0 0 2px #00061a, 0 -1px 0 2px rgba(0,0,0,.35), 0 1px 0 2.5px rgba(255,255,255,.08), inset 0 1px 4px rgba(0,0,0,.75); }
.td-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: inherit;
  background: linear-gradient(172deg, rgba(255,255,255,.075) 0, rgba(255,255,255,.025) 32%, rgba(255,255,255,0) 33%); }
.td-monitor { box-shadow: 0 0 0 2px #00061a, 0 -1px 0 2px rgba(0,0,0,.35), 0 1px 0 2.5px rgba(255,255,255,.08); }
/* the wheel sits in a machined well; the progress arc runs in the groove */
.td-wheel { box-shadow: 0 2px 4px rgba(0,8,26,.55), 0 1px 0 rgba(255,255,255,.14) inset, 0 -2px 6px rgba(0,0,0,.4) inset, 0 0 0 1px var(--line),
  0 0 0 6px #000b22, 0 -1px 0 6px rgba(0,0,0,.45), 0 1px 0 6.5px rgba(255,255,255,.09); }
.td-centre { box-shadow: 0 1px 2px rgba(0,8,26,.6), 0 1px 0 rgba(255,255,255,.12) inset, 0 0 0 1px var(--line), 0 0 0 3px #01112e, 0 -1px 0 3px rgba(0,0,0,.35), 0 1px 0 3.5px rgba(255,255,255,.06); }
/* buttons in round recesses, pressing down into them */
.td-btns { gap: 16px; padding-left: 4px; }
.td-hw { box-shadow: 0 2px 3px rgba(0,8,26,.55), 0 1px 0 rgba(255,255,255,.12) inset, 0 0 0 1px var(--line), 0 0 0 4px #000b22, 0 -1px 0 4px rgba(0,0,0,.4), 0 1px 0 4.5px rgba(255,255,255,.08); }
.td-hw:active { transform: none; background: radial-gradient(circle at 40% 30%, #0f2b52, #011734 70%);
  box-shadow: 0 1px 2px rgba(0,0,0,.6) inset, 0 0 0 1px var(--line), 0 0 0 4px #000b22, 0 -1px 0 4px rgba(0,0,0,.4), 0 1px 0 4.5px rgba(255,255,255,.08); }
.td-hw:active svg { transform: translateY(1px); }
