:root {
  --bg:        #0a0612;
  --bg-2:      #13091f;
  --ink:       #f2ecff;
  --ink-dim:   #a79cc2;
  --ink-muted: #6b5f88;
  --purple:    #b47cff;
  --purple-2:  #8a3fff;
  --purple-3:  #5e1fd6;
  --acid:      #c4ff3d;
  --warn:      #ff8e3c;
  --rose:      #ff6b9d;
  --ok:        #7de08d;
  --line:      rgba(180, 124, 255, 0.22);
  --glass:     rgba(180, 124, 255, 0.06);
  --radius:    14px;
  --mono:      'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display:   'Syne', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(138, 63, 255, 0.25), transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(94, 31, 214, 0.18), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(180, 124, 255, 0.12), transparent 60%);
  background-attachment: fixed;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: overlay;
}

@media (max-width: 720px) {
  body::before, body::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--purple-2); color: white; }

button, input, textarea { font-family: inherit; color: inherit; }
input, textarea { -webkit-appearance: none; appearance: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ===== NAV ===== */
nav.top {
  position: sticky; top: 0;
  z-index: 50;
  background: rgba(10, 6, 18, 0.88);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
@media (min-width: 901px) {
  nav.top {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 6, 18, 0.65);
  }
}
nav.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 18px var(--purple), 0 0 40px var(--purple-2);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.2); opacity: 0.8; }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a.navlink {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-dim);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.nav-links a.navlink:hover { color: var(--ink); background: var(--glass); }
.nav-links a.navlink.active {
  color: var(--ink);
  background: var(--glass);
  border-color: var(--line);
}

.nav-more { position: relative; }
.nav-more-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--ink-dim);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.nav-more-btn:hover { color: var(--ink); background: var(--glass); }
.nav-more.open .nav-more-btn,
.nav-more-btn.active {
  color: var(--ink); background: var(--glass); border-color: var(--line);
}
.nav-more-panel {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: rgba(19, 9, 31, 0.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.5);
}
.nav-more.open .nav-more-panel { display: flex; }
.nav-more-panel a {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s, color 0.15s;
}
.nav-more-panel a:hover { background: var(--glass); color: var(--ink); }
.nav-more-panel a.active { color: var(--ink); background: var(--glass); }
.nav-more-panel .icon {
  width: 20px; display: inline-block;
  color: var(--purple);
  text-align: center;
}

.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}
.nav-burger span {
  width: 18px; height: 2px; background: currentColor;
  position: relative; display: inline-block;
}
.nav-burger span::before,
.nav-burger span::after {
  content: ''; position: absolute; left: 0;
  width: 18px; height: 2px; background: currentColor;
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after  { top:  6px; }

@media (max-width: 900px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top));
    left: 0; right: 0; bottom: 0;
    background: rgba(10, 6, 18, 0.98);
    border-top: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 2px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    z-index: 49;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a.navlink,
  .nav-links .nav-more-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
    min-height: 48px;
    font-size: 15px;
    border-radius: 10px;
  }
  .nav-more { width: 100%; }
  .nav-more-panel {
    position: static;
    background: transparent;
    border: none;
    padding: 0 0 0 16px;
    margin-top: 4px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-more-panel a { padding: 12px 14px; min-height: 44px; }
}

main { padding: 48px 0 120px; position: relative; z-index: 2; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
main > .wrap { animation: fadeUp 0.4s ease both; }

h1.mega {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 10vw, 140px);
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin-bottom: 32px;
}
h1.mega .glow {
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(180, 124, 255, 0.35));
}
h1.mega .outline {
  -webkit-text-stroke: 1.5px var(--purple);
  color: transparent;
  font-style: italic;
}
h2.section {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  line-height: 1;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--purple);
}
.intro {
  max-width: 640px;
  color: var(--ink-dim);
  margin-bottom: 40px;
}
.intro code {
  background: var(--glass);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--purple);
}

/* ===== LANDING ===== */
.hero { padding: 40px 0 80px; }
.hero-meta {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 60px;
}
.hero-intro {
  max-width: 480px;
  color: var(--ink-dim);
  font-size: 16px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .k { font-family: var(--display); font-size: 32px; font-weight: 700; color: var(--ink); }
.stat .v { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-top: 4px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 60px;
}
.card {
  position: relative;
  padding: 32px 28px;
  background: linear-gradient(145deg, rgba(180, 124, 255, 0.08), rgba(10, 6, 18, 0.4));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: block;
}
.card:hover {
  border-color: var(--purple);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(138, 63, 255, 0.4);
}
.card .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--purple);
  margin-bottom: 20px;
}
.card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.card p { color: var(--ink-dim); font-size: 13px; }
.card .arrow {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  transition: gap 0.3s;
}
.card:hover .arrow { gap: 14px; }

.cards.six { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.cards.six .card { padding: 24px; }
.cards.six .card h3 { font-size: 20px; }
.cards.six .card p { font-size: 12px; }
.cards.six .card .arrow { margin-top: 18px; font-size: 10px; }

/* ===== WORKOUTS ===== */
.workout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.workout {
  padding: 28px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.3s;
}
.workout:hover { border-color: var(--purple); transform: translateY(-2px); }
.workout .day {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.workout .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.workout .duration {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
}
.workout ul { list-style: none; }
.workout li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.workout li:last-child { border-bottom: none; }
.workout li span:last-child { color: var(--ink-muted); font-family: var(--mono); font-size: 12px; }

/* ===== CALENDAR ===== */
.cal-wrap { max-width: 820px; }
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cal-month {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.cal-nav { display: flex; gap: 8px; }
.cal-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 18px;
}
.cal-btn:hover, .cal-btn:active { border-color: var(--purple); background: var(--glass); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day-label {
  text-align: center;
  padding: 12px 0;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  background: rgba(10, 6, 18, 0.3);
}
.cal-cell:hover { border-color: var(--purple); }
.cal-cell.muted { opacity: 0.3; }
.cal-cell.today {
  background: linear-gradient(135deg, var(--purple-2), var(--purple-3));
  border-color: var(--purple);
  color: white;
  box-shadow: 0 0 24px -6px var(--purple-2);
}
.cal-cell.has-event::after {
  content: '';
  position: absolute;
  bottom: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}
.event-list {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 100px;
}
.event-list h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 14px;
}
.event-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  gap: 10px;
}
.event-item:last-child { border-bottom: none; }
.event-item span:first-child { flex: 1; word-break: break-word; }
.event-del {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 18px;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.event-del:hover, .event-del:active { color: var(--rose); background: rgba(255,107,157,0.1); }
.event-add {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.input {
  background: rgba(10, 6, 18, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  min-height: 44px;
}
.input:focus { border-color: var(--purple); }
.event-add .input { flex: 1; }

.btn {
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid var(--purple);
  background: var(--purple-2);
  color: white;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s;
  min-height: 44px;
  white-space: nowrap;
}
.btn:hover, .btn:active { background: var(--purple-3); box-shadow: 0 4px 20px -4px var(--purple-2); }
.btn.ghost {
  background: transparent;
  color: var(--purple);
}
.btn.ghost:hover { background: var(--glass); }
.btn.danger { border-color: var(--rose); background: transparent; color: var(--rose); }
.btn.danger:hover { background: rgba(255,107,157,0.1); }
.btn.lg { padding: 14px 24px; font-size: 13px; }

/* ===== LINKS PAGE ===== */
.link-form {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 10px;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.link-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.link-row {
  display: grid;
  grid-template-columns: 180px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.link-row:last-child { border-bottom: none; }
.link-row:hover { background: var(--glass); }
.link-row .slug { color: var(--purple); font-weight: 700; }
.link-row .dest {
  color: var(--ink-dim);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  min-height: 36px;
}
.chip:hover { color: var(--purple); border-color: var(--purple); }
.chip.danger:hover { color: var(--rose); border-color: var(--rose); }
.empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* ===== HABITS ===== */
.habits-wrap { max-width: 960px; }
.habit-form { display: flex; gap: 10px; margin-bottom: 28px; }
.habit-form .input { flex: 1; }
.habits-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.habits-head, .habit-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) repeat(7, 40px) 70px 36px;
  gap: 6px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.habits-head {
  background: rgba(180, 124, 255, 0.04);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.habits-head .day-h { text-align: center; }
.habits-head .day-h.today-h { color: var(--purple); font-weight: 700; }
.habit-row:last-child { border-bottom: none; }
.habit-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.habit-cell {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  font-size: 16px;
  color: var(--acid);
}
.habit-cell:hover { border-color: var(--purple); }
.habit-cell.done {
  background: var(--purple-2);
  border-color: var(--purple);
  color: white;
}
.habit-cell.today-cell { outline: 1px solid var(--purple); outline-offset: -1px; }
.habit-streak {
  font-size: 13px;
  color: var(--acid);
  text-align: right;
}

/* ===== JOURNAL ===== */
.journal-wrap { max-width: 780px; }
.mood-picker {
  display: flex; gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mood-btn {
  width: 52px; height: 52px;
  font-size: 26px;
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}
.mood-btn:hover { transform: translateY(-2px); border-color: var(--purple); }
.mood-btn.selected {
  border-color: var(--purple);
  background: rgba(138, 63, 255, 0.2);
  box-shadow: 0 0 20px -4px var(--purple-2);
  transform: translateY(-2px);
}
.journal-input {
  width: 100%;
  min-height: 120px;
  background: rgba(10, 6, 18, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.journal-input:focus { border-color: var(--purple); }
.journal-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; margin-bottom: 32px;
  font-size: 12px; color: var(--ink-muted);
  flex-wrap: wrap; gap: 10px;
}
.journal-entries { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.entry {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: start;
}
.entry:last-child { border-bottom: none; }
.entry .emoji { font-size: 26px; line-height: 1; }
.entry .body .date {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--purple); margin-bottom: 6px;
}
.entry .body .text { font-size: 14px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

/* ===== POMODORO / FOCUS ===== */
.focus-wrap { max-width: 720px; }
.mode-toggle {
  display: inline-flex;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 32px;
}
.mode-toggle button {
  background: transparent; border: none;
  color: var(--ink-dim);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.mode-toggle button.active {
  background: var(--purple-2);
  color: white;
}

.timer-display {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 0;
}
.timer-ring {
  position: relative;
  width: min(360px, 80vw); height: min(360px, 80vw);
}
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.timer-ring .bg-ring { stroke: var(--line); stroke-width: 6; fill: none; }
.timer-ring .fg-ring {
  stroke: var(--purple);
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 12px var(--purple-2));
}
.timer-time {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 10vw, 80px);
  letter-spacing: -0.03em;
}
.timer-phase {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 8px;
}
.timer-controls {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.timer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  max-width: 520px;
  margin-left: auto; margin-right: auto;
}
.timer-stats .tile {
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.timer-stats .tile .k {
  font-family: var(--display);
  font-size: 28px; font-weight: 700;
}
.timer-stats .tile .v {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted);
  margin-top: 4px;
}
.timer-settings {
  margin-top: 28px;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.timer-settings label {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted);
  display: block; margin-bottom: 6px;
}
.timer-settings .input { padding: 10px 12px; min-height: 40px; }

body.focus-active { overflow: hidden; }
.flight-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 32px;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
body.focus-active .flight-overlay { display: flex; }
.flight-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(138, 63, 255, 0.35), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(94, 31, 214, 0.3), transparent 50%);
  animation: drift 20s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, 20px) scale(1.1); }
}
.flight-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 28px;
  text-align: center;
}
.flight-time {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(80px, 18vw, 180px);
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-shadow: 0 0 40px rgba(180, 124, 255, 0.4);
}
.flight-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.flight-task {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-top: -8px;
  max-width: 600px;
}
.flight-quit {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  right: 24px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 40px;
  z-index: 3;
}
.flight-quit:hover { color: var(--rose); border-color: var(--rose); }

/* ===== TASKS ===== */
.tasks-wrap { max-width: 720px; }
.task-form { display: flex; gap: 10px; margin-bottom: 24px; }
.task-form .input { flex: 1; }
.task-filters {
  display: flex; gap: 6px; margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 36px;
}
.filter-btn.active, .filter-btn:hover {
  color: var(--purple);
  border-color: var(--purple);
  background: var(--glass);
}
.task-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.task {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.task:last-child { border-bottom: none; }
.task:hover { background: var(--glass); }
.task-check {
  width: 26px; height: 26px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  color: white;
}
.task-check:hover { border-color: var(--purple); }
.task.done .task-check {
  background: var(--purple-2);
  border-color: var(--purple);
}
.task.done .task-text {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.task-text { font-size: 14px; word-break: break-word; }

/* ===== WEIGHT ===== */
.weight-wrap { max-width: 820px; }
.weight-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.weight-summary .tile {
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.weight-summary .tile .v {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted);
  margin-bottom: 6px;
}
.weight-summary .tile .k {
  font-family: var(--display);
  font-size: 24px; font-weight: 700;
}
.weight-summary .tile .delta {
  font-size: 12px;
  margin-top: 4px;
}
.delta.up   { color: var(--rose); }
.delta.down { color: var(--ok); }
.delta.flat { color: var(--ink-muted); }

.weight-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 10px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.weight-chart {
  padding: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.weight-chart svg { width: 100%; height: auto; display: block; }
.weight-log {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.weight-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.weight-row:last-child { border-bottom: none; }
.weight-row .d { color: var(--ink-muted); font-size: 13px; }
.weight-row .w { font-family: var(--display); font-weight: 700; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  background: var(--purple-2);
  color: white;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2000;
  box-shadow: 0 10px 40px -10px var(--purple-2);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== FOOTER ===== */
footer {
  padding: 40px 0;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
  position: relative;
  z-index: 2;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  main { padding: 32px 0 80px; }
  .hero { padding: 24px 0 40px; }
  .hero-meta { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats { padding: 18px; gap: 14px; }
  .stat .k { font-size: 26px; }
  .cards { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
  .cards.six { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards.six .card { padding: 18px; }
  .cards.six .card h3 { font-size: 16px; }
  .cards.six .card p { display: none; }
  .link-form, .weight-form { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .habits-head, .habit-row {
    grid-template-columns: 1fr repeat(7, 32px) 56px 28px;
    padding: 10px 12px;
    font-size: 12px;
    gap: 4px;
  }
  .habit-cell { width: 28px; height: 28px; font-size: 12px; }
  .habit-name { font-size: 13px; }
  .weight-summary { grid-template-columns: 1fr 1fr; }
  .cal-cell { padding: 6px; font-size: 12px; border-radius: 8px; }
  .mode-toggle button { padding: 10px 14px; font-size: 11px; }
  .cal-header { padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .cal-month { font-size: 22px; }
  h2.section { margin-bottom: 20px; }
  .intro { margin-bottom: 28px; }
}
