@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@1,600&display=swap');

:root {
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --line: #dfe7f2;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eff6ff;
    --shadow: 0 14px 35px rgba(37, 99, 235, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    padding-top: 76px;
    padding-bottom: 76px;
    color: var(--text);
    background: radial-gradient(circle at 82% 8%, rgba(37, 99, 235, 0.1), transparent 28rem), var(--background);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.site-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 76px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 5px 24px rgba(37, 99, 235, 0.05);
}

.site-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: calc(100% - 48px);
    height: 100%;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #ffffff;
    background: var(--accent);
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    object-fit: cover;
    background: #ffffff;
}

.header-login {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid #bfd0f5;
    border-radius: 10px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.language-switch { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.language-switch button { min-width: 42px; height: 32px; padding: 0 9px; border: 0; border-radius: 7px; color: #7a8aa0; background: transparent; font-size: 0.7rem; font-weight: 750; cursor: pointer; transition: 0.16s ease; }
.language-switch button:hover { color: var(--accent); }
.language-switch button.is-active { color: #fff; background: var(--accent); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18); }

.header-login:hover,
.header-login.is-active {
    border-color: var(--accent);
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.account-menu {
    position: relative;
    justify-self: end;
}

.account-menu .header-login {
    min-height: 42px;
    cursor: pointer;
}

.account-chevron {
    margin-left: 2px;
    font-size: 0.68rem;
    transition: transform 160ms ease;
}

.account-menu.is-open .account-chevron {
    transform: rotate(180deg);
}

.account-dropdown {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 10px);
    right: 0;
    width: 250px;
    overflow: hidden;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.16);
    backdrop-filter: blur(16px);
}

.account-dropdown[hidden] { display: none; }

.account-dropdown-user {
    display: grid;
    gap: 3px;
    margin: 2px 2px 7px;
    padding: 10px 11px 13px;
    border-bottom: 1px solid var(--line);
}

.account-dropdown-user strong { color: var(--text); font-size: 0.84rem; }
.account-dropdown-user span { overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }

.account-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    color: #52627a;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-dropdown-link i { width: 17px; color: #8494aa; text-align: center; }
.account-dropdown-link:hover,
.account-dropdown-link.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.account-dropdown-link:hover i,
.account-dropdown-link.is-active i { color: var(--accent); }
.account-dropdown-link.is-danger { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; color: #b42318; }
.account-dropdown-link.is-danger:hover { background: #fff1f0; }
.account-dropdown-link.is-danger i { color: #d92d20; }
.account-logout-form { margin: 0; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--background);
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.site-nav-link:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.site-nav-link.is-active {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.page-shell {
    width: calc(100% - 48px);
    margin: 0 auto;
    padding: 72px 0 36px;
}

.hero { max-width: 920px; margin-bottom: 48px; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #52627a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.eyebrow span { width: 28px; height: 2px; background: var(--accent-dark); }

.hero h1 {
    margin: 0;
    font-size: clamp(3.4rem, 9vw, 7.5rem);
    line-height: 0.88;
    letter-spacing: -0.075em;
}

.hero h1 em {
    color: var(--accent-dark);
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
}

.hero p {
    max-width: 680px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

code {
    padding: 0.18em 0.42em;
    border-radius: 5px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
}

.toolbar {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.search-box {
    display: flex;
    align-items: center;
    height: 58px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdff;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-box:focus-within {
    border-color: #93b4f8;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.search-box > i { margin-right: 12px; font-size: 1.15rem; }

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder { color: #94a3b8; }

.search-box kbd {
    flex: none;
    padding: 5px 8px;
    border: 1px solid #d7e1ef;
    border-radius: 7px;
    color: #718096;
    background: #fff;
    font-size: 0.72rem;
}

.usage-example {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 2px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.library-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 42px 2px 18px;
}

.library-heading h2 { margin: 0; font-size: 1.15rem; }
.library-heading p { margin: 5px 0 0; color: var(--muted); font-size: 0.78rem; }
.library-heading > span { color: var(--muted); font-size: 0.82rem; }

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.icon-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 184px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.icon-card:hover {
    z-index: 1;
    transform: translateY(-4px);
    border-color: #b9cdf7;
    box-shadow: var(--shadow);
}

.icon-card:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.38); outline-offset: 2px; }
.icon-card[hidden] { display: none; }

.icon-preview {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: auto;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    transition: background 180ms ease;
}

.icon-card:hover .icon-preview { color: #ffffff; background: var(--accent); }
.icon-preview i { font-size: 1.8rem; line-height: 1; }

.icon-name {
    display: block;
    overflow: hidden;
    width: 100%;
    margin-top: 22px;
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-code {
    display: block;
    overflow: hidden;
    width: 100%;
    margin-top: 5px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    padding: 72px 20px;
    border: 1px dashed #bfd0ed;
    border-radius: 18px;
    text-align: center;
}

.empty-state[hidden] { display: none; }
.empty-state i { font-size: 2rem; color: var(--accent-dark); }
.empty-state h2 { margin: 14px 0 6px; font-size: 1.05rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.site-footer {
    position: fixed;
    z-index: 900;
    bottom: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 -5px 24px rgba(37, 99, 235, 0.06);
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% - 48px);
    height: 76px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
}

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

.footer-brand strong {
    display: block;
    color: var(--text);
    font-size: 0.95rem;
}

.footer-brand p,
.footer-copyright {
    margin: 3px 0 0;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a.is-active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.copy-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    max-width: min(440px, calc(100% - 44px));
    overflow: hidden;
    padding: 12px 17px;
    border-radius: 11px;
    color: #fff;
    background: #171816;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.copy-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
    .icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .site-header-inner, .page-shell { width: min(100% - 24px, 1180px); }
    .site-header-inner { grid-template-columns: auto 1fr; }
    .site-nav, .site-nav-spacer { display: none; }
    .header-actions { grid-column: 2; grid-row: 1; }
    .header-login { padding: 8px 10px; }
    .header-login span { display: none; }
    .header-actions { gap: 6px; }
    .language-switch button { min-width: 34px; padding-inline: 6px; }
    .account-chevron { display: none; }
    .account-dropdown { width: min(250px, calc(100vw - 24px)); }
    .site-nav-link { padding: 8px 10px; }
    .site-nav-link i { display: none; }
    .page-shell { padding-top: 50px; }
    .hero { margin-bottom: 36px; }
    .hero h1 { font-size: clamp(3.2rem, 18vw, 5.2rem); }
    .hero p { margin-top: 22px; font-size: 0.95rem; }
    .toolbar { padding: 12px; border-radius: 17px; }
    .search-box kbd { display: none; }
    .library-heading { align-items: flex-start; gap: 14px; }
    .icon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .icon-card { min-height: 170px; }
    .site-footer-inner {
        align-items: center;
        width: min(100% - 24px, 1180px);
        height: 76px;
        padding: 0;
        gap: 10px;
    }

    .footer-brand p,
    .footer-copyright {
        display: none;
    }

    .footer-nav {
        gap: 2px;
    }

    .footer-nav a {
        padding: 7px 8px;
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
