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

:root {
    --bg: #0c0c0f;
    --ink: #f4f4f5;
    --gray-50: #18181b;
    --gray-100: #1e1e22;
    --gray-200: #2a2a30;
    --gray-300: #3a3a42;
    --gray-400: #8a8a92;
    --gray-500: #a0a0a8;
}

[data-theme="light"] {
    --bg: #ffffff;
    --ink: #0a0a0a;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e9e9e9;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Geist', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.5s, color 0.5s;
}

::selection {
    background: var(--ink);
    color: var(--bg);
}

.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.theme-toggle {
    display: flex;
    width: fit-content;
    position: relative;
    background: var(--gray-50);
    border-radius: 999px;
    padding: 3px;
    margin-left: auto;
    margin-bottom: 1rem;
}

.theme-option {
    position: relative;
    z-index: 1;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 999px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.theme-option svg {
    width: 14px;
    height: 14px;
    position: relative;
    z-index: 1;
}

.theme-option:hover {
    color: var(--gray-500);
}

.theme-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    background: var(--bg);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s, border-color 0.5s;
    z-index: 0;
    pointer-events: none;
}

h1 {
    font-family: 'Geist', system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink);
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 3.5rem;
}

.search-field {
    margin-bottom: 2.5rem;
}

.search-field input {
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

.search-field input::placeholder {
    color: var(--gray-400);
}

.search-field input:focus {
    border-bottom-color: var(--gray-400);
}

.new-note {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--gray-200);
}

.new-note input,
.new-note textarea {
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    font-family: 'Geist', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.new-note input::placeholder,
.new-note textarea::placeholder {
    color: var(--gray-400);
}

.new-note input:focus,
.new-note textarea:focus {
    border-bottom-color: var(--gray-400);
}

.new-note input {
    margin-bottom: 1.5rem;
}

.new-note textarea {
    min-height: 6rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-primary {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.6875rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--bg);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-primary:active {
    transform: scale(0.97);
}

.notes-list {
    display: flex;
    flex-direction: column;
}

.note-card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.note-card:last-child {
    border-bottom: none;
}

.note-date {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.note-title {
    font-family: 'Geist', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    line-height: 1.3;
}

.note-content {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--gray-500);
    margin-bottom: 1rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.note-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.read-time {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.5625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-left: auto;
}

.btn-action {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: transparent;
    color: var(--gray-400);
    border: 1px solid var(--gray-200);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-action:hover {
    color: var(--ink);
    border-color: var(--gray-400);
}

.empty-state {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.6875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-400);
    text-align: center;
    padding: 4rem 0;
}

.notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.625rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 200;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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