* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { 
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #0f0e14; /* deep charcoal violet from inspiration */
  color: #e8e8f0;
  display: flex; 
  justify-content: center; 
  align-items: flex-start; 
  /* Top padding clears the fixed header; responsive to screen size */
  padding: clamp(4rem, 7vw, 6rem) 1.25rem 2rem; 
}

.container { width: 100%; max-width: 820px; position: relative; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; }
/* Pin header to top (brand left, About right) */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; width: 100vw; padding: 0.75rem 1rem; background: transparent; }
.brand { display: flex; align-items: center; gap: 0.75rem; color: #c9c9d6; padding: 0; border-radius: 0; background: transparent; border: none; }
.brand .diamond { width: 18px; height: 18px; background: #3be380; transform: rotate(45deg); border-radius: 3px; box-shadow: 0 0 20px rgba(59, 227, 128, 0.2); }
.header a { color: #a4a4bb; text-decoration: none; font-weight: 700; opacity: 0.95; display: inline-block; padding: 0; border-radius: 0; background: transparent; border: none; transition: color 0.2s ease, opacity 0.2s ease; }
.header a:hover { opacity: 1; color: #ffffff; text-decoration: none; }
.header a:focus-visible { outline: 2px solid rgba(255,255,255,0.18); outline-offset: 2px; box-shadow: none; }

/* Brand logo sizing */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: clamp(26px, 3.8vw, 34px); height: auto; display: block; }

/* Composer */
.composer { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; padding-left: 0.25rem; }
.composer .plus { color: #ffffff; font-size: 3.25rem; line-height: 1; font-weight: 800; margin-top: 0.25rem; }

.composer h2 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 800; color: #bfc3d9; letter-spacing: -0.02em; }
.composer .hint { margin-top: 0.25rem; margin-bottom: 0.5rem; color: #8a8ea3; font-weight: 600; }

.input-card { margin-top: 1.25rem; background: #151422; border: 1px solid #201f31; border-radius: 12px; padding: 1rem; box-shadow: 0 6px 32px rgba(0,0,0,0.35); }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }
.input { width: 100%; background: #1b1a2a; color: #f0f3ff; border: 1px solid #24233a; border-radius: 10px; padding: 1rem 1rem; font-weight: 800; font-size: 1.15rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.input::placeholder { color: #6f7390; font-weight: 600; }
.input:focus { border-color: #6f7dff; box-shadow: 0 0 0 4px rgba(111,125,255,0.15); }

.subinput { margin-top: 0.5rem; width: 100%; background: #171626; color: #d5d8ea; border: 1px dashed #2a2941; border-radius: 10px; padding: 0.85rem 1rem; font-weight: 600; font-size: 0.98rem; outline: none; }
.subinput::placeholder { color: #71749b; }

/* Borderless variant for top composer inputs */
.input.borderless { background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none; color: #e9ecff; }
.input.borderless:focus { outline: none; box-shadow: none; }
.subinput.borderless { background: transparent; border: none; border-radius: 0; padding: 0.35rem 0 0 0; box-shadow: none; color: #c5c8de; }
.subinput.borderless:focus { outline: none; box-shadow: none; }

/* Specific large style for the new top composer inputs */
.input.borderless.title-input { display: block; font-weight: 900; letter-spacing: -0.02em; color: #ffffff; font-size: clamp(1.5rem, 2vw, 3rem) !important; line-height: 1.15; }
.subinput.borderless.desc-input { display: block; margin-top: 0.7rem; color: #8a8ea3; font-weight: 700; font-size: clamp(1.25rem, 1.8vw, 2.5rem) !important; }

/* Ensure placeholders match the large sizes */
.input.borderless.title-input::placeholder { font-size: inherit !important; font-weight: inherit; color: #8a8ea3; opacity: 1; }
.subinput.borderless.desc-input::placeholder { font-size: inherit !important; font-weight: inherit; color: #8a8ea3; opacity: 1; }

.add-btn { background: #3be380; color: #07130a; font-weight: 900; border: 0; border-radius: 10px; padding: 0.9rem 1.2rem; font-size: 1.2rem; cursor: pointer; transition: transform 0.05s ease, filter 0.2s ease; }
.add-btn:hover { filter: brightness(1.05); }
.add-btn:active { transform: translateY(1px); }

/* List */
#todoList { margin-top: clamp(2rem, 5vw, 3.25rem); list-style: none; display: grid; gap: 0.5rem; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: start; background: transparent; border: none; border-radius: 12px; padding: 0.9rem 0.9rem; box-shadow: none; transition: box-shadow 0.18s ease; }
.item:hover, .item:focus-within { box-shadow: 0 10px 24px rgba(0,0,0,0.28), 0 0 18px rgba(255,255,255,0.05); }
.checkbox { appearance: none; width: 22px; height: 22px; border: 2px solid #3b3a56; border-radius: 6px; background: transparent; margin-top: 0.2rem; cursor: pointer; position: relative; }
.checkbox:checked { background: #3be380; border-color: #3be380; }
.checkbox:checked::after { content: ''; position: absolute; inset: 0; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2307130a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center/16px 16px no-repeat; }

.item-body { display: flex; flex-direction: column; gap: 0.25rem; }
.item-title { font-weight: 900; letter-spacing: -0.01em; color: #e9ecff; border: 1px solid transparent; border-radius: 8px; padding: 2px 4px; outline: none; font-size: clamp(1.25rem, 1.6vw, 2rem); }
.item-desc { color: #8f93ad; font-weight: 600; font-size: clamp(1.05rem, 1.2vw, 1.6rem); border: 1px solid transparent; border-radius: 8px; padding: 2px 4px; outline: none; }
.item-title[contenteditable="true"]:focus, .item-desc[contenteditable="true"]:focus { border-color: transparent; box-shadow: none; outline: none; }
.item.done .item-title, .item.done .item-desc { color: #666a86; text-decoration: line-through; }

.actions { display: flex; gap: 0.6rem; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.item:hover .actions, .item:focus-within .actions { opacity: 1; pointer-events: auto; }
.icon-btn { background: transparent; border: none; color: #c8cae6; font-weight: 800; border-radius: 8px; padding: 0.5rem; cursor: pointer; line-height: 1; display: inline-flex; align-items: center; justify-content: center; font-size: clamp(1rem, 1.5vw, 1.25rem); transition: color 0.15s ease; min-width: 36px; min-height: 36px; }
.icon-btn:hover { color: #ffffff; background: transparent; }
.icon-btn:focus { outline: none; box-shadow: none; }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }
/* Ensure inline SVG icons follow button color and pass clicks to button */
.icon-btn svg { width: 1em; height: 1em; display: block; fill: currentColor; pointer-events: none; }
.icon-btn svg * { pointer-events: none; }

/* Focus Mode */
.focus-item { display: flex; flex-direction: column; gap: 1.2rem; background: transparent; border: none; border-radius: 12px; padding: 1.25rem 0.5rem; box-shadow: none; }
.focus-header { display: flex; align-items: center; gap: 0.5rem; }
.focus-header .spacer { flex: 1; }

/* Full-screen when in focus-mode */
body.focus-mode .header,
body.focus-mode .composer,
body.focus-mode .actions,
body.focus-mode .item { display: none !important; }
body.focus-mode { padding: 0; overflow: hidden; display: block; }
body.focus-mode .container { max-width: none; width: 100vw; margin: 0; }
body.focus-mode #todoList { height: 100vh; display: grid; place-items: center; }
body.focus-mode .focus-item { width: 100%; max-width: 1100px; opacity: 0; animation: focus-fade 320ms ease-in-out forwards; display: grid; place-items: center; padding: 0; }
body.focus-leave .focus-item { animation: focus-fade-out 320ms ease-in-out forwards; }

/* Pin back/bell to edges of viewport */
body.focus-mode .focus-header { display: block; position: static; height: 0; }
body.focus-mode .back-btn { position: fixed; top: 1rem; left: 1rem; z-index: 10; }
body.focus-mode .bell-btn { position: fixed; top: 1rem; right: 1rem; z-index: 10; }

/* Remove normal-mode spacing inside list area while focused */
body.focus-mode #todoList { margin: 0; }
body.focus-mode .support { display: none; }
body.focus-mode .focus-item { gap: 0; }

@keyframes focus-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes focus-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Back and bell inherit .icon-btn sizing; adjust colors */
.back-btn { color: #c8cae6; }
.back-btn:hover { color: #ffffff; }

.bell-btn { color: #8f93ad; transition: color 0.15s ease, transform 0.2s ease; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.bell-btn svg { width: 24px; height: 24px; display: block; fill: currentColor; }
.bell-btn span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 1px 1px); white-space: nowrap; border: 0; }
.bell-btn.active { color: #ffffff; }
.bell-btn.ring { animation: bell-pulse 0.6s ease; }

@keyframes bell-pulse {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(255,255,255,0.0); }
  50% { transform: scale(1.12); text-shadow: 0 0 16px rgba(255,255,255,0.25); }
  100% { transform: scale(1); text-shadow: 0 0 0 rgba(255,255,255,0.0); }
}

.focus-body { display: grid; place-items: center; gap: 0.8rem; text-align: center; max-width: 1100px; margin: 0 auto; }
.focus-title { font-weight: 900; letter-spacing: -0.02em; color: #ffffff; font-size: clamp(2.25rem, 7vw, 5rem); line-height: 1.08; padding: 0; text-align: center; direction: ltr; unicode-bidi: plaintext; max-width: 1100px; margin: 0 auto; }
.focus-desc { color: #b5b8d3; font-weight: 600; font-size: clamp(1.1rem, 2.4vw, 2rem); text-align: center; direction: ltr; unicode-bidi: plaintext; white-space: normal; max-width: 900px; margin: 0 auto; }
.focus-title[contenteditable="true"]:focus, .focus-desc[contenteditable="true"]:focus { border-color: transparent; box-shadow: none; outline: none; }

/* Support image button (fixed bottom-right) */
.support { position: fixed; right: 1rem; bottom: 1rem; text-decoration: none; display: inline-block; padding: 0; background: transparent; border: none; }
.support img { display: block; width: clamp(56px, 8vw, 88px); height: auto; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0,0,0,0.35)); border-radius: 12px; }
.support img { animation: support-float 3.2s ease-in-out infinite alternate; transform-origin: 50% 80%; }
.support:hover img { filter: drop-shadow(0 12px 28px rgba(0,0,0,0.45)); }
.support:focus-visible { outline: 2px solid rgba(255,255,255,0.18); outline-offset: 4px; border-radius: 14px; }

/* About page */
.about-blank { max-width: 820px; margin: 0 auto; padding-top: clamp(1rem, 2vw, 2rem); }
.about-blank h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; letter-spacing: -0.02em; color: #ffffff; margin-bottom: 1rem; }
.about-blank h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); font-weight: 800; color: #e1e4ff; margin-top: 1.75rem; margin-bottom: 0.75rem; }
.about-blank h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 800; color: #d6d9f7; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.about-blank p { color: #c2c6de; font-weight: 600; line-height: 1.6; margin-bottom: 0.85rem; }
.about-blank ul { margin: 0.25rem 0 1rem 1.25rem; padding: 0; }
.about-blank li { color: #b7bbd6; font-weight: 600; line-height: 1.6; margin: 0.25rem 0; }
.about-blank a { color: #9aa7ff; font-weight: 800; text-decoration: none; }
.about-blank a:hover { color: #c0c8ff; text-decoration: underline; }
.about-blank hr { border: none; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent); margin: 1.25rem 0; }

/* Back link icon in header (About page) */
.back-link { color: #c8cae6; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; text-decoration: none; }
.back-link:hover { color: #ffffff; }
.back-link:focus-visible { outline: 2px solid rgba(255,255,255,0.18); outline-offset: 2px; }

@keyframes support-float {
  0% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(0deg); }
  100% { transform: translateY(-3px) rotate(1deg); }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .support img { animation: none; }
}

/* Accessibility */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }
