@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #f5f2e9;
  --muted: #8e8c92;
  --bg: #0b0b10;
  --surface: #14141b;
  --line: rgba(255,255,255,.12);
  --accent: #2f9e68;
  --accent-rgb: 47, 158, 104;
  --shadow: 0 28px 80px rgba(0,0,0,.45);
  --glass: rgba(5,5,8,.65);
  --section-bg: #101016;
  --input-bg: #0f0f14;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Manrope", sans-serif; transition: background .35s ease; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.focus-header { position: absolute; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 28px clamp(22px, 4vw, 64px); }
.focus-header-left { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); }
.focus-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 800; letter-spacing: -.02em; }
.focus-brand > span:last-child span { color: var(--accent); }
.brand-mark { width: 25px; height: 25px; border: 2px solid var(--accent); border-radius: 50%; position: relative; box-shadow: inset 0 0 0 5px var(--bg); background: var(--accent); }
.brand-mark::after { content: ""; position: absolute; width: 2px; height: 7px; background: var(--accent); left: 10px; top: -7px; border-radius: 2px; }
.back-projects { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .78rem; font-weight: 700; transition: color .2s, border-color .2s, transform .2s; }
.back-projects:hover { color: var(--ink); border-color: rgba(var(--accent-rgb),.7); transform: translateX(-2px); }
.back-projects svg { width: 16px; }
.focus-header nav { display: flex; gap: 8px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 50%; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover { border-color: rgba(var(--accent-rgb),.7); background: rgba(var(--accent-rgb),.08); transform: translateY(-2px); }
.icon-button svg { width: 20px; }
.icon-button.muted .sound-wave { display: none; }
.moon-icon { display: none; }
body[data-appearance="light"] .sun-icon { display: none; }
body[data-appearance="light"] .moon-icon { display: block; }

.timer-stage { min-height: 100svh; padding: 98px 24px 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(var(--accent-rgb),.065), transparent 32%), linear-gradient(rgba(128,128,128,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(128,128,128,.08) 1px, transparent 1px); background-size: auto, 48px 48px, 48px 48px; }
.timer-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--bg) 0%, transparent 16%, transparent 84%, var(--bg) 100%); }
.mode-switch { position: absolute; top: 100px; display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(18px); }
.mode-switch button { min-width: 98px; padding: 10px 18px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 700; cursor: pointer; }
.mode-switch button.active { background: var(--ink); color: var(--bg); }
.timer-context { text-align: center; margin-top: 54px; position: relative; z-index: 1; }
.session-label, .section-kicker, .dialog-heading p, .summary-card > p { margin: 0 0 9px; color: var(--accent); font: 500 .72rem/1 "DM Mono", monospace; letter-spacing: .18em; }
.current-task { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: .9rem; cursor: pointer; }
.task-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.timer-wrap { position: relative; z-index: 1; width: min(57vh, 480px); aspect-ratio: 1; display: grid; place-items: center; margin: 16px 0; }
.progress-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 2; }
.ring-track { stroke: rgba(255,255,255,.09); }
.ring-progress { stroke: var(--accent); stroke-width: 4 !important; stroke-dasharray: 1370; stroke-dashoffset: 0; transition: stroke-dashoffset .5s linear, stroke .3s; filter: drop-shadow(0 0 7px rgba(var(--accent-rgb),.45)); }
.timer-readout { display: flex; flex-direction: column; align-items: center; }
.timer-readout strong { font: 300 clamp(4.5rem, 11vw, 8.3rem)/.92 "DM Mono", monospace; letter-spacing: -.09em; margin-right: .09em; }
.timer-readout > span:last-child { margin-top: 18px; color: var(--muted); font-size: .85rem; }
.overtime-label { visibility: hidden; margin-bottom: 15px; color: var(--accent); font: 500 .7rem/1 "DM Mono", monospace; letter-spacing: .18em; }
body.overtime .overtime-label { visibility: visible; }
body.overtime .timer-readout strong { color: var(--accent); }

.timer-controls { position: relative; z-index: 1; display: flex; gap: 10px; }
.timer-controls button { min-height: 52px; border-radius: 999px; padding: 0 26px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; font-size: .9rem; cursor: pointer; transition: transform .2s, opacity .2s, background .2s; }
.timer-controls button:hover:not(:disabled) { transform: translateY(-2px); }
.primary-control { min-width: 174px; border: 0; background: var(--accent); color: #08080b; box-shadow: 0 10px 35px rgba(var(--accent-rgb),.2); }
.primary-control svg, .secondary-control svg { width: 18px; }
.pause-icon { display: none; }
body.running .play-icon { display: none; }
body.running .pause-icon { display: block; }
.secondary-control { border: 1px solid var(--line); background: transparent; }
.secondary-control:disabled { opacity: .32; cursor: not-allowed; }
.scroll-cue { position: absolute; bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.scroll-cue svg { width: 16px; animation: drift 2s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(4px); } }

.tasks-section { min-height: 90vh; padding: clamp(90px, 12vw, 160px) max(24px, calc((100vw - 1180px)/2)); display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(50px, 9vw, 130px); align-items: start; border-top: 1px solid var(--line); background: var(--section-bg); }
.tasks-copy h2 { margin: 0; font-size: clamp(3rem, 6vw, 5.8rem); line-height: .94; letter-spacing: -.065em; }
.tasks-copy > p:not(.section-kicker) { max-width: 440px; color: var(--muted); line-height: 1.7; font-size: 1rem; }
.session-stats { display: flex; gap: 42px; margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--line); }
.session-stats div { display: flex; flex-direction: column; gap: 4px; }
.session-stats strong { font: 400 1.75rem "DM Mono", monospace; }
.session-stats span { color: var(--muted); font-size: .78rem; }
.task-board { padding-top: 10px; }
.task-form label { display: block; margin-bottom: 10px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.task-form > div { display: flex; border-bottom: 1px solid rgba(255,255,255,.3); }
.task-form input { width: 100%; padding: 18px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1.2rem; }
.task-form input::placeholder { color: #55545c; }
.task-form button { width: 52px; border: 0; background: transparent; cursor: pointer; }
.task-form button svg { color: var(--accent); }
.task-list { list-style: none; padding: 18px 0 0; margin: 0; }
.task-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.task-check { width: 22px; height: 22px; padding: 0; border: 1px solid #55545c; border-radius: 50%; background: transparent; cursor: pointer; }
.task-check svg { width: 14px; opacity: 0; }
.task-item.selected { color: var(--ink); }
.task-item.selected .task-check { border-color: var(--accent); box-shadow: inset 0 0 0 5px var(--accent); }
.task-item.completed .task-title { color: var(--muted); text-decoration: line-through; }
.task-item.completed .task-check { border-color: var(--accent); background: var(--accent); color: #08080b; box-shadow: none; }
.task-item.completed .task-check svg { opacity: 1; }
.task-title { font-size: 1rem; }
.task-remove { border: 0; padding: 8px; color: var(--muted); background: transparent; cursor: pointer; opacity: .6; }
.task-remove:hover { color: var(--accent); opacity: 1; }
.task-remove svg { width: 17px; }
.empty-tasks { display: none; padding: 90px 0 20px; text-align: center; color: var(--muted); }
.empty-tasks.show { display: block; }
.empty-tasks span { display: block; color: rgba(var(--accent-rgb),.25); font: 300 5rem "DM Mono", monospace; }
.empty-tasks p { margin: -16px 0 5px; color: var(--ink); }
.empty-tasks small { font-size: .8rem; }

dialog { color: var(--ink); border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.settings-dialog { width: min(92vw, 560px); }
.settings-panel, .summary-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.settings-panel { padding: 30px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 30px; }
.dialog-heading h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.duration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.duration-grid label, fieldset legend { color: var(--muted); font-size: .8rem; }
.duration-grid input { width: 100%; margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: var(--input-bg); font: 400 1.1rem "DM Mono", monospace; }
.duration-grid input:focus { border-color: var(--accent); }
fieldset { margin: 25px 0; padding: 0; border: 0; }
.color-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 11px; }
.color-options input { position: absolute; opacity: 0; }
.color-options span { display: grid; place-items: center; min-height: 58px; border: 2px solid transparent; border-radius: 10px; color: #09090c; font-size: .72rem; font-weight: 800; cursor: pointer; }
.color-options input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.forest { background: #2f9e68; }.ember { background: #ff6048; }.cobalt { background: #50a7ff; }.lime { background: #bcf05a; }.violet { background: #a988ff; }.ocean { background: #28c2c8; }.gold { background: #f2b84b; }.rose { background: #ef6f91; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 19px 0; border-block: 1px solid var(--line); }
.setting-row span { display: flex; flex-direction: column; gap: 4px; }
.setting-row strong { font-size: .9rem; }.setting-row small { color: var(--muted); }
.setting-row input { width: 42px; height: 23px; accent-color: var(--accent); }
.save-settings { width: 100%; margin-top: 26px; padding: 15px; border: 0; border-radius: 999px; background: var(--accent); color: #08080b; font-weight: 800; cursor: pointer; }
.summary-dialog { width: min(92vw, 500px); text-align: center; }
.summary-card { padding: 45px 32px 30px; }
.summary-icon { width: 58px; height: 58px; margin: 24px auto; display: grid; place-items: center; color: #08080b; background: var(--accent); border-radius: 50%; }
.summary-card h2 { margin: 0; font: 400 clamp(2.4rem, 8vw, 4rem) "DM Mono", monospace; letter-spacing: -.06em; }
.summary-card > span { color: var(--muted); }
.summary-card blockquote { margin: 28px 0; font-size: 1rem; }
.summary-actions { display: flex; flex-direction: column; gap: 8px; }
.summary-actions button { padding: 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.summary-actions button:first-child { border-color: var(--accent); background: var(--accent); color: #08080b; font-weight: 800; }

body[data-theme="forest"] { --accent: #2f9e68; --accent-rgb: 47, 158, 104; }
body[data-theme="ember"] { --accent: #ff6048; --accent-rgb: 255, 96, 72; }
body[data-theme="cobalt"] { --accent: #50a7ff; --accent-rgb: 80, 167, 255; }
body[data-theme="lime"] { --accent: #bcf05a; --accent-rgb: 188, 240, 90; }
body[data-theme="violet"] { --accent: #a988ff; --accent-rgb: 169, 136, 255; }
body[data-theme="ocean"] { --accent: #28c2c8; --accent-rgb: 40, 194, 200; }
body[data-theme="gold"] { --accent: #f2b84b; --accent-rgb: 242, 184, 75; }
body[data-theme="rose"] { --accent: #ef6f91; --accent-rgb: 239, 111, 145; }
body[data-appearance="light"] { --ink: #17151b; --muted: #6f6a74; --bg: #f4f2ec; --surface: #fffdfa; --line: rgba(23,21,27,.14); --shadow: 0 28px 80px rgba(54,45,35,.16); --glass: rgba(255,253,250,.74); --section-bg: #ebe8e1; --input-bg: #f4f2ec; }
body[data-appearance="light"] dialog::backdrop { background: rgba(35,30,25,.42); }
body[data-appearance="light"] .ring-track { stroke: rgba(23,21,27,.12); }
body[data-appearance="light"] .task-form > div { border-color: rgba(23,21,27,.28); }
body[data-appearance="light"] .icon-button { background: rgba(255,255,255,.36); }

@media (max-width: 720px) {
  .focus-header { padding: 22px; }
  .focus-brand > span:last-child { display: none; }
  .focus-header-left { gap: 10px; }
  .back-projects { padding: 9px 11px; }
  .back-projects span { display: none; }
  .color-options { grid-template-columns: repeat(2, 1fr); }
  .timer-stage { padding-inline: 14px; }
  .mode-switch { top: 86px; }
  .timer-context { margin-top: 70px; }
  .timer-wrap { width: min(84vw, 390px); }
  .timer-readout strong { font-size: clamp(4.15rem, 22vw, 6.5rem); }
  .tasks-section { grid-template-columns: 1fr; padding: 90px 24px; gap: 55px; }
  .tasks-copy h2 { font-size: clamp(3.2rem, 15vw, 5.2rem); }
}

@media (max-height: 720px) and (min-width: 721px) {
  .timer-stage { justify-content: flex-start; padding-top: 130px; }
  .timer-wrap { width: min(54vh, 390px); }
  .timer-context { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
