/* pomo.gtll.app — Coastal Carolina focus timer
 *
 * Palette is the OFFICIAL CCU brand guide (2024), verified from
 * coastal.edu's own PDF — teal Pantone 322 #006F71, bronze Pantone 875 #A27752.
 * Do not "improve" these hexes.
 *
 * Spacing runs on the golden ratio per GTLL build canon: each step is
 * the previous x1.618, so the vertical rhythm is proportional, not ad-hoc px.
 */

:root {
  /* --- CCU official --- */
  --teal:        #006F71;
  --teal-lift:   #0A8A8C;
  --teal-deep:   #00494B;
  --bronze:      #A27752;
  --bronze-lift: #C4986B;
  --gray:        #A1A1A4;
  --ink:         #111111;

  /* --- derived surface tones (ours, not brand-claimed) --- */
  --bg:          #05201F;
  --bg-2:        #08302F;
  --card:        rgba(255,255,255,0.045);
  --edge:        rgba(255,255,255,0.10);
  --text:        #EAF4F3;
  --text-dim:    #9DB8B6;

  /* --- φ spacing scale (1.618) --- */
  --s1: 0.382rem;
  --s2: 0.618rem;
  --s3: 1rem;
  --s4: 1.618rem;
  --s5: 2.618rem;
  --s6: 4.236rem;
  --s7: 6.854rem;

  --r:  14px;
  --ring: 268px;         /* dial diameter */
}




* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(10,138,140,0.30), transparent 62%),
    radial-gradient(760px 460px at 88% 108%, rgba(162,119,82,0.16), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  transition: background 900ms ease;
}

/* Phase tints the whole room. Focus = teal. Breaks warm toward bronze,
   so the mode change is felt peripherally, not just read. */
body[data-phase="short"], body[data-phase="long"] {
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(196,152,107,0.26), transparent 62%),
    radial-gradient(760px 460px at 12% 108%, rgba(10,138,140,0.14), transparent 60%),
    linear-gradient(180deg, #1B1712 0%, #241D15 100%);
}

/* ---------- tide line: horizon rule under the header ---------- */
.tide {
  position: fixed; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal-lift), var(--bronze), transparent);
  opacity: .5; z-index: 5;
}

header {
  width: 100%; max-width: 940px;
  padding: var(--s4) var(--s3) 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
}

.brand { display: flex; align-items: center; gap: var(--s2); }
.brand .mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  color: var(--bronze-lift);
}
.brand h1 {
  font-size: 1.02rem; font-weight: 650; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text);
}
.brand .sub {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 2px;
}

main {
  width: 100%; max-width: 940px;
  padding: var(--s4) var(--s3) var(--s6);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s4);
  flex: 1;
}

/* ---------- phase tabs ---------- */
.phases {
  display: flex; gap: var(--s1);
  background: rgba(0,0,0,.24);
  border: 1px solid var(--edge);
  padding: var(--s1); border-radius: 999px;
}
.phases button {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 560;
  letter-spacing: .04em;
  color: var(--text-dim);
  background: transparent;
  padding: var(--s2) var(--s4);
  border-radius: 999px;
  transition: background 220ms ease, color 220ms ease;
}
.phases button:hover { color: var(--text); }
.phases button[aria-selected="true"] {
  background: var(--teal); color: #fff;
}
body[data-phase="short"] .phases button[aria-selected="true"],
body[data-phase="long"]  .phases button[aria-selected="true"] {
  background: var(--bronze);
}

/* ---------- the dial ---------- */
.dial { position: relative; width: var(--ring); height: var(--ring); }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { stroke: rgba(255,255,255,.09); }
.dial .prog {
  stroke: var(--teal-lift);
  stroke-linecap: round;
  transition: stroke-dashoffset 260ms linear, stroke 700ms ease;
  filter: drop-shadow(0 0 9px rgba(10,138,140,.55));
}
body[data-phase="short"] .dial .prog,
body[data-phase="long"]  .dial .prog {
  stroke: var(--bronze-lift);
  filter: drop-shadow(0 0 9px rgba(196,152,107,.5));
}

.readout {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.clock {
  font-variant-numeric: tabular-nums;   /* digits never reflow */
  font-size: 3.5rem; font-weight: 300; letter-spacing: -.02em;
  line-height: 1;
}
.phase-name {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-dim);
}
.rounds { font-size: .72rem; color: var(--text-dim); letter-spacing: .06em; }

/* ---------- task field ---------- */
.task-wrap { width: 100%; max-width: 460px; }
.task-wrap label {
  display: block; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: var(--s2);
}
.task-wrap input {
  width: 100%; font: inherit; font-size: .98rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: var(--s3);
  transition: border-color 200ms ease, background 200ms ease;
}
.task-wrap input::placeholder { color: rgba(157,184,182,.55); }
.task-wrap input:focus {
  outline: none;
  border-color: var(--teal-lift);
  background: rgba(255,255,255,.07);
}

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: var(--s3); }
.btn {
  appearance: none; cursor: pointer; font: inherit;
  border-radius: 999px; border: 1px solid transparent;
  transition: transform 140ms ease, background 200ms ease, border-color 200ms ease, opacity 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--teal); color: #fff;
  font-size: 1.02rem; font-weight: 620; letter-spacing: .1em;
  text-transform: uppercase;
  padding: var(--s3) var(--s6);
  box-shadow: 0 8px 26px rgba(0,111,113,.4);
}
.btn-primary:hover { background: var(--teal-lift); }
body[data-phase="short"] .btn-primary,
body[data-phase="long"]  .btn-primary {
  background: var(--bronze); box-shadow: 0 8px 26px rgba(162,119,82,.36);
}
body[data-phase="short"] .btn-primary:hover,
body[data-phase="long"]  .btn-primary:hover { background: var(--bronze-lift); }

.btn-ghost {
  background: transparent; border-color: var(--edge); color: var(--text-dim);
  padding: var(--s2) var(--s4); font-size: .8rem; letter-spacing: .06em;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* ---------- panels ---------- */
.panel {
  width: 100%; max-width: 620px;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: var(--s4);
}
.panel h2 {
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: var(--s3); font-weight: 600;
}
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); padding: var(--s2) 0;
}
.row + .row { border-top: 1px solid rgba(255,255,255,.05); }
.row .label { font-size: .9rem; }
.row .hint { font-size: .74rem; color: var(--text-dim); margin-top: 2px; line-height: 1.45; }

select, input[type="number"] {
  font: inherit; font-size: .88rem; color: var(--text);
  background: rgba(0,0,0,.3);
  border: 1px solid var(--edge); border-radius: 9px;
  padding: var(--s1) var(--s2);
}
select:focus, input[type="number"]:focus { outline: none; border-color: var(--teal-lift); }
input[type="range"] { accent-color: var(--teal-lift); width: 128px; }

/* toggle */
.switch { position: relative; width: 44px; height: 25px; flex: 0 0 44px; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,.14); transition: background 220ms ease;
  pointer-events: none;
}
.switch .slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; transition: transform 220ms cubic-bezier(.34,1.56,.64,1);
}
.switch input:checked + .slider { background: var(--teal-lift); }
.switch input:checked + .slider::after { transform: translateX(19px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(10,138,140,.45); }

/* ---------- honesty note ---------- */
.disclosure {
  font-size: .74rem; line-height: 1.6; color: var(--text-dim);
  border-left: 2px solid var(--bronze); padding-left: var(--s3); margin-top: var(--s3);
}

footer {
  width: 100%; max-width: 940px; padding: var(--s4) var(--s3) var(--s5);
  text-align: center; font-size: .74rem; color: var(--text-dim); line-height: 1.7;
}
footer .chant { color: var(--bronze-lift); letter-spacing: .06em; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--teal-lift); outline-offset: 3px; border-radius: 6px; }

@media (max-width: 560px) {
  :root { --ring: 224px; }
  .clock { font-size: 2.9rem; }
  .btn-primary { padding: var(--s3) var(--s5); }
  header { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
