/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Accessibility === */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 999;
    text-decoration: none;
}
.skip-link:focus {
    top: 8px;
}
*:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

:root {
    --bg:        #1a1a2e;
    --surface:   #16213e;
    --surface2:  #0f3460;
    --accent:    #e94560;
    --accent2:   #533483;
    --text:      #eee;
    --text-dim:  #8892b0;
    --green:     #64ffda;
    --yellow:    #ffd369;
    --radius:    8px;
    --mono:      "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
}

/* === Light Theme === */
[data-theme="light"] {
    --bg:        #f5f5f7;
    --surface:   #ffffff;
    --surface2:  #e5e5ea;
    --accent:    #0071e3;
    --accent2:   #7c3aed;
    --text:      #1d1d1f;
    --text-dim:  #6e6e73;
    --green:     #059669;
    --yellow:    #b45309;
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg:        #f5f5f7;
        --surface:   #ffffff;
        --surface2:  #e5e5ea;
        --accent:    #0071e3;
        --accent2:   #7c3aed;
        --text:      #1d1d1f;
        --text-dim:  #6e6e73;
        --green:     #059669;
        --yellow:    #b45309;
    }
}

/* === Theme Toggle === */
.theme-toggle {
    margin-left: auto;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover {
    color: var(--yellow);
    background: rgba(128, 128, 128, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 760px;
    padding: 60px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* === Site Nav === */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.site-nav-inner {
    width: 100%;
    max-width: 760px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.nav-brand:hover {
    color: var(--green);
    background: rgba(100, 255, 218, 0.08);
}
.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
}
.nav-links a {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
    color: var(--text);
    background: var(--surface2);
}
.nav-links a.active {
    color: var(--green);
    background: rgba(100, 255, 218, 0.08);
}

/* === Header === */
.header {
    text-align: center;
    padding: 48px 0 16px;
}
.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.header-sub {
    font-size: 1rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* === Tools Grid === */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card {
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    cursor: pointer;
}
.tool-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-2px);
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--accent2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.85);
}

.tool-info {
    flex: 1;
    min-width: 0;
}
.tool-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.tool-desc {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.tool-arrow {
    font-size: 1.3rem;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.tool-card:hover .tool-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* === Footer === */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.7;
    border-top: 1px solid var(--surface2);
    margin-top: 8px;
}
.footer-copy {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 500px) {
    .app { padding: 56px 12px 40px; }
    .header { padding: 32px 0 12px; }
    .header h1 { font-size: 1.8rem; }
    .tool-card { padding: 16px; gap: 14px; }
    .tool-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .tool-name { font-size: 0.95rem; }
    .tool-desc { font-size: 0.78rem; }
}
