* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #6366f1;
    --primary-light: #eef2ff;
    --danger: #ef4444;
    --success: #22c55e;
}

body.dark {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --primary: #818cf8;
    --primary-light: #312e81;
}


/* =========================
   BODY
========================= */

body {
    margin: 0;

    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    transition:
        background 0.3s ease,
        color 0.3s ease;
}


/* =========================
   APP
========================= */

.app {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 30px 0 20px;
}


/* =========================
   HEADER
========================= */

.header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 45px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: linear-gradient(
        135deg,
        #6366f1,
        #8b5cf6
    );

    color: white;

    font-size: 25px;

    box-shadow:
        0 8px 20px rgba(99, 102, 241, 0.25);
}

.brand h1 {
    margin: 0;

    font-size: 22px;
    font-weight: 750;
}

.brand p {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--muted);

    font-size: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;

    display: inline-block;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.12);
}

.icon-button {
    width: 40px;
    height: 40px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--card);

    cursor: pointer;

    font-size: 17px;

    transition: 0.2s;
}

.icon-button:hover {
    transform: translateY(-2px);
}


/* =========================
   HERO
========================= */

.hero {
    margin-bottom: 35px;
}

.badge {
    display: inline-block;

    padding: 6px 10px;

    border-radius: 20px;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.8px;
}

.hero h2 {
    margin: 15px 0 12px;

    font-size: clamp(32px, 5vw, 52px);

    line-height: 1.08;

    letter-spacing: -1.5px;
}

.hero p {
    max-width: 600px;

    margin: 0;

    color: var(--muted);

    font-size: 16px;

    line-height: 1.6;
}


/* =========================
   NOTES
========================= */

.notes-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 22px;
}

.note-card {
    padding: 20px;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 20px;

    box-shadow:
        0 10px 35px rgba(15, 23, 42, 0.06);

    transition:
        transform 0.2s,
        box-shadow 0.2s,
        background 0.3s;
}

.note-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 15px 40px rgba(15, 23, 42, 0.09);
}

.note-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 15px;
}

.note-title {
    display: flex;

    align-items: center;

    gap: 8px;

    font-weight: 700;
}

.note-icon {
    font-size: 18px;
}

.note-actions {
    display: flex;
    gap: 7px;
}

.small-button {
    width: 34px;
    height: 34px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: transparent;

    cursor: pointer;

    transition: 0.2s;
}

.small-button:hover {
    background: var(--primary-light);

    transform: translateY(-1px);
}

.small-button.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}


/* =========================
   TEXTAREA
========================= */

textarea {
    width: 100%;

    min-height: 300px;

    padding: 17px;

    resize: vertical;

    border: 2px solid var(--border);

    border-radius: 14px;

    outline: none;

    background: var(--bg);

    color: var(--text);

    font-family: inherit;

    font-size: 16px;

    line-height: 1.6;

    transition:
        border 0.2s,
        box-shadow 0.2s,
        background 0.3s;
}

textarea::placeholder {
    color: var(--muted);
}

textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.1);
}


/* =========================
   NOTE FOOTER
========================= */

.note-footer {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 10px;

    min-height: 20px;

    color: var(--muted);

    font-size: 12px;
}

.typing {
    color: var(--primary);

    font-weight: 600;
}


/* =========================
   BOTTOM STATUS
========================= */

.bottom-status {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 20px;

    padding: 14px 4px;

    color: var(--muted);

    font-size: 13px;
}

.bottom-status > div {
    display: flex;

    align-items: center;

    gap: 8px;
}


/* =========================
   FOOTER
========================= */

footer {
    margin-top: 40px;

    text-align: center;

    color: var(--muted);

    font-size: 12px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 750px) {

    .app {
        width: 94%;

        padding-top: 20px;
    }

    .header {
        margin-bottom: 35px;
    }

    .header-right {
        gap: 8px;
    }

    .online-status {
        font-size: 12px;
    }

    .hero h2 {
        font-size: 36px;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    textarea {
        min-height: 240px;
    }

    .bottom-status {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }
}


@media (max-width: 500px) {

    .brand p {
        display: none;
    }

    .online-status {
        display: none;
    }

    .hero h2 {
        font-size: 32px;
    }
}