@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;1,9..144,400;1,9..144,500&display=swap');

/* =========================================================
   TIDE / 10 — a soft four-scene tide
   All rules are scoped to #tide.
   ========================================================= */

#tide {
  --t-bg: #e9ece5;
  --t-ink: #1f2f29;
  --t-ink-soft: #45564f;
  --t-muted: #5c6c65;
  --t-line: rgba(47, 70, 62, .2);
  --t-line-strong: rgba(47, 70, 62, .44);
  --t-water: #aac5cc;
  --t-water-deep: #6f9699;
  --t-deep: #33544a;
  --t-accent: #a34e33;
  --t-card: rgba(247, 246, 239, .64);
  --t-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --t-mono: 'DM Mono', 'Courier New', monospace;
  --t-sans: 'Manrope', 'Helvetica Neue', sans-serif;
  --t-head: 64px;
  --t-foot: 76px;
  --t-pad: clamp(28px, 5vw, 76px);
  height: 100vh;
  min-height: 700px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: var(--t-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#tide.active {
  display: flex;
  flex-direction: column;
}

#tide ::selection {
  background: var(--t-accent);
  color: #f8f5ed;
}

#tide :focus-visible {
  outline: 2px solid var(--t-accent);
  outline-offset: 3px;
}

#tide [hidden] {
  display: none !important;
}

#tide .tide-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- ambient water ---------- */

#tide .tide-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 95% at 80% 6%, rgba(184, 207, 214, .7), transparent 55%),
    radial-gradient(95% 80% at 5% 96%, rgba(198, 210, 191, .66), transparent 62%),
    linear-gradient(118deg, #eef0e8 0%, #e8ece5 48%, #e3e9e2 100%);
  transition: filter .8s ease;
}

#tide .tide-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(180deg, transparent 0 119px, rgba(47, 70, 62, .045) 119px 120px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 72%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 72%, transparent);
  opacity: .8;
}

#tide .tide-wash i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(54px);
  opacity: .42;
  pointer-events: none;
  animation: tideDrift 24s ease-in-out infinite alternate;
}

#tide .tide-wash i:nth-child(1) {
  width: 39vw;
  height: 39vw;
  min-width: 340px;
  min-height: 340px;
  left: -10vw;
  top: -15vw;
  background: #c9dce1;
}

#tide .tide-wash i:nth-child(2) {
  width: 34vw;
  height: 34vw;
  min-width: 300px;
  min-height: 300px;
  right: -8vw;
  bottom: -13vw;
  background: #d3ddc8;
  animation-delay: -8s;
}

#tide .tide-wash i:nth-child(3) {
  width: 21vw;
  height: 21vw;
  min-width: 180px;
  min-height: 180px;
  right: 21%;
  top: 12%;
  background: #eadbc8;
  opacity: .2;
  animation-delay: -15s;
}

#tide .tide-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .16;
  transition: opacity .8s ease;
}

@keyframes tideDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2.5vw, 1.6vw, 0) scale(1.04); }
  100% { transform: translate3d(-1.4vw, 2.2vw, 0) scale(.98); }
}

/* ---------- header ---------- */

#tide .tide-head {
  position: relative;
  z-index: 20;
  flex: 0 0 var(--t-head);
  height: var(--t-head);
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--t-line);
  background: linear-gradient(180deg, rgba(240, 242, 235, .7), rgba(240, 242, 235, 0));
}

#tide .tide-head-inner {
  width: 100%;
  max-width: 1160px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--t-pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

#tide .tide-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 600 11px var(--display);
  letter-spacing: .1em;
  color: var(--t-ink);
}

#tide .tide-brand span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--t-line-strong);
  border-radius: 50%;
  font: 400 7px var(--t-mono);
  letter-spacing: 0;
  color: var(--t-muted);
}

#tide .tide-head-center {
  text-align: center;
  min-width: 0;
}

#tide .tide-head-center p {
  margin: 0;
  font: 500 7px var(--t-mono);
  letter-spacing: .22em;
  color: var(--t-muted);
  white-space: nowrap;
}

#tide .tide-mode-note {
  display: block;
  min-height: 9px;
  margin-top: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font: italic 400 10px var(--t-serif);
  color: var(--t-accent);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .4s ease, transform .4s ease;
}

#tide .tide-mode-note.is-on {
  opacity: 1;
  transform: none;
}

#tide .tide-head-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  min-width: 0;
}

#tide .tide-scale {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: inherit;
  color: var(--t-muted);
}

#tide .tide-scale-label {
  padding: 0;
  border: 0;
  border-radius: 0;
  font: 500 6.5px var(--t-mono);
  letter-spacing: .18em;
  white-space: nowrap;
}

#tide .tide-scale input {
  width: 82px;
  margin: 0;
}

#tide .tide-scale b {
  min-width: 33px;
  font: 400 8px var(--t-mono);
  letter-spacing: .04em;
  color: var(--t-muted);
  transition: color .25s ease;
}

#tide .tide-scale b.is-modified {
  color: var(--t-accent);
}

#tide .tide-head button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--t-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--t-ink-soft);
  padding: 7px 12px;
  font: 500 7.5px var(--t-mono);
  letter-spacing: .14em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

#tide .tide-head button:hover {
  border-color: var(--t-ink);
  background: rgba(47, 70, 62, .08);
}

#tide .tide-head button[aria-pressed="true"] {
  background: var(--t-ink);
  border-color: var(--t-ink);
  color: #f3f2e8;
}

#tide .tide-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

#tide .tide-progress i {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--t-accent);
  transition: width .8s cubic-bezier(.22, .75, .18, 1);
}

/* range inputs, scoped */

#tide input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 26px;
  background: transparent;
  cursor: pointer;
}

#tide input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--t-line-strong);
}

#tide input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--t-accent);
  box-shadow: 0 0 0 3px rgba(163, 78, 51, .12);
}

#tide input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--t-line-strong);
}

#tide input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--t-accent);
  box-shadow: 0 0 0 3px rgba(163, 78, 51, .12);
}

/* ---------- stage / deck ---------- */

#tide .tide-viewport {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

#tide .tide-deck {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform .9s cubic-bezier(.22, .75, .18, 1);
  will-change: transform;
}

#tide .tide-scene {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  overflow: hidden;
  transform: none;
  transition: none;
}

#tide .tide-scene-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1160px;
  height: 100%;
  margin: 0 auto;
  padding: clamp(20px, 3.4vh, 36px) var(--t-pad) clamp(13px, 2.4vh, 24px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 2vh, 22px);
}

#tide .tide-ghost {
  position: absolute;
  z-index: 1;
  top: -7%;
  right: 1.5%;
  font: 400 calc(clamp(180px, 23vw, 330px) * var(--tide-scale, 1))/1 var(--t-serif);
  letter-spacing: -.1em;
  color: rgba(31, 47, 41, .045);
  pointer-events: none;
  transition: transform 1.3s cubic-bezier(.2, .8, .2, 1), opacity 1.3s ease;
}

#tide .tide-scene:not(.is-current) .tide-ghost {
  transform: translateX(42px);
  opacity: .55;
}

#tide .tide-scene-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font: 500 8px/1 var(--t-mono);
  letter-spacing: .17em;
  color: var(--t-muted);
}

#tide .tide-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--t-ink-soft);
  white-space: nowrap;
}

#tide .tide-kicker b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--t-line-strong);
  border-radius: 50%;
  font: 400 8px var(--t-mono);
  letter-spacing: 0;
  color: var(--t-ink);
}

#tide .tide-kicker i {
  width: 30px;
  height: 1px;
  background: var(--t-line);
}

#tide .tide-duration {
  color: var(--t-muted);
  white-space: nowrap;
}

#tide .tide-scene-main {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(26px, 5vw, 84px);
  min-height: 0;
}

#tide .tide-scene-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 16px;
  font: 400 7px var(--t-mono);
  letter-spacing: .16em;
  color: var(--t-muted);
}

#tide .tide-caption {
  position: static;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font: 400 7px var(--t-mono);
  font-style: normal;
}

#tide .tide-caption b {
  font: 400 14px var(--t-serif);
  transition: transform .3s ease;
}

#tide .tide-scene:hover .tide-caption b {
  transform: translateX(4px);
}

#tide .tide-swipe {
  display: none;
  font-style: italic;
  font-family: var(--t-serif);
  font-size: 11px;
  letter-spacing: .02em;
}

#tide .tide-keys-hint {
  display: flex;
  align-items: center;
  gap: 4px;
}

#tide .tide-keys-hint kbd {
  font: 400 7px var(--t-mono);
  border: 1px solid var(--t-line);
  border-radius: 2px;
  padding: 2px 4px;
}

/* scene text */

#tide .tide-text {
  position: relative;
  z-index: 2;
  min-width: 0;
}

#tide .tide-text h1 {
  margin: 0 0 clamp(15px, 2.7vh, 28px);
  max-width: 9.6ch;
  font: 500 calc(clamp(54px, 6.15vw, 104px) * var(--tide-scale, 1))/.87 var(--t-serif);
  letter-spacing: -.062em;
  color: var(--t-ink);
  font-variation-settings: 'opsz' 120;
}

#tide .tide-text h1 em {
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.045em;
  color: var(--t-deep);
}

#tide .tide-text-compact h1 {
  max-width: 10.5ch;
  font-size: calc(clamp(48px, 5.4vw, 90px) * var(--tide-scale, 1));
}

#tide .tide-text p {
  margin: 0;
  max-width: 35ch;
  font: 400 clamp(12px, 1.02vw, 14px)/1.66 var(--t-sans);
  color: var(--t-ink-soft);
}

#tide .tide-text-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(16px, 3vh, 32px);
  font: italic 400 12.5px var(--t-serif);
  color: var(--t-muted);
}

#tide .tide-text-foot i {
  display: block;
  width: 34px;
  height: 1px;
  background: var(--t-line-strong);
}

#tide .tide-formula {
  position: static;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(14px, 2.6vh, 26px);
  font: 400 clamp(15px, 1.55vw, 21px)/1.2 var(--t-serif);
  color: var(--t-ink-soft);
  letter-spacing: .01em;
}

#tide .tide-formula em {
  font-style: italic;
  color: var(--t-deep);
}

#tide .tide-formula b {
  margin: 0 3px;
  font-weight: 400;
  color: var(--t-accent);
}

#tide .tide-task-formula {
  display: inline-block;
  margin-top: clamp(14px, 2.4vh, 24px);
  padding-top: 9px;
  border-top: 1px solid var(--t-line-strong);
  font: 400 clamp(22px, 2.5vw, 32px)/1.15 var(--t-serif);
  letter-spacing: -.01em;
  color: var(--t-ink);
}

/* transitions between scenes */

#tide .tide-scene-meta,
#tide .tide-text,
#tide .tide-stage,
#tide .tide-scene-foot {
  transition: opacity .42s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}

#tide.is-ready .tide-scene:not(.is-current) .tide-scene-meta,
#tide.is-ready .tide-scene:not(.is-current) .tide-text,
#tide.is-ready .tide-scene:not(.is-current) .tide-stage,
#tide.is-ready .tide-scene:not(.is-current) .tide-scene-foot {
  opacity: 0;
  transform: translateY(22px);
}

#tide .tide-scene.is-current .tide-text { transition-delay: .07s; }
#tide .tide-scene.is-current .tide-stage { transition-delay: .13s; }
#tide .tide-scene.is-current .tide-scene-foot { transition-delay: .18s; }

/* wave that covers the deck while it turns */

#tide .tide-sweep {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .16s ease;
}

#tide .tide-sweep::before {
  content: "";
  position: absolute;
  left: -14%;
  top: 100%;
  width: 128%;
  height: 150%;
  border-radius: 48% 52% 0 0 / 4% 5% 0 0;
  background: linear-gradient(180deg, rgba(218, 230, 231, .93), rgba(174, 199, 205, .94) 54%, rgba(138, 172, 181, .92));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .5);
}

#tide.is-turning .tide-sweep {
  opacity: 1;
}

#tide.is-turning .tide-sweep::before {
  animation: tideSweep 1.05s cubic-bezier(.5, 0, .36, 1) both;
}

@keyframes tideSweep {
  0% { transform: translateY(0); }
  40% { transform: translateY(-106%); }
  60% { transform: translateY(-106%); }
  100% { transform: translateY(0); }
}

/* ---------- scene 01 / basin ---------- */

#tide .tide-stage {
  position: relative;
  z-index: 2;
  justify-self: end;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  min-width: 0;
}

#tide .tide-stage-basin {
  justify-self: end;
}

#tide .tide-basin {
  position: relative;
  width: min(100%, calc(438px * var(--tide-scale, 1)));
  aspect-ratio: 1;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 70, 62, .48);
  border-radius: 46% 54% 61% 39% / 52% 41% 59% 48%;
  background:
    radial-gradient(circle at 36% 29%, rgba(238, 245, 244, .9), rgba(188, 211, 217, .82) 52%, rgba(155, 184, 191, .9));
  box-shadow: inset 0 0 70px rgba(248, 250, 246, .35), 0 28px 70px -52px rgba(31, 47, 41, .7);
  animation: tideMorph 17s ease-in-out infinite;
  will-change: border-radius;
}

#tide .tide-basin::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(47, 70, 62, .18);
  border-radius: inherit;
}

#tide .tide-basin::after {
  content: "";
  position: absolute;
  inset: 19%;
  border-radius: inherit;
  background: rgba(248, 250, 246, .1);
  border: 1px solid rgba(47, 70, 62, .12);
}

#tide .tide-basin > i {
  position: absolute;
  display: block;
  border: 1px solid rgba(47, 70, 62, .23);
  border-radius: 50%;
  animation: tideBreathe 9s ease-in-out infinite;
}

#tide .tide-basin > i:nth-of-type(1) { inset: 13%; animation-delay: -1s; }
#tide .tide-basin > i:nth-of-type(2) { inset: 25%; animation-delay: -3s; }
#tide .tide-basin > i:nth-of-type(3) { inset: 37%; animation-delay: -5s; }

#tide .tide-basin > i:nth-of-type(4) {
  inset: 44%;
  border: 0;
  border-radius: 48% 52% 55% 45% / 52% 46% 54% 48%;
  background: var(--t-deep);
  box-shadow: 0 0 0 1px rgba(31, 47, 41, .2), inset 0 0 20px rgba(255, 255, 255, .08);
  animation: tideMorph 11s ease-in-out infinite reverse;
}

#tide .tide-basin-mark {
  position: relative;
  z-index: 2;
  font: 400 clamp(36px, 3.8vw, 54px)/1 var(--t-serif);
  color: #f4f3ea;
  letter-spacing: -.04em;
}

@keyframes tideMorph {
  0%, 100% { border-radius: 46% 54% 61% 39% / 52% 41% 59% 48%; }
  33% { border-radius: 54% 46% 42% 58% / 44% 57% 43% 56%; }
  66% { border-radius: 39% 61% 56% 44% / 58% 46% 54% 42%; }
}

@keyframes tideBreathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.022); opacity: 1; }
}

#tide .tide-stage-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  max-width: calc(438px * var(--tide-scale, 1));
  margin-left: auto;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--t-line);
  font: 400 7px/1.5 var(--t-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--t-muted);
}

#tide .tide-stage-caption span {
  color: var(--t-accent);
}

/* ---------- scene 02 / Riemann ---------- */

#tide .tide-stage-riemann {
  justify-self: end;
  max-width: 560px;
}

#tide .tide-riemann {
  width: 100%;
  border-top: 1px solid var(--t-line-strong);
  border-bottom: 1px solid var(--t-line);
  padding-top: 12px;
}

#tide .tide-riemann-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font: 500 7.5px var(--t-mono);
  letter-spacing: .16em;
  color: var(--t-muted);
}

#tide .tide-riemann-head b {
  font: 400 clamp(20px, 2.1vw, 28px)/1 var(--t-serif);
  letter-spacing: -.02em;
  color: var(--t-deep);
  transition: opacity .2s ease;
}

#tide .tide-riemann-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(35vh, 315px);
  margin: 7px 0 3px;
  overflow: visible;
}

#tide .tide-grid {
  fill: none;
  stroke: rgba(47, 70, 62, .13);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

#tide .tide-area {
  fill: rgba(170, 197, 204, .22);
  stroke: none;
}

#tide .tide-curve {
  fill: none;
  stroke: var(--t-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
}

#tide .tide-axis {
  fill: none;
  stroke: rgba(47, 70, 62, .48);
  stroke-width: 1;
}

#tide .tide-drop {
  stroke: var(--t-accent);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: .65;
}

#tide .tide-svg-label {
  font: 8px var(--t-mono);
  fill: var(--t-muted);
  letter-spacing: .06em;
}

#tide .tide-rects rect {
  fill: rgba(53, 84, 74, .14);
  stroke: rgba(53, 84, 74, .42);
  stroke-width: .8;
  animation: tideBarIn .34s both;
  animation-delay: calc(var(--i) * 4ms);
}

@keyframes tideBarIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

#tide .tide-parts {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 11px;
  border-top: 1px solid var(--t-line);
}

#tide .tide-parts label {
  flex: 0 0 auto;
  font: 500 7px var(--t-mono);
  letter-spacing: .14em;
  color: var(--t-muted);
  white-space: nowrap;
}

#tide .tide-parts label b {
  display: inline-block;
  min-width: 16px;
  color: var(--t-ink);
  font-weight: 500;
}

#tide .tide-parts input {
  flex: 1 1 auto;
  min-width: 54px;
}

#tide .tide-parts > span {
  flex: 0 0 auto;
  font: italic 400 12px var(--t-serif);
  color: var(--t-muted);
  white-space: nowrap;
}

/* ---------- scene 03 / answer ---------- */

#tide .tide-stage-answer {
  justify-self: end;
  max-width: 520px;
}

#tide .tide-answer-card {
  position: relative;
  width: 100%;
  padding: clamp(17px, 2.5vh, 27px);
  border: 1px solid var(--t-line-strong);
  background: linear-gradient(158deg, rgba(249, 248, 241, .82), rgba(238, 241, 234, .55));
  box-shadow: 0 30px 70px -56px rgba(31, 47, 41, .7);
  transition: border-color .4s ease, background .4s ease;
}

#tide .tide-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font: 500 7px var(--t-mono);
  letter-spacing: .16em;
  color: var(--t-muted);
}

#tide .tide-card-head b {
  font: 400 clamp(21px, 2.3vw, 30px)/1 var(--t-serif);
  letter-spacing: -.02em;
  color: var(--t-ink);
  white-space: nowrap;
}

#tide .tide-answer-graph {
  position: relative;
  height: clamp(118px, 15vh, 164px);
  margin: 12px 0 2px;
}

#tide .tide-answer-graph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#tide .tide-answer-card .tide-area {
  fill: rgba(170, 197, 204, .24);
  transition: fill .85s cubic-bezier(.2, .8, .2, 1);
}

#tide .tide-answer-card.is-correct .tide-area {
  fill: rgba(51, 84, 74, .62);
}

#tide .tide-answer-card .tide-curve {
  transition: stroke .4s ease;
}

#tide .tide-answer-card.is-correct .tide-curve {
  stroke: var(--t-accent);
}

#tide .tide-area-badge {
  position: absolute;
  top: 3%;
  left: 1%;
  font: italic 400 clamp(14px, 1.5vw, 19px)/1 var(--t-serif);
  color: var(--t-muted);
  background: rgba(244, 244, 237, .84);
  padding: 3px 7px;
  transition: color .4s ease, background .4s ease;
}

#tide .tide-answer-card.is-correct .tide-area-badge {
  color: var(--t-deep);
  background: rgba(244, 244, 237, .95);
}

#tide .tide-input-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--t-line-strong);
  transition: border-color .3s ease, box-shadow .3s ease;
}

#tide .tide-input-row:focus-within {
  border-color: var(--t-accent);
  box-shadow: 0 1px 0 0 var(--t-accent);
}

#tide .tide-equals {
  flex: 0 0 auto;
  font: 400 28px/1 var(--t-serif);
  color: var(--t-muted);
}

#tide .tide-input-row input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 clamp(52px, 6.4vw, 82px)/.9 var(--t-serif);
  letter-spacing: -.055em;
  color: var(--t-ink);
  font-variation-settings: 'opsz' 110;
}

#tide .tide-input-row input::placeholder {
  color: rgba(31, 47, 41, .2);
}

#tide .tide-input-row input:focus-visible {
  outline: 2px solid var(--t-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

#tide .tide-input-unit {
  flex: 0 0 auto;
  font: 500 7px var(--t-mono);
  letter-spacing: .13em;
  color: var(--t-muted);
}

#tide .tide-answer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#tide .tide-answer-actions button {
  border-radius: 2px;
  cursor: pointer;
  font: 500 7.5px var(--t-mono);
  letter-spacing: .12em;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

#tide #tideCheck {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding: 10px 13px;
  border: 1px solid var(--t-deep);
  background: var(--t-deep);
  color: #f4f3ea;
}

#tide #tideCheck:hover {
  background: var(--t-ink);
  border-color: var(--t-ink);
}

#tide #tideCheck span {
  font-size: 12px;
  line-height: 1;
}

#tide #tideHint {
  padding: 8px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--t-muted);
  text-decoration: underline;
  text-decoration-color: var(--t-line-strong);
  text-underline-offset: 3px;
}

#tide #tideHint:hover {
  color: var(--t-ink);
}

#tide .tide-result {
  min-height: 2.9em;
  margin: 11px 0 0;
  font: italic 400 clamp(11.5px, .95vw, 13px)/1.5 var(--t-serif);
  color: var(--t-muted);
  transition: color .3s ease;
}

#tide .tide-answer-card.is-wrong .tide-result {
  color: #8b4a34;
}

#tide .tide-answer-card.is-correct .tide-result {
  color: var(--t-deep);
}

#tide .tide-answer-card.is-wrong {
  border-color: rgba(139, 74, 52, .48);
}

#tide .tide-hint {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--t-line);
  color: var(--t-ink-soft);
}

#tide .tide-hint > span {
  display: block;
  margin-bottom: 5px;
  font: 500 6.5px var(--t-mono);
  letter-spacing: .18em;
  color: var(--t-accent);
}

#tide .tide-hint ol {
  margin: 0;
  padding-left: 16px;
  font: 400 11px/1.55 var(--t-sans);
}

#tide .tide-hint li {
  margin: 3px 0;
}

#tide .tide-hint b {
  font-weight: 600;
  color: var(--t-ink);
}

#tide .tide-answer-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--t-accent);
  font: 500 7.5px var(--t-mono);
  letter-spacing: .14em;
  cursor: pointer;
}

#tide .tide-answer-next span {
  font: 400 13px var(--t-serif);
  transition: transform .25s ease;
}

#tide .tide-answer-next:hover span {
  transform: translateX(3px);
}

/* ---------- scene 04 / pause ---------- */

#tide .tide-stage-pause {
  justify-self: end;
  max-width: 480px;
}

#tide .tide-pause-card {
  position: relative;
  width: 100%;
  padding: clamp(17px, 2.5vh, 26px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 20px);
  border: 1px solid var(--t-line-strong);
  background: linear-gradient(155deg, rgba(249, 248, 241, .78), rgba(236, 240, 233, .48));
  box-shadow: 0 30px 70px -56px rgba(31, 47, 41, .65);
}

#tide .tide-pause-ring {
  position: relative;
  width: min(100%, 214px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 48% 43%, rgba(195, 216, 220, .6), rgba(195, 216, 220, 0) 67%);
}

#tide .tide-pause-ring::before,
#tide .tide-pause-ring::after,
#tide .tide-pause-ring > i {
  content: "";
  position: absolute;
  border: 1px solid var(--t-line);
  border-radius: 50%;
}

#tide .tide-pause-ring::before { inset: 0; }
#tide .tide-pause-ring::after { inset: 13%; border-color: var(--t-line-strong); }
#tide .tide-pause-ring > i:nth-of-type(1) { inset: 27%; }
#tide .tide-pause-ring > i:nth-of-type(2) { inset: 39%; border-color: rgba(163, 78, 51, .5); }
#tide .tide-pause-ring > i:nth-of-type(3) {
  inset: 30%;
  border: 0;
  background: var(--t-deep);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(31, 47, 41, .14), inset 0 0 26px rgba(255, 255, 255, .06);
}

#tide .tide-pause-ring > div {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #f4f3ea;
}

#tide .tide-pause-ring b {
  font: 400 clamp(26px, 2.6vw, 34px)/1 var(--t-serif);
  letter-spacing: -.04em;
}

#tide .tide-pause-ring span {
  font: 400 10px var(--t-mono);
  vertical-align: super;
}

#tide .tide-pause-ring em {
  display: block;
  margin-top: 2px;
  font: 500 5.5px var(--t-mono);
  font-style: normal;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(244, 243, 234, .8);
}

#tide .tide-pause-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--t-line);
  border-bottom: 1px solid var(--t-line);
}

#tide .tide-pause-stats div {
  padding: 9px 4px;
  text-align: center;
  border-right: 1px solid var(--t-line);
}

#tide .tide-pause-stats div:last-child {
  border-right: 0;
}

#tide .tide-pause-stats span {
  display: block;
  margin-bottom: 4px;
  font: 500 6px var(--t-mono);
  letter-spacing: .14em;
  color: var(--t-muted);
}

#tide .tide-pause-stats b {
  font: 400 18px/1 var(--t-serif);
  color: var(--t-ink);
}

#tide .tide-finish {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--t-accent);
  background: var(--t-accent);
  color: #fbf6ee;
  font: 500 7.5px var(--t-mono);
  letter-spacing: .16em;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease;
}

#tide .tide-finish:hover {
  background: #8e412b;
  border-color: #8e412b;
}

#tide .tide-finish span {
  font: 400 16px var(--t-serif);
  transition: transform .25s ease;
}

#tide .tide-finish:hover span {
  transform: translate(2px, -2px);
}

#tide .tide-finale {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: tideFinaleIn .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes tideFinaleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

#tide .tide-finale-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

#tide .tide-finale-head i {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--t-deep);
  color: #f4f3ea;
  font: 400 12px var(--t-sans);
  font-style: normal;
}

#tide .tide-finale-head b {
  display: block;
  font: 400 17px/1.1 var(--t-serif);
  color: var(--t-ink);
}

#tide .tide-finale-head span {
  display: block;
  margin-top: 2px;
  font: 400 6.5px var(--t-mono);
  letter-spacing: .1em;
  color: var(--t-muted);
}

#tide .tide-finale-note {
  margin: 0;
  font: italic 400 11.5px/1.4 var(--t-serif);
  color: var(--t-muted);
}

#tide .tide-next-theme {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--t-line);
}

#tide .tide-next-theme > span {
  font: 500 6.5px var(--t-mono);
  letter-spacing: .16em;
  color: var(--t-accent);
}

#tide .tide-next-theme > b {
  font: 400 19px/1.1 var(--t-serif);
  color: var(--t-ink);
}

#tide .tide-next-theme > em {
  font: 400 7px var(--t-mono);
  font-style: normal;
  letter-spacing: .08em;
  color: var(--t-muted);
}

#tide .tide-next-theme button {
  justify-self: start;
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid var(--t-accent);
  border-radius: 2px;
  background: var(--t-accent);
  color: #fbf6ee;
  font: 500 7px var(--t-mono);
  letter-spacing: .1em;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

#tide .tide-next-theme button:hover {
  background: #8e412b;
  border-color: #8e412b;
  color: #f4f3ea;
}

#tide .tide-next-theme button:disabled,
#tide .tide-next-theme button[aria-disabled="true"] {
  cursor: default;
  background: var(--t-deep);
  border-color: var(--t-deep);
  color: #f4f3ea;
  opacity: .78;
}

#tide .tide-next-theme p {
  min-height: 1em;
  margin: 3px 0 0;
  font: italic 400 10px var(--t-serif);
  color: var(--t-deep);
}

#tide .tide-restart {
  align-self: start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--t-muted);
  font: 500 6.5px var(--t-mono);
  letter-spacing: .1em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#tide .tide-restart:hover {
  color: var(--t-ink);
}

#tide.is-finished .tide-pause-ring {
  display: none;
}

#tide.is-finished .tide-pause-card {
  gap: 10px;
}

/* ---------- gauge ---------- */

#tide .tide-gauge {
  position: absolute;
  z-index: 8;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--t-muted);
  pointer-events: none;
}

#tide .tide-gauge > span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 6px var(--t-mono);
  letter-spacing: .24em;
  color: var(--t-muted);
}

#tide .tide-gauge-track {
  position: relative;
  width: 10px;
  height: clamp(120px, 19vh, 180px);
}

#tide .tide-gauge-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--t-line);
}

#tide .tide-gauge-fill {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 25%;
  transform: translateX(-50%);
  background: var(--t-accent);
  transition: height .8s cubic-bezier(.22, .75, .18, 1);
}

#tide .tide-gauge-fill::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--t-accent);
  box-shadow: 0 0 0 3px rgba(163, 78, 51, .12);
}

#tide .tide-gauge-track b {
  position: absolute;
  left: 50%;
  bottom: var(--at);
  width: 7px;
  height: 1px;
  transform: translateX(-50%);
  background: var(--t-line-strong);
}

#tide .tide-gauge strong {
  font: 400 8px var(--t-mono);
  letter-spacing: .08em;
  color: var(--t-ink-soft);
}

/* ---------- footer navigation ---------- */

#tide .tide-controls {
  position: relative;
  z-index: 20;
  flex: 0 0 var(--t-foot);
  height: var(--t-foot);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--t-pad);
  border-top: 1px solid var(--t-line);
  background: linear-gradient(0deg, rgba(240, 242, 235, .74), rgba(240, 242, 235, 0));
}

#tide .tide-nav {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 20px);
}

#tide .tide-arrow {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--t-line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--t-ink);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}

#tide .tide-arrow span {
  font: 400 14px/1 var(--t-sans);
}

#tide .tide-arrow:hover {
  background: var(--t-ink);
  border-color: var(--t-ink);
  color: #f4f3ea;
}

#tide .tide-arrow:active {
  transform: scale(.94);
}

#tide .tide-dots {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
}

#tide .tide-dot {
  width: 24px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#tide .tide-dot i {
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid var(--t-line-strong);
  border-radius: 999px;
  background: transparent;
  transition: width .35s ease, background .35s ease, border-color .35s ease;
}

#tide .tide-dot:hover i {
  background: var(--t-line-strong);
}

#tide .tide-dot i.active {
  width: 19px;
  background: var(--t-accent);
  border-color: var(--t-accent);
}

#tide .tide-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 92px;
  color: var(--t-muted);
}

#tide .tide-counter b {
  font: 500 8px var(--t-mono);
  letter-spacing: .07em;
  color: var(--t-ink-soft);
  white-space: nowrap;
}

#tide .tide-counter span {
  font: italic 400 12px var(--t-serif);
  color: var(--t-muted);
  white-space: nowrap;
}

#tide .tide-nav-keys {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  color: var(--t-muted);
}

#tide .tide-nav-keys kbd {
  font: 400 6.5px var(--t-mono);
  border: 1px solid var(--t-line);
  border-radius: 2px;
  padding: 2px 4px;
}

/* ---------- calm ---------- */

#tide.calm .tide-wash {
  filter: saturate(.55) contrast(.98);
}

#tide.calm .tide-wash i {
  animation-play-state: paused;
  opacity: .26;
}

#tide.calm .tide-grain {
  opacity: .035;
}

#tide.calm .tide-ghost {
  opacity: .55;
}

#tide.calm .tide-basin,
#tide.calm .tide-basin > i,
#tide.calm .tide-pause-ring > i {
  animation-play-state: paused;
}

#tide.calm .tide-sweep {
  display: none;
}

#tide.calm .tide-riemann-head b {
  transition: none;
}

#tide.calm .tide-rects rect {
  animation: none;
}

#tide.calm .tide-progress i {
  background: var(--t-deep);
}

#tide.calm .tide-gauge-fill {
  background: var(--t-deep);
}

#tide.calm .tide-gauge-fill::before {
  background: var(--t-deep);
  box-shadow: 0 0 0 3px rgba(51, 84, 74, .12);
}

/* ---------- responsive ---------- */

@media (max-width: 1050px) {
  #tide .tide-text h1 {
    font-size: calc(clamp(48px, 6.3vw, 82px) * var(--tide-scale, 1));
  }

  #tide .tide-scene-main {
    gap: clamp(24px, 4vw, 54px);
  }

  #tide .tide-gauge {
    right: 14px;
  }
}

@media (max-width: 900px) {
  #tide {
    --t-head: 58px;
    --t-foot: 68px;
    height: calc(100vh - 64px);
    min-height: 640px;
  }

  #tide .tide-scene-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
    align-items: start;
  }

  #tide .tide-stage {
    justify-self: end;
    align-self: end;
    max-width: 480px;
  }

  #tide .tide-stage-basin {
    max-width: 400px;
  }

  #tide .tide-basin {
    width: min(100%, calc(330px * var(--tide-scale, 1)));
  }

  #tide .tide-stage-caption {
    max-width: calc(330px * var(--tide-scale, 1));
  }

  #tide .tide-text h1 {
    font-size: calc(clamp(44px, 6.4vw, 70px) * var(--tide-scale, 1));
    max-width: 12ch;
  }

  #tide .tide-gauge {
    display: none;
  }

  #tide .tide-ghost {
    font-size: calc(clamp(150px, 28vw, 220px) * var(--tide-scale, 1));
    top: -5%;
  }

  #tide .tide-riemann-svg {
    max-height: 30vh;
  }

  #tide .tide-answer-graph {
    height: clamp(96px, 13vh, 130px);
  }
}

@media (max-width: 620px) {
  #tide {
    --t-head: 54px;
    --t-foot: 60px;
    --t-pad: 18px;
    height: calc(100vh - 64px);
    min-height: 560px;
  }

  #tide .tide-head-inner {
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    padding: 0 18px;
  }

  #tide .tide-head-center {
    display: block;
  }

  #tide .tide-head-center p {
    display: none;
  }

  #tide .tide-mode-note {
    min-height: 0;
    margin: 0;
    font-size: 9px;
    white-space: nowrap;
    text-align: center;
  }

  #tide .tide-head-tools {
    grid-column: 3;
    gap: 10px;
  }

  #tide .tide-brand {
    font-size: 10px;
    gap: 7px;
  }

  #tide .tide-brand span {
    width: 20px;
    height: 20px;
  }

  #tide .tide-scale-label {
    display: inline;
    font-size: 5.5px;
    letter-spacing: .12em;
  }

  #tide .tide-scale {
    gap: 6px;
  }

  #tide .tide-scale input {
    width: 60px;
  }

  #tide .tide-scale b {
    min-width: 29px;
    font-size: 7px;
  }

  #tide .tide-head button {
    padding: 6px 9px;
    font-size: 7px;
  }

  #tide .tide-scene-inner {
    padding: 14px 18px 8px;
    gap: 9px;
  }

  #tide .tide-scene-meta {
    font-size: 7px;
  }

  #tide .tide-kicker {
    gap: 8px;
  }

  #tide .tide-kicker b {
    width: 22px;
    height: 22px;
    font-size: 7px;
  }

  #tide .tide-kicker i {
    width: 17px;
  }

  #tide .tide-ghost {
    font-size: calc(clamp(112px, 31vw, 150px) * var(--tide-scale, 1));
    top: -3%;
    right: -2%;
  }

  #tide .tide-scene-main {
    gap: 8px;
  }

  #tide .tide-text h1 {
    font-size: calc(clamp(38px, 11.7vw, 54px) * var(--tide-scale, 1));
    line-height: .9;
    letter-spacing: -.055em;
    max-width: 11ch;
    margin-bottom: 9px;
  }

  #tide .tide-text p {
    font-size: 11.5px;
    line-height: 1.55;
    max-width: 32ch;
  }

  #tide .tide-text-foot {
    display: none;
  }

  #tide .tide-formula {
    margin-top: 10px;
    font-size: 14px;
    gap: 7px;
  }

  #tide .tide-task-formula {
    margin-top: 10px;
    font-size: 21px;
    padding-top: 7px;
  }

  #tide .tide-stage {
    max-width: none;
    width: 100%;
    align-self: center;
  }

  #tide .tide-text-compact h1 {
    max-width: 11ch;
    font-size: calc(clamp(34px, 10vw, 44px) * var(--tide-scale, 1));
  }

  #tide .tide-basin {
    width: min(100%, calc(224px * var(--tide-scale, 1)));
    margin-right: 4px;
  }

  #tide .tide-stage-caption {
    display: none;
  }

  #tide .tide-scene-foot {
    font-size: 6.5px;
  }

  #tide .tide-keys-hint {
    display: none;
  }

  #tide .tide-swipe {
    display: inline;
  }

  #tide .tide-riemann {
    padding-top: 9px;
  }

  #tide .tide-riemann-head {
    font-size: 6.5px;
  }

  #tide .tide-riemann-head b {
    font-size: 19px;
  }

  #tide .tide-riemann-svg {
    max-height: 27vh;
    margin-top: 4px;
  }

  #tide .tide-parts {
    gap: 9px;
    padding: 8px 0 9px;
  }

  #tide .tide-parts label {
    font-size: 6.5px;
  }

  #tide .tide-parts > span {
    font-size: 10px;
  }

  #tide .tide-answer-card {
    padding: 13px;
  }

  #tide .tide-card-head {
    font-size: 6.5px;
  }

  #tide .tide-card-head b {
    font-size: 21px;
  }

  #tide .tide-answer-graph {
    height: 92px;
    margin: 8px 0 0;
  }

  #tide .tide-input-row {
    gap: 7px;
    padding-bottom: 5px;
  }

  #tide .tide-input-row input {
    font-size: clamp(48px, 14vw, 62px);
  }

  #tide .tide-equals {
    font-size: 22px;
  }

  #tide .tide-answer-actions {
    margin-top: 10px;
  }

  #tide #tideCheck {
    gap: 16px;
    padding: 9px 11px;
  }

  #tide .tide-result {
    min-height: 2.6em;
    margin-top: 8px;
    font-size: 11px;
  }

  #tide .tide-hint ol {
    font-size: 10px;
  }

  #tide .tide-pause-card {
    padding: 12px 13px;
    gap: 9px;
  }

  #tide .tide-pause-ring {
    width: 132px;
  }

  #tide .tide-pause-ring b {
    font-size: 24px;
  }

  #tide .tide-pause-ring em {
    font-size: 5px;
  }

  #tide .tide-pause-stats div {
    padding: 6px 2px;
  }

  #tide .tide-pause-stats b {
    font-size: 15px;
  }

  #tide .tide-finish {
    padding: 11px 12px;
  }

  #tide .tide-finale {
    gap: 8px;
  }

  #tide .tide-finale-head b {
    font-size: 15px;
  }

  #tide .tide-next-theme > b {
    font-size: 17px;
  }

  #tide .tide-restart {
    padding: 8px 0;
    font-size: 7.5px;
  }

  #tide .tide-controls {
    padding: 0 14px;
  }

  #tide .tide-nav {
    width: 100%;
    justify-content: space-between;
    gap: 7px;
  }

  #tide .tide-arrow {
    width: 33px;
    height: 33px;
    flex: 0 0 auto;
  }

  #tide .tide-dots {
    gap: 0;
  }

  #tide .tide-dot {
    width: 24px;
    height: 32px;
  }

  #tide .tide-counter {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
    gap: 5px;
  }

  #tide .tide-counter b {
    font-size: 7px;
  }

  #tide .tide-counter span {
    font-size: 11px;
  }

  #tide .tide-nav-keys {
    display: none;
  }

  #tide .tide-sweep::before {
    left: -20%;
    width: 140%;
  }
}

@media (max-width: 380px) {
  #tide .tide-counter span {
    display: none;
  }

  #tide .tide-head-center {
    display: none;
  }

  #tide .tide-scale-label {
    display: none;
  }

  #tide .tide-scale input {
    width: 54px;
  }

  #tide .tide-text h1 {
    font-size: calc(clamp(35px, 11.2vw, 46px) * var(--tide-scale, 1));
  }
}

@media (max-height: 720px) and (max-width: 620px) {
  #tide {
    --t-head: 52px;
    --t-foot: 58px;
  }

  #tide .tide-scene-inner {
    padding: 10px 16px 6px;
    gap: 6px;
  }

  #tide .tide-scene-foot {
    display: none;
  }

  #tide .tide-scene-meta {
    font-size: 6.5px;
  }

  #tide .tide-kicker {
    gap: 7px;
  }

  #tide .tide-kicker b {
    width: 20px;
    height: 20px;
    font-size: 6.5px;
  }

  #tide .tide-text h1 {
    font-size: calc(clamp(34px, 10.2vw, 44px) * var(--tide-scale, 1));
    margin-bottom: 7px;
  }

  #tide .tide-text-compact h1 {
    font-size: calc(clamp(30px, 9.2vw, 39px) * var(--tide-scale, 1));
  }

  #tide .tide-text p {
    font-size: 10.8px;
    line-height: 1.45;
  }

  #tide .tide-formula {
    margin-top: 8px;
    font-size: 13px;
  }

  #tide .tide-task-formula {
    margin-top: 8px;
    padding-top: 6px;
    font-size: 19px;
  }

  #tide .tide-riemann {
    padding-top: 6px;
  }

  #tide .tide-riemann-svg {
    max-height: 23vh;
    margin-top: 3px;
  }

  #tide .tide-parts {
    padding: 4px 0 5px;
  }

  #tide .tide-answer-card {
    padding: 11px 12px;
  }

  #tide .tide-answer-graph {
    height: 76px;
    margin: 5px 0 0;
  }

  #tide .tide-input-row input {
    font-size: 46px;
  }

  #tide .tide-answer-actions {
    margin-top: 8px;
  }

  #tide .tide-result {
    min-height: 2.1em;
    margin-top: 5px;
    font-size: 10.5px;
  }

  #tide .tide-hint {
    margin-top: 6px;
    padding-top: 6px;
  }

  #tide .tide-hint ol {
    font-size: 9.5px;
  }

  #tide .tide-pause-card {
    gap: 7px;
    padding: 11px 12px;
  }

  #tide .tide-pause-ring {
    width: 112px;
  }

  #tide .tide-pause-stats div {
    padding: 5px 2px;
  }

  #tide .tide-finish {
    padding: 9px 11px;
  }
}

@media (max-height: 600px) and (max-width: 620px) {
  #tide {
    min-height: 0;
  }

  #tide .tide-scene-inner {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  #tide .tide-scene-inner::-webkit-scrollbar {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  #tide .tide-text-foot {
    display: none;
  }

  #tide .tide-scene-inner {
    padding-top: 18px;
    padding-bottom: 12px;
    gap: 8px;
  }

  #tide .tide-text h1 {
    font-size: calc(clamp(46px, 5.1vw, 76px) * var(--tide-scale, 1));
  }

  #tide .tide-basin {
    width: min(88%, calc(330px * var(--tide-scale, 1)));
  }

  #tide .tide-stage-caption {
    max-width: calc(330px * var(--tide-scale, 1));
  }

  #tide .tide-pause-ring {
    width: 136px;
  }

  #tide .tide-pause-card {
    gap: 8px;
    padding: 14px;
  }

  #tide .tide-answer-graph {
    height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tide .tide-wash i,
  #tide .tide-basin,
  #tide .tide-basin > i,
  #tide .tide-pause-ring > i,
  #tide .tide-rects rect {
    animation: none !important;
  }

  #tide .tide-sweep {
    display: none !important;
  }

  #tide.active {
    animation: none !important;
  }

  #tide .tide-deck,
  #tide .tide-progress i,
  #tide .tide-gauge-fill,
  #tide .tide-scene-meta,
  #tide .tide-text,
  #tide .tide-stage,
  #tide .tide-scene-foot,
  #tide .tide-finale {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }

  #tide.is-ready .tide-scene:not(.is-current) .tide-scene-meta,
  #tide.is-ready .tide-scene:not(.is-current) .tide-text,
  #tide.is-ready .tide-scene:not(.is-current) .tide-stage,
  #tide.is-ready .tide-scene:not(.is-current) .tide-scene-foot {
    transform: none;
    opacity: 0;
  }
}
