/* ═══════════════════════════════════════════════════════════
   Valerie's Schedule — styles
   Pink / purple / lavender girly theme
   ═══════════════════════════════════════════════════════════ */

:root {
  /* base palette — light */
  --bg: #FFF5F9;
  --bg-elev: #FFFBFD;
  --ink: #3D2438;
  --ink-soft: #8A6B7D;
  --ink-faint: #C9A6B8;
  --rule: #F5DEE8;
  --rule-strong: #ECC9D9;

  /* default accent (wake) */
  --accent: #E87FA3;
  --accent-deep: #D85C87;
  --current-bg: #FCE4EE;

  /* shadows */
  --shadow-soft: 0 1px 2px rgba(61, 36, 56, 0.04), 0 4px 18px rgba(216, 92, 135, 0.08);
  --shadow-pop: 0 6px 32px rgba(216, 92, 135, 0.18);

  /* radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;

  /* typography */
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;

  /* past schedule items — subtle, overridden in dark mode */
  --past-bg: transparent;
  --past-ink: var(--ink-faint);
  --past-dot: var(--rule-strong);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A0F18;
    --bg-elev: #2A1925;
    --ink: #FBEBF2;
    --ink-soft: #D7B9CA;
    --ink-faint: #9E8294;      /* brighter — was #6A4E5D */
    --rule: #3A2432;
    --rule-strong: #4E3245;

    --accent: #F0A0BD;
    --accent-deep: #F4B2CB;
    --current-bg: #5A2E42;

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 6px 32px rgba(0, 0, 0, 0.5);

    /* Subtle card background for past schedule items in dark mode */
    --past-bg: rgba(250, 220, 235, 0.055);
    --past-ink: #B99AAD;
    --past-dot: #7A5D6D;
  }
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  font-variant-numeric: oldstyle-nums;
  transition: background 0.6s, color 0.6s;
  overscroll-behavior-y: contain;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding:
    calc(24px + env(safe-area-inset-top))
    28px
    calc(48px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: rise 0.9s cubic-bezier(.2,.7,.2,1) forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════ topbar ═══════ */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 30;
  letter-spacing: 0.005em;
}

.brand-heart {
  color: var(--accent);
  font-size: 17px;
  transition: color 0.6s;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  font-style: italic;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}

.icon-btn:hover,
.icon-btn:active {
  background: var(--rule);
  color: var(--accent-deep);
}

.icon-btn:active { transform: scale(0.94); }

/* ═══════ age strip ═══════ */

.age-strip {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 40px;
  font-variation-settings: "opsz" 24;
  letter-spacing: 0.015em;
}

.age-strip b {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ═══════ labels ═══════ */

.label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
  font-weight: 500;
  font-family: var(--serif);
  font-style: normal;
}

/* ═══════ right now ═══════ */

.now { margin-bottom: 52px; }
.now .label { margin-bottom: 18px; }

.now-name {
  font-size: 60px;
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  font-variation-settings: "opsz" 144;
  color: var(--ink);
  transition: color 0.6s;
}

.now-sub {
  font-size: 15px;
  font-style: italic;
  color: var(--accent-deep);
  margin-bottom: 14px;
  font-variation-settings: "opsz" 24;
  transition: color 0.6s;
}

.now-sub b {
  font-style: normal;
  font-weight: 500;
}

.now-meta {
  font-size: 16px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 20px;
  font-variation-settings: "opsz" 24;
}

.now-meta b {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.9s cubic-bezier(.3,.7,.2,1), background 0.6s;
}

/* ═══════ up next ═══════ */

.next { margin-bottom: 56px; }
.next .label { margin-bottom: 14px; }

.next-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.next-name {
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.005em;
}

.next-when {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-variation-settings: "opsz" 24;
  text-align: right;
}

.next-when b {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
}

/* ═══════ schedule list ═══════ */

.schedule { margin-bottom: 56px; }
.schedule .label { margin-bottom: 18px; }

.sched {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.sched li {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
  transition: background 0.4s, color 0.4s;
  user-select: none;
  -webkit-user-select: none;
}

.sched li .t {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  width: 72px;
  flex-shrink: 0;
  font-style: italic;
  font-variation-settings: "opsz" 20;
  letter-spacing: 0.01em;
}

.sched li .ico {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
  filter: saturate(0.9);
}

.sched li .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-faint);
  transition: transform 0.4s, background 0.4s, box-shadow 0.4s;
}

.sched li .lbl {
  font-size: 16.5px;
  color: var(--ink);
  flex: 1;
  font-variation-settings: "opsz" 30;
}

.sched li.past {
  background: var(--past-bg);
  margin: 0 -14px;
  padding: 15px 14px;
  border-radius: var(--r-md);
  border-bottom-color: transparent;
}

.sched li.past + li.past {
  margin-top: 2px;
}

.sched li.past + li:not(.past):not(.current) {
  border-top: none;
}

.sched li.past .t,
.sched li.past .lbl {
  color: var(--past-ink);
}

.sched li.past .ico { opacity: 0.5; }

.sched li.past .lbl {
  text-decoration: line-through;
  text-decoration-color: var(--past-ink);
  text-decoration-thickness: 0.5px;
}

.sched li.past .dot { background: var(--past-dot); }

.sched li.current {
  background: var(--current-bg);
  margin: 6px -14px;
  padding: 20px 14px;
  border-bottom-color: transparent;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04),
              0 2px 16px rgba(0, 0, 0, 0.12);
}

.sched li.current + li { border-top: none; }
.sched li.past + li.current { margin-top: 10px; }

.sched li.current .t {
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
}

.sched li.current .lbl {
  color: var(--ink);
  font-weight: 500;
}

.sched li.current .dot {
  background: var(--accent);
  transform: scale(1.45);
  box-shadow: 0 0 0 4px var(--current-bg);
}

/* ═══════ leap card ═══════ */

.leap {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.leap-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.leap-titles {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.leap-titles .label {
  margin-bottom: 4px;
  color: var(--accent-deep);
  transition: color 0.6s;
}

.leap-name {
  font-size: 26px;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 3px;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.005em;
}

.leap-weeks {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  font-style: italic;
}

.leap-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.leap-nav:hover,
.leap-nav:active { background: var(--rule); color: var(--accent-deep); }
.leap-nav:active { transform: scale(0.92); }
.leap-nav[disabled] { opacity: 0.25; pointer-events: none; }

.leap-desc {
  font-size: 14.5px;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 18px;
  padding: 0 6px;
  font-variation-settings: "opsz" 24;
  line-height: 1.4;
}

.milestones {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.milestones li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 4px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.25s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.milestones li:active { background: var(--rule); }

.milestones .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s;
  margin-top: 1px;
  background: var(--bg);
}

.milestones li.done .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.milestones .check svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.milestones .mtxt {
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink);
  flex: 1;
  font-variation-settings: "opsz" 30;
  transition: color 0.3s;
}

.milestones li.done .mtxt {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
  text-decoration-thickness: 1px;
}

.leap-jump {
  display: block;
  margin: 14px auto 0;
  padding: 8px 16px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--accent-deep);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s, color 0.2s;
  font-variation-settings: "opsz" 20;
}

.leap-jump:active { background: var(--current-bg); }

/* ═══════ footer ═══════ */

.footer {
  margin-top: auto;
  padding-top: 40px;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
  font-variation-settings: "opsz" 14;
  letter-spacing: 0.04em;
}

/* ═══════ modal ═══════ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 36, 56, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--bg);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.38s cubic-bezier(.2,.7,.2,1) forwards;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.modal-title {
  font-size: 19px;
  font-style: italic;
  font-variation-settings: "opsz" 30;
  color: var(--ink);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 18px;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  padding: 12px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
  background: var(--bg);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* modal form */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--serif);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.editor {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.editor li {
  display: grid;
  grid-template-columns: 92px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.editor .row-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor input[type="time"],
.editor input[type="text"],
.editor select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--serif);
  min-height: 44px;
}

.editor input[type="time"] {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.editor select {
  background-image: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 12px;
}

.editor .row-text {
  display: flex;
  gap: 6px;
}

.editor .row-text input { flex: 1; }
.editor .row-text select { width: 92px; flex-shrink: 0; }

.editor .trash-btn {
  width: 40px;
  height: 44px;
  border-radius: var(--r-sm);
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.editor .trash-btn:active {
  background: var(--rule);
  color: var(--accent-deep);
}

.editor .trash-btn svg { width: 17px; height: 17px; }

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ghost-btn:active {
  background: var(--current-bg);
  border-color: var(--accent);
}

.ghost-btn.danger { color: var(--accent-deep); }
.ghost-btn.danger:active { background: var(--current-bg); }

.primary-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-family: var(--serif);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
  min-height: 48px;
  cursor: pointer;
}

.primary-btn:active {
  background: var(--accent-deep);
  transform: scale(0.98);
}

.note {
  margin-top: 22px;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
  font-variation-settings: "opsz" 14;
}

/* ═══════ toast ═══════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-style: italic;
  box-shadow: var(--shadow-pop);
  z-index: 100;
  max-width: 90vw;
  animation: toastIn 0.3s ease;
  font-variation-settings: "opsz" 18;
}

.toast[hidden] { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ═══════ confetti ═══════ */

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

@media (prefers-reduced-motion: reduce) {
  .app { animation: none; opacity: 1; }
  .modal-sheet { animation: none; }
  .progress-fill { transition: none; }
  .confetti { display: none; }
}

/* ═══════ small phone tweaks ═══════ */

@media (max-width: 480px) {
  .app {
    padding:
      calc(20px + env(safe-area-inset-top))
      22px
      calc(40px + env(safe-area-inset-bottom));
  }
  .now-name { font-size: 48px; letter-spacing: -0.028em; }
  .now { margin-bottom: 40px; }
  .next { margin-bottom: 44px; }
  .schedule { margin-bottom: 44px; }
  .sched li.past    { margin: 0 -10px; padding: 15px 10px; }
  .sched li.current { margin: 6px -10px; padding: 20px 10px; }
  .leap { padding: 20px 18px 16px; }
  .leap-name { font-size: 23px; }
}
