:root {
    --bg-color: #f7f7f5;
    --surface-color: #ffffff;
    --text-primary: #121212;
    --text-secondary: #6b6b6b;
    --text-muted: #a1a1a1;
    --border-color: rgba(0, 0, 0, 0.08);
    --grid-line: rgba(0, 0, 0, 0.03);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --spacing-unit: 24px;
    --max-width: 1100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Layout Containers */
header, main, section, footer {
    width: 100%;
    max-width: var(--max-width);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Typography */
h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    max-width: 800px;
    text-align: left; /* Asymmetrical editorial feel */
}

header p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Components */
.drop-zone, .bento-card, .file-item {
    position: relative;
    width: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--text-primary);
}

.drop-zone.drop-zone-active {
    background-color: #f0f0ee;
    border-color: var(--text-primary);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 10;
    cursor: pointer;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 2);
    padding: 0 calc(var(--spacing-unit) * 0.5);
}

.btn-secondary {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-secondary:hover {
    color: var(--text-primary);
}

.file-list {
    margin-top: calc(var(--spacing-unit) * 1);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.5);
}

.file-item {
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.4s ease-out forwards;
}

.file-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.file-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--text-secondary);
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    color: var(--text-primary);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background-color: var(--bg-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

/* Results Area specific spacing */
.bento-card {
    margin-top: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 3);
    cursor: default;
}

.result-header {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

@media (min-width: 768px) {
    .result-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
}

.detected-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.detected-ext {
    font-size: 5rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.btn-primary {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: none;
    border-bottom: 1px solid var(--text-primary);
    padding: 0 0 2px 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover {
    opacity: 0.6;
}

.safeguard-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.hex-container {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    padding: var(--spacing-unit);
}

.hex-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hex-output {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.8;
}

/* Technical Guide Section */
.section-header h2 {
    font-size: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-unit);
}

.section-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.grid-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}

.step-item {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-unit);
}

.step-number {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.code-block {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* FAQ Section */
.faq-list {
    border-top: 1px solid var(--border-color);
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-unit) 0;
}

.faq-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-trigger h3 {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.faq-icon {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-muted);
}

.faq-content {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding-top: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 4);
}

.privacy-msg {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.privacy-msg strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Utilities & JS Compatibility */
.hidden { display: none; }

/* Script overrides - maintain monochrome */
.text-blue-500 { color: var(--text-primary) !important; }
.text-slate-600 { color: var(--text-muted) !important; }
.bg-slate-700 { background-color: #eee !important; color: var(--text-primary) !important; }
.text-slate-400 { color: var(--text-secondary) !important; }
.bg-white { background-color: var(--surface-color) !important; }
.text-black { color: var(--text-primary) !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@media (max-width: 640px) {
    body { padding: var(--spacing-unit); }
    h1 { font-size: 2.5rem; }
    .detected-ext { font-size: 3.5rem; }
}
