:root {
  --bg: #050507;
  --card: rgba(255, 255, 255, 0.045);
  --card-hi: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --fg: #f5f5f7;
  --dim: #a3a3ad;
  --faint: #5e5e69;
  --green: #3fb950;
  --serif: ui-serif, 'New York', Georgia, serif;
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body {
  background: radial-gradient(120% 90% at 50% 0%, #0b0d13 0%, #050507 60%);
  color: var(--fg);
  font: 16px/1.5 -apple-system, 'SF Pro Text', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* living background */
#aurora { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; }
#grain {
  position: fixed; inset: -50%;
  z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}

main {
  position: relative; z-index: 2;
  max-width: 860px;
  margin: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 34px) 24px
           calc(env(safe-area-inset-bottom, 0px) + 56px);
}

/* ---- hero ---- */
#hero { text-align: center; padding: 26px 0 10px; }
#date {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: .5px;
  line-height: 1.12;
}
#focus {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--dim);
  margin: 14px auto 30px;
  max-width: 560px;
}
#ring-wrap { position: relative; width: 132px; height: 132px; margin: 0 auto; }
#ring { width: 132px; height: 132px; transform: rotate(-90deg); }
#ring circle { fill: none; stroke-width: 5; }
#ring .track { stroke: rgba(255,255,255,.08); }
#ring .fill {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1), stroke .6s;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.45));
}
#ring.complete .fill { stroke: var(--green); filter: drop-shadow(0 0 10px rgba(63,185,80,.5)); }
#ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
#ring-label b { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
#ring-label span { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---- sections ---- */
h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3.5px;
  color: var(--faint);
  margin: 40px 0 14px 2px;
}

/* ---- priorities ---- */
#prio-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 620px) { #prio-list { grid-template-columns: 1fr; } }
.prio {
  position: relative;
  background: linear-gradient(160deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 18px 18px 16px;
  cursor: pointer;
  display: flex; gap: 14px; align-items: flex-start;
  transition: transform .18s, background .3s, border-color .3s;
}
.prio:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.16); }
.prio:active { transform: scale(.985); }
.prio.done { background: var(--card); }
.prio.done .ptext { opacity: .38; text-decoration: line-through; text-decoration-thickness: 1px; }
.prio .carry { position: absolute; top: 10px; right: 14px; font-size: 11px; color: var(--faint); }
.ptext { font-size: 15px; line-height: 1.45; }

/* ticks */
.tick {
  width: 24px; height: 24px;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  flex: none; margin-top: 1px;
  position: relative;
  transition: border-color .2s, background .25s;
}
.done > .tick, .tl-row.done .tick {
  background: var(--green); border-color: var(--green);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 14px rgba(63,185,80,.4);
}
.done > .tick::after, .tl-row.done .tick::after {
  content: ''; position: absolute; left: 7px; top: 3.5px;
  width: 6px; height: 11px;
  border: solid #04130a; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---- timeline ---- */
#tl { position: relative; padding-left: 86px; }
#tl::before {
  content: '';
  position: absolute; left: 72px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line) 8%, var(--line) 92%, transparent);
}
.tl-row {
  position: relative;
  display: flex; gap: 13px; align-items: flex-start;
  padding: 11px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
}
.tl-row.work {
  background: linear-gradient(160deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 26px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  cursor: pointer;
  transition: transform .18s, border-color .3s;
}
.tl-row.work:hover { transform: translateX(2px); border-color: rgba(255,255,255,.16); }
.tl-row.work.done .ttext { opacity: .38; text-decoration: line-through; text-decoration-thickness: 1px; }
.tl-row.routine { color: var(--faint); font-size: 14px; padding: 7px 14px; }
.tl-time {
  position: absolute; left: -86px; width: 64px;
  text-align: right;
  font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
  top: 13px;
}
.tl-row.routine .tl-time { top: 9px; }
.tl-dot {
  position: absolute; left: -17.5px; top: 17px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint);
}
.tl-row.done .tl-dot { background: var(--green); }
.ttext { font-size: 15px; line-height: 1.45; }
#now-line {
  position: absolute; left: 60px; right: 0;
  height: 1px; background: rgba(255,255,255,.55);
  box-shadow: 0 0 8px rgba(255,255,255,.6);
  z-index: 3; pointer-events: none;
}
#now-line::before {
  content: ''; position: absolute; left: 9px; top: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.9);
}

/* ---- closing ---- */
#closing { margin-top: 46px; text-align: center; }
#improve {
  width: 100%; max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(20px);
  color: var(--fg);
  border-radius: 14px;
  padding: 13px 16px;
  font: 15px/1.5 -apple-system, sans-serif;
  resize: none;
}
#improve::placeholder { color: var(--faint); }
#improve:focus { outline: none; border-color: rgba(255,255,255,.22); }
button {
  display: inline-block;
  margin: 18px auto 0;
  background: var(--fg); color: #000;
  border: 0; border-radius: 100px;
  padding: 14px 34px;
  font: 650 15px/1 -apple-system, sans-serif;
  cursor: pointer;
  transition: transform .15s, opacity .25s;
}
button:hover { opacity: .88; }
button:active { transform: scale(.97); }
#enable-push { background: transparent; color: var(--dim); border: 1px solid var(--line); margin-left: 10px; }

/* report confirmation */
#report.sending { pointer-events: none; opacity: .6; }
#report-done {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--dim); font-size: 14px;
  animation: rise .6s cubic-bezier(.22,1,.36,1);
}
#report-done .big-tick {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green);
  position: relative;
  box-shadow: 0 0 24px rgba(63,185,80,.45);
  animation: pop .45s cubic-bezier(.34,1.56,.64,1);
}
#report-done .big-tick::after {
  content: ''; position: absolute; left: 16px; top: 9px;
  width: 10px; height: 19px;
  border: solid #04130a; border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* check-in answer sheet */
#focus-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
#focus-overlay .sheet {
  background: rgba(18,18,22,.95);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 26px;
  max-width: 380px; margin: 16px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
#focus-overlay p { margin-bottom: 22px; font-size: 17px; font-family: var(--serif); }
#focus-overlay button { display: block; width: 100%; margin: 10px 0 0; padding: 15px; border-radius: 14px; font-size: 16px; }
#focus-overlay .no { background: rgba(255,255,255,.08); color: var(--fg); border: 1px solid var(--line); }
