:root {
    --bg-primary: #f4f5f8;
    --bg-card: #ffffff;
    --bg-input: #eef0f5;
    --accent: #c4384a;
    --accent-hover: #d94a5c;
    --text: #1a1d27;
    --text-muted: #5c6270;
    --border: #dde1ea;
    --radius: 12px;
    --shadow: 0 8px 28px rgba(24, 28, 40, 0.08);
    --radius-full: 9999px;
}

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

html { scroll-behavior: smooth; color-scheme: light; }

body {
    background: var(--bg-primary);
    color: var(--text);
    font-family: 'Outfit', system-ui, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.site-header .brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1.5px;
}

.site-header .brand span {
    color: var(--text);
    font-weight: 400;
    margin-left: 0.4rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0;
}

.site-header nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 1.5rem;
    transition: color 0.3s;
}

.site-header nav a:hover { color: var(--accent); }

/* Main container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Tool listing */
.tool-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.tool-link {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.tool-link:hover {
    border-color: rgba(196, 56, 74, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(24, 28, 40, 0.12);
}

.tool-link .icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(196, 56, 74, 0.08);
    border: 1px solid rgba(196, 56, 74, 0.12);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
}

.tool-link .info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.tool-link .info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Tool page layout */
.tool-page {
    margin-top: 1rem;
}

.tool-page h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.tool-page .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.tool-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s;
}

.tool-page .back-link:hover { color: var(--accent-hover); }

/* Form elements */
.input-group { margin-bottom: 1rem; }

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

textarea, input[type="text"], select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.3s;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea { min-height: 150px; }

.output-box {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.9rem;
    min-height: 100px;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.btn-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(196, 56, 74, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(196, 56, 74, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text);
    border-color: #bcc2ce;
}

.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 999;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Ad region */
.ad-region {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .tool-listing { grid-template-columns: 1fr; }
    .site-header { padding: 0.8rem 1rem; }
    .site-header nav a { margin-left: 1rem; font-size: 0.8rem; }
    .container { padding: 1.5rem 1rem 3rem; }
}
