/* ==============================================================
   BREATH TIDE · page styles
   File: /breath-tide/breath-tide.css
   Colours, font and buttons come from site.css.
   The "How it helps" section uses shared styles (site.css, section 13).

   Sections:
     1  Sea and sand colours (also used by the canvas)
     2  The shore (canvas, intro, guidance)
     3  Controls panel: patterns, length, session
   ============================================================== */


/* --------------------------------------------------------------
   1 · SEA AND SAND COLOURS
   Written as "r, g, b" because the canvas mixes them with
   transparency. breath-tide.js reads them from here.
   -------------------------------------------------------------- */
:root {
  --sea-far: 122, 163, 176;
  --sea-mid: 88, 142, 152;
  --shallow: 118, 190, 188;
  --sand: 236, 222, 196;
  --sand-dark: 216, 199, 168;
  --sand-wet: 196, 176, 144;
  --foam: 255, 255, 255;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sea-far: 58, 84, 98;
    --sea-mid: 44, 74, 86;
    --shallow: 72, 118, 122;
    --sand: 122, 110, 92;
    --sand-dark: 100, 90, 74;
    --sand-wet: 82, 74, 62;
    --foam: 214, 228, 230;
  }
}


/* --------------------------------------------------------------
   2 · THE SHORE
   -------------------------------------------------------------- */
.shore {
  position: relative;
  height: clamp(560px, 86svh, 900px);
  overflow: hidden;
  background: var(--c-sky-top);
}
.shore canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.shore__intro {
  position: relative;
  z-index: 2;
  padding-top: clamp(1.5rem, 5vw, 3.5rem);
  transition: opacity .8s ease, transform .8s ease;
}
.shore__title {
  margin-bottom: .3em;
  font-size: var(--step-3);
  font-weight: var(--weight-light);
  letter-spacing: -.025em;
}
.shore__lede {
  max-width: 30rem;
  margin-bottom: 1.4rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  line-height: 1.45;
}

/* While breathing, the intro steps aside for the guidance */
.shore.is-breathing .shore__intro {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.guide {
  position: absolute;
  inset: clamp(1.5rem, 6vh, 4rem) 0 auto 0;
  z-index: 3;
  text-align: center;
  animation: guide-in .8s ease both;
}
.guide__phase {
  font-size: var(--step-3);
  font-weight: var(--weight-light);
  letter-spacing: -.02em;
  line-height: 1.05;
}
.guide__count {
  min-height: 1.6em;
  margin-top: .35rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  font-variant-numeric: tabular-nums;
}
.guide__hint {
  margin-top: .25rem;
  color: var(--muted);
}
@keyframes guide-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .shore__lede { font-size: 1.1rem; margin-bottom: 1rem; }
}


/* --------------------------------------------------------------
   3 · CONTROLS PANEL
   -------------------------------------------------------------- */
.breath-panel {
  position: relative;
  z-index: 5;
  max-width: 46rem;
  margin: -5rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.breath-panel:focus { outline: none; }

.setup__note {
  margin-bottom: 1.25rem;
  color: var(--muted);
}

.choice {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
}
.choice legend {
  padding: 0;
  margin-bottom: .75rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
}

/* Pattern cards */
.choice__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: .6rem;
}
.choice__card {
  position: relative;
  display: grid;
  align-content: start;
  gap: .1rem;
  padding: .85rem 1rem .9rem 2.6rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.choice__card input {
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
}
.choice__name { font-weight: var(--weight-strong); }
.choice__timing { font-size: var(--step--1); color: var(--accent); font-variant-numeric: tabular-nums; }
.choice__about { margin-top: .2rem; font-size: .95rem; color: var(--muted); line-height: 1.45; }

/* Length pills */
.choice__row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.choice__pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding: .45rem 1.1rem .45rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.choice__pill input { margin: 0; accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }

.choice__card:has(input:checked),
.choice__pill:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.choice__card:has(input:focus-visible),
.choice__pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.breath-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* During a session */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .5s linear;
}
.session__info {
  margin: .9rem 0 1.1rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  font-variant-numeric: tabular-nums;
}
.session__tip {
  margin-top: 1rem;
  font-size: var(--step--1);
  color: var(--muted);
}
@media (pointer: coarse) {
  .session__tip { display: none; }
}

.breath-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.breath-status {
  min-height: 1.65em;
  margin-top: 1rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .breath-panel { margin-inline: .75rem; }
  .breath-actions .btn { flex: 1 1 100%; }
}
