/* ========================================================================
   SIGNAL CORE — Design System v1.0
   Swiss Punk × Terminal Utility — 2027 Future Ready
   ======================================================================== */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* === DESIGN TOKENS === */
:root {
    --surface:              #0A0A0A;
    --surface-container:    #141414;
    --surface-container-high: #1E1E1E;
    --surface-container-low: #111111;
    --surface-lowest:       #060606;
    --signal-orange:        #FF6B35;
    --signal-orange-dim:    rgba(255, 107, 53, 0.15);
    --signal-orange-glow:   rgba(255, 107, 53, 0.4);
    --on-surface:           #E5E2E1;
    --on-surface-dim:       #8A8786;
    --on-surface-faint:     rgba(229, 226, 225, 0.4);
    --outline:              #594139;
    --outline-dim:          rgba(89, 65, 57, 0.3);
    --error:                #FF4444;
    --success:              #22C55E;
    --font-headline:        'Space Grotesk', sans-serif;
    --font-body:            'DM Sans', sans-serif;
    --font-mono:            'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

::selection {
    background: var(--signal-orange);
    color: #000;
}

/* === SCANLINE OVERLAY === */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 0, 0, 0.03) 1px,
        rgba(0, 0, 0, 0.03) 2px
    );
    pointer-events: none;
    z-index: 9999;
}

@media (prefers-reduced-motion: reduce) {
    body::after { display: none; }
}

/* === TYPOGRAPHY SCALE === */
.font-headline { font-family: var(--font-headline); }
.font-body     { font-family: var(--font-body); }
.font-mono     { font-family: var(--font-mono); }

.text-display  { font-size: clamp(3rem, 10vw, 8rem); font-weight: 700; line-height: 0.85; letter-spacing: -0.04em; }
.text-h1       { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; }
.text-h2       { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.text-h3       { font-size: 1.25rem; font-weight: 600; }
.text-body     { font-size: 0.9375rem; }
.text-label    { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.15em; }
.text-micro    { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.2em; }

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-around  { justify-content: space-around; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }   .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.gap-x-8 { column-gap: 2rem; } .gap-y-10 { row-gap: 2.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-1 { flex: 1; }
.self-center { align-self: center; }

/* === SIZES === */
.w-1   { width: 0.25rem; } .w-1\.5 { width: 0.375rem; }
.w-2   { width: 0.5rem; }  .w-3   { width: 0.75rem; }
.w-4   { width: 1rem; }    .w-5   { width: 1.25rem; }
.w-6   { width: 1.5rem; }  .w-8   { width: 2rem; }
.w-10  { width: 2.5rem; }  .w-12  { width: 3rem; }
.w-16  { width: 4rem; }    .w-32  { width: 8rem; }
.w-full { width: 100%; }   .w-1\/2 { width: 50%; }

.h-1   { height: 0.25rem; } .h-1\.5 { height: 0.375rem; }
.h-2   { height: 0.5rem; }  .h-3   { height: 0.75rem; }
.h-4   { height: 1rem; }    .h-5   { height: 1.25rem; }
.h-6   { height: 1.5rem; }  .h-8   { height: 2rem; }
.h-10  { height: 2.5rem; }  .h-12  { height: 3rem; }
.h-16  { height: 4rem; }    .h-32  { height: 8rem; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* === GRID === */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:flex-row    { flex-direction: row; }
    .md\:hidden      { display: none !important; }
    .md\:flex        { display: flex !important; }
    .md\:block       { display: block !important; }
    .md\:text-base   { font-size: 1rem; }
    .md\:text-6xl    { font-size: 3.75rem; }
    .md\:p-8         { padding: 2rem; }
    .md\:p-12        { padding: 3rem; }
    .md\:text-4xl    { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:col-span-5  { grid-column: span 5; }
    .lg\:col-span-7  { grid-column: span 7; }
    .lg\:grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
}

/* === SPACING === */
.p-2 { padding: 0.5rem; }   .p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }     .p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-4 { padding-right: 1rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }   .mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }
.ml-1 { margin-left: 0.25rem; } .ml-2 { margin-left: 0.5rem; } .ml-3 { margin-left: 0.75rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.pt-2 { padding-top: 0.5rem; } .pt-12 { padding-top: 3rem; }

/* === SIGNAL CORE NAV === */
nav, .nav-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--outline-dim);
    font-family: var(--font-mono);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0 1.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* === SIGNAL CORE HEADER === */
header {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
    position: relative;
    border-bottom: 1px solid var(--outline-dim);
}

header h1 {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(3rem, 12vw, 7rem);
    color: var(--on-surface);
    letter-spacing: -0.04em;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 1rem;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

header p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--signal-orange);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    max-width: 36rem;
    margin: 0 auto 1.5rem;
}

/* === TOOL PANELS (glass-panel replacement) === */
.glass-panel {
    background: var(--surface-container);
    border: 1px solid var(--outline-dim);
    border-radius: 0;
}

.glass-panel:hover {
    border-color: var(--signal-orange-glow);
}

/* === SIGNAL INPUTS === */
.glass-input {
    background: var(--surface-lowest);
    border: 1px solid var(--outline-dim);
    border-radius: 0;
    color: var(--on-surface);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

.glass-input::placeholder {
    color: var(--on-surface-dim);
    font-family: var(--font-mono);
}

.glass-input:focus {
    border-color: var(--signal-orange);
    box-shadow: 0 0 0 1px var(--signal-orange-glow);
}

textarea.glass-input { resize: vertical; }
select.glass-input { cursor: pointer; }

/* === BUTTONS === */
button, .btn {
    cursor: pointer;
    font-family: var(--font-mono);
    border-radius: 0;
    transition: all 0.15s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Primary — Signal Orange */
.btn-primary,
button[class*="bg-indigo"],
button[class*="bg-gradient"],
#extractBtn, #generateQrBtn, #generatePasswordBtn, #generateTweetBtn,
#downloadTweetBtn, #downloadQrBtn, #downloadCompressedBtn, #downloadConvertedBtn {
    background: var(--signal-orange) !important;
    color: #000 !important;
    border: 2px solid var(--signal-orange) !important;
    border-radius: 0 !important;
    padding: 0.75rem 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: none !important;
    background-image: none !important;
}

.btn-primary:hover,
button[class*="bg-indigo"]:hover,
button[class*="bg-gradient"]:hover,
#extractBtn:hover, #generateQrBtn:hover, #generatePasswordBtn:hover,
#downloadTweetBtn:hover, #downloadQrBtn:hover, #downloadCompressedBtn:hover,
#downloadConvertedBtn:hover, #generateTweetBtn:hover {
    background: transparent !important;
    color: var(--signal-orange) !important;
    border-color: var(--signal-orange) !important;
}

/* Secondary — Outline */
.btn-secondary,
.action-btn,
button[class*="bg-slate-700"] {
    background: transparent !important;
    color: var(--on-surface) !important;
    border: 1px solid var(--outline-dim) !important;
    border-radius: 0 !important;
    padding: 0.5rem 1rem;
    text-transform: none !important;
}

.btn-secondary:hover,
.action-btn:hover,
button[class*="bg-slate-700"]:hover {
    border-color: var(--signal-orange) !important;
    color: var(--signal-orange) !important;
    background: var(--signal-orange-dim) !important;
}

/* Ghost/Link */
.btn-ghost {
    background: transparent;
    color: var(--signal-orange);
    border: none;
    padding: 0.5rem;
}

/* Buy me a coffee — neutralize */
a[href*="buymeacoffee"] {
    background: var(--signal-orange) !important;
    color: #000 !important;
    border-radius: 0 !important;
    font-family: var(--font-mono) !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.1em;
    box-shadow: none !important;
}

a[href*="buymeacoffee"]:hover {
    background: transparent !important;
    color: var(--signal-orange) !important;
    outline: 2px solid var(--signal-orange);
}

/* === TAB NAVIGATION === */
.tab-btn {
    font-family: var(--font-mono) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: var(--on-surface-dim) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.625rem 1rem !important;
    position: relative;
    transition: color 0.2s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: transparent;
    transition: background 0.2s;
}

.tab-btn:hover {
    color: var(--on-surface) !important;
}

.tab-btn.active {
    color: var(--signal-orange) !important;
    font-weight: 700 !important;
}

.tab-btn.active::after {
    background: var(--signal-orange);
}

/* Category buttons */
.cat-btn {
    text-transform: none !important;
}
.cat-btn.active {
    background: var(--signal-orange) !important;
    color: #fff !important;
    border-color: var(--signal-orange) !important;
}
.cat-btn:not(.active):hover {
    border-color: var(--signal-orange) !important;
    color: var(--signal-orange) !important;
}

/* Tab container */
.tab-container,
div[class*="glass-panel"][class*="rounded-2xl"][class*="justify-center"] {
    background: var(--surface-container) !important;
    border: 1px solid var(--outline-dim) !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* === FILTER CHIPS === */
.filter-chip {
    font-family: var(--font-mono) !important;
    font-size: 0.6875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    border-radius: 0 !important;
    border: 1px solid var(--outline-dim) !important;
    background: transparent !important;
    color: var(--on-surface-dim) !important;
    padding: 0.375rem 0.75rem !important;
    cursor: pointer;
}

.filter-chip:hover { border-color: var(--signal-orange) !important; color: var(--on-surface) !important; }

.filter-chip.active {
    background: var(--signal-orange) !important;
    color: #000 !important;
    border-color: var(--signal-orange) !important;
}

/* === TOOL CARDS === */
.tool-section h2 {
    font-family: var(--font-headline);
    color: var(--on-surface);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.tool-section h3 {
    font-family: var(--font-headline);
    color: var(--on-surface);
}

/* === TOAST NOTIFICATION === */
#toast-notification {
    background: var(--signal-orange) !important;
    color: #000 !important;
    border-radius: 0 !important;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8125rem;
}

/* === COLOR PREVIEW === */
#colorPreview {
    border-radius: 0 !important;
    border: 2px solid var(--outline-dim) !important;
}

/* === FORM ELEMENTS === */
input[type="range"] {
    accent-color: var(--signal-orange);
}

input[type="checkbox"] {
    accent-color: var(--signal-orange);
    border-radius: 0;
}

input[type="color"] {
    border: 1px solid var(--outline-dim);
    border-radius: 0;
    background: var(--surface-lowest);
}

select {
    background: var(--surface-lowest) !important;
    border: 1px solid var(--outline-dim) !important;
    border-radius: 0 !important;
    color: var(--on-surface) !important;
    font-family: var(--font-mono) !important;
}

/* === LABELS === */
label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--signal-orange);
}

/* === LANG BUTTONS === */
.lang-btn {
    border-radius: 0 !important;
    border: 1px solid var(--outline-dim);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lang-btn:hover, .lang-btn.active {
    border-color: var(--signal-orange);
    opacity: 1 !important;
}

/* === MOBILE NAV === */
#mobileNavToggle {
    border-radius: 0 !important;
    background: var(--surface-container) !important;
    border: 1px solid var(--outline-dim) !important;
    font-family: var(--font-mono) !important;
    text-transform: uppercase;
}

#mobileNavMenu {
    border-radius: 0 !important;
    background: var(--surface-container) !important;
    border: 1px solid var(--outline-dim) !important;
}

#mobileNavMenu a, #mobileNavMenu button {
    border-radius: 0 !important;
    font-family: var(--font-mono) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

/* === FOOTER === */
footer {
    background: var(--surface-lowest);
    border-top: 1px solid var(--outline-dim);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--on-surface-dim);
    padding: 1.5rem;
    text-align: center;
}

footer a {
    color: var(--signal-orange);
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover { opacity: 0.7; }

/* === RICH SEO SECTION === */
section article h3 span[class*="bg-"] {
    background: var(--signal-orange-dim) !important;
    color: var(--signal-orange) !important;
    border-radius: 0 !important;
}

section article h3 span[class*="bg-"] svg {
    color: var(--signal-orange) !important;
}

/* === DROP ZONE === */
.drop-zone {
    border: 2px dashed var(--outline-dim);
    transition: border-color 0.3s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--signal-orange);
    background: var(--signal-orange-dim);
}

/* === STRENGTH BAR === */
#strengthBar { border-radius: 0; }
.strength-bar-container { border-radius: 0 !important; }

/* === AI GRID CARDS === */
#aiGrid > div, #aiGrid > a {
    background: var(--surface-container);
    border: 1px solid var(--outline-dim);
    border-radius: 0;
    transition: border-color 0.2s, transform 0.2s;
}

#aiGrid > div:hover, #aiGrid > a:hover {
    border-color: var(--signal-orange);
    transform: scale(1.01);
}

/* === PASSWORD OUTPUT === */
#passwordOutput {
    background: var(--surface-lowest) !important;
    color: var(--signal-orange) !important;
    border: 1px solid var(--outline-dim) !important;
    border-radius: 0 !important;
    font-family: var(--font-mono) !important;
}

/* === QR CODE AREA === */
#qrcode {
    background: #fff;
    border-radius: 0 !important;
}

/* === IMAGE PREVIEWS === */
img { max-width: 100%; height: auto; }

.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl, .rounded-full {
    border-radius: 0 !important;
}

/* === HIDDEN / VISIBLE === */
.hidden { display: none; }
.block  { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.leading-relaxed { line-height: 1.75; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.opacity-0  { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-80 { opacity: 0.8; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.min-h-\[400px\] { min-height: 400px; }
.min-h-\[200px\] { min-height: 200px; }
.min-h-\[300px\] { min-height: 300px; }
.max-h-64 { max-height: 16rem; }
.max-h-\[400px\] { max-height: 400px; }
.object-contain { object-fit: contain; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.z-40 { z-index: 40; } .z-50 { z-index: 50; } .z-60 { z-index: 60; }
.top-0  { top: 0; } .top-2 { top: 0.5rem; } .top-5 { top: 1.25rem; }
.top-1\/2 { top: 50%; }
.right-0 { right: 0; } .right-3 { right: 0.75rem; } .right-4 { right: 1rem; } .right-5 { right: 1.25rem; }
.left-0 { left: 0; } .left-3 { left: 0.75rem; }
.bottom-0 { bottom: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.transform { transform: none; }
.-translate-y-1\/2 { transform: translateY(-50%); }

/* === SIGNAL CORE COLORS === */
.text-white       { color: var(--on-surface) !important; }
.text-slate-300   { color: var(--on-surface) !important; }
.text-slate-400   { color: var(--on-surface-dim) !important; }
.text-slate-500   { color: var(--on-surface-faint) !important; }
.text-rose-400    { color: var(--error) !important; }
.text-emerald-400 { color: var(--success) !important; }
.text-emerald-600 { color: var(--success) !important; }
.text-indigo-400  { color: var(--signal-orange) !important; }
.text-transparent { color: var(--on-surface) !important; }
.bg-clip-text     { -webkit-background-clip: unset !important; background-clip: unset !important; }
.bg-gradient-to-r { background: none !important; }

.bg-emerald-600, .bg-emerald-500 {
    background: var(--success) !important;
    color: #000 !important;
}

.bg-sky-500, .bg-sky-600 { background: var(--signal-orange) !important; }
.bg-pink-600, .bg-pink-500 { background: var(--signal-orange) !important; }
.bg-red-500\/20 { background: var(--signal-orange-dim) !important; }
.bg-sky-500\/20, .bg-indigo-500\/20, .bg-blue-500\/20, .bg-emerald-500\/20,
.bg-pink-500\/20, .bg-purple-500\/20, .bg-orange-500\/20, .bg-cyan-500\/20, .bg-teal-500\/20 {
    background: var(--signal-orange-dim) !important;
}

.text-red-500, .text-sky-400, .text-indigo-400, .text-blue-400,
.text-emerald-400, .text-pink-400, .text-purple-400, .text-orange-400,
.text-cyan-400, .text-teal-400 {
    color: var(--signal-orange) !important;
}

.bg-\[#FFDD00\], .bg-\[#FFEA00\] { background: var(--signal-orange) !important; }
.text-slate-900 { color: #000 !important; }
.bg-black\/20   { background: rgba(0,0,0,0.3) !important; }
.bg-black\/40   { background: rgba(0,0,0,0.5) !important; }
.bg-white\/5    { background: rgba(255,255,255,0.03) !important; }
.bg-white\/10   { background: rgba(255,255,255,0.05) !important; }
.border-slate-600, .border-slate-700, .border-slate-800, .border-slate-800\/50,
.border-white\/5, .border-white\/10 {
    border-color: var(--outline-dim) !important;
}

.shadow-lg, .shadow-xl, .shadow-2xl { box-shadow: none !important; }
.shadow-indigo-500\/30, .shadow-emerald-500\/30, .shadow-sky-500\/30,
.shadow-pink-500\/30, .shadow-indigo-500\/20, .shadow-lg { box-shadow: none !important; }

/* === FLICKER-IN ANIMATION === */
.fade-in {
    animation: signal-flicker 0.4s ease-in-out forwards;
}

@keyframes signal-flicker {
    0%   { opacity: 0; transform: translateY(8px) scale(0.99); }
    15%  { opacity: 0.7; transform: translateY(3px) scale(0.995); }
    25%  { opacity: 0.15; transform: translateY(2px) scale(0.998); }
    40%  { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* === CURSOR BLINK === */
.cursor-blink::after {
    content: '█';
    animation: blink 1s infinite step-end;
    color: var(--signal-orange);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === RESPONSIVE TWEAKS === */
@media (max-width: 767px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-auto   { width: auto; }
    .sm\:grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    header h1 { font-size: clamp(2.5rem, 15vw, 5rem); }
}

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-auto   { width: auto; }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--outline); }
::-webkit-scrollbar-thumb:hover { background: var(--signal-orange); }

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

/* === MOBILE LAYOUT OPTIMIZATIONS === */
@media (max-width: 767px) {
    /* Body-level side gutters */
    body {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    /* Header safe-area top spacing */
    header.text-center {
        padding-top: 3rem !important;
        margin-bottom: 1rem !important;
    }
    /* Lang buttons clear area */
    header .absolute {
        top: 1rem !important;
        right: 0.5rem !important;
    }
    /* Tools container children breathing room */
    #tools-container .tool-section > div {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* Sticky nav breathing room */
    .sticky.top-2 {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
}

/* === PRINT === */
@media print {
    body::after { display: none; }
    body { background: #fff; color: #000; }
}

/* === TOAST NOTIFICATIONS === */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--signal-orange);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
