:root {
    --clay-base: #E8E2D9;
    --clay-shadow: #D1C9BC;
    --clay-light: #FDFBF7;
    --clay-accent: #6B705C;
    --clay-earth: #A5A58D;
    --clay-terracotta: #CB997E;
}

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

body {
    background-color: var(--clay-base);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #44403C;
    min-height: 100vh;
    padding: 1.5rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
    body {
        padding: 3rem 1.5rem;
    }
}

.mono {
    font-family: 'Space Mono', ui-monospace, SFMono-Regular, monospace;
}

/* Claymorphic Elevations */
.clay-card {
    background: var(--clay-base);
    border-radius: 36px;
    box-shadow:
        18px 18px 45px var(--clay-shadow),
        -18px -18px 45px var(--clay-light);
    border: 1px solid rgba(255, 255, 255, 0.45);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.clay-inset {
    background: var(--clay-base);
    border-radius: 24px;
    box-shadow:
        inset 6px 6px 14px var(--clay-shadow),
        inset -6px -6px 14px var(--clay-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.clay-pressed-btn {
    background: var(--clay-base);
    box-shadow:
        6px 6px 14px var(--clay-shadow),
        -6px -6px 14px var(--clay-light);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
}

.clay-pressed-btn:hover {
    box-shadow:
        8px 8px 18px var(--clay-shadow),
        -8px -8px 18px var(--clay-light);
    transform: translateY(-1px);
}

.clay-pressed-btn:active {
    box-shadow:
        inset 4px 4px 8px var(--clay-shadow),
        inset -4px -4px 8px var(--clay-light);
    transform: translateY(1px);
}

/* Grain overlay */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-item {
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--clay-base);
    border-radius: 24px;
    box-shadow:
        7px 7px 18px var(--clay-shadow),
        -7px -7px 18px var(--clay-light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 1.25rem 1.5rem;
    transition: all 0.25s ease;
}

.todo-item:hover {
    box-shadow:
        9px 9px 22px var(--clay-shadow),
        -9px -9px 22px var(--clay-light);
}

.todo-item.completed {
    opacity: 0.65;
    box-shadow:
        inset 4px 4px 9px var(--clay-shadow),
        inset -4px -4px 9px var(--clay-light);
    background: rgba(232, 226, 217, 0.7);
}

/* Task Checkbox */
.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 5px var(--clay-shadow), -2px -2px 5px var(--clay-light);
    transition: all 0.2s ease;
}

.task-checkbox:hover {
    transform: scale(1.1);
}

.task-checkbox.checked {
    background: var(--clay-accent) !important;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.task-checkbox.checked svg {
    display: block;
}

.task-checkbox svg {
    display: none;
    width: 14px;
    height: 14px;
    color: white;
}

/* Subtasks */
.subtasks {
    margin-top: 0.875rem;
    margin-left: 0.625rem;
    padding-left: 1.5rem;
    border-left: 2px dashed rgba(165, 165, 141, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.subtask {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.subtask:hover {
    background: rgba(255, 255, 255, 0.4);
}

.subtask-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--clay-earth);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: transparent;
}

.subtask-checkbox.checked {
    background: var(--clay-accent);
    border-color: var(--clay-accent);
}

.subtask-checkbox svg {
    display: none;
    width: 10px;
    height: 10px;
    color: white;
}

.subtask-checkbox.checked svg {
    display: block;
}

.subtask-text {
    flex: 1 1 0%;
    font-size: 0.875rem;
    color: #57534E;
    line-height: 1.35;
}

.subtask-text.checked {
    text-decoration: line-through;
    opacity: 0.6;
}

.delete-subtask {
    font-size: 1rem;
    color: #A5A58D;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
}

.subtask:hover .delete-subtask {
    opacity: 1;
}

.delete-subtask:hover {
    color: #EF4444;
}

.add-subtask-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.ai-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.08);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-generate-btn:hover {
    background: rgba(79, 70, 229, 0.16);
    color: #4338CA;
}

.add-subtask-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #78716C;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-subtask-btn:hover {
    color: #44403C;
    background: rgba(255, 255, 255, 0.5);
}

.subtask-input {
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--clay-earth);
    outline: none;
    font-size: 0.875rem;
    color: #44403C;
    padding: 0.2rem 0.4rem;
    flex: 1 1 0%;
    min-width: 140px;
}

.delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A5A58D;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.18s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
}

.delete-btn:hover {
    opacity: 1;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.12);
}

/* Priority Badges */
.priority-badge {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 9999px;
    line-height: 1.3;
}

.priority-high {
    background: rgba(203, 153, 126, 0.25);
    color: #B2532B;
}

.priority-medium {
    background: rgba(165, 165, 141, 0.3);
    color: #555845;
}

.priority-low {
    background: rgba(209, 201, 188, 0.35);
    color: #78716C;
}

/* Idea Chips */
.idea-chip {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 2px 2px 5px var(--clay-shadow);
    color: #57534E;
    cursor: pointer;
    transition: all 0.15s ease;
}

.idea-chip:hover {
    background: #FFF;
    color: #292524;
    transform: translateY(-1px);
    box-shadow: 3px 3px 8px var(--clay-shadow);
}

/* Utilities */
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.hidden { display: none !important; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

@media (min-width: 768px) {
    .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
    .md\:p-12 { padding: 3rem; }
    .md\:p-10 { padding: 2.5rem; }
}

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.tracking-tighter { letter-spacing: -0.05em; }

.text-stone-400 { color: #A8A29E; }
.text-stone-500 { color: #78716C; }
.text-stone-600 { color: #57534E; }
.text-stone-700 { color: #44403C; }
.text-stone-800 { color: #292524; }

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}

.bg-transparent { background-color: transparent; }
.resize-none { resize: none; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.h-36 { height: 9rem; }
.line-through { text-decoration: line-through; }
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--clay-base);
}
::-webkit-scrollbar-thumb {
    background: var(--clay-shadow);
    border-radius: 8px;
    border: 2px solid var(--clay-base);
}