:root {
    --bg-color: #0F0A1A;
    --surface-color: #1A1525;
    --surface-color-hover: #231C33;
    --text-primary: #FFFFFF;
    --text-secondary: #A09DB0;
    --accent-color: #6C63FF;
    --accent-color-hover: #5A52D9;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;

    /* The Modern System Stack being evaluated */
    --system-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Header */
header {
    margin-bottom: 4rem;
    text-align: left;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #FFFFFF, #B0A8FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* Sections */
section {
    margin-bottom: 5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-row h2 {
    margin-bottom: 0;
}

/* Code Block */
.code-block {
    background: #000000;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    color: #E2E8F0;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.btn {
    background: rgba(108, 99, 255, 0.1);
    color: #B0A8FF;
    border: 1px solid rgba(108, 99, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: rgba(108, 99, 255, 0.2);
    border-color: rgba(108, 99, 255, 0.5);
}

/* OS Detection */
.os-detection {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.os-detection strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Sandbox */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.control-group span {
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.system-font-text {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    font-family: var(--system-stack);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0px;
    /* Add subtle styling when focused */
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.2s;
}

.system-font-text:focus {
    border-color: var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* Platform Differences Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #E2E8F0;
}

.sample-text {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

/* Simulated Fonts for cards if viewing on different OS */
.macos-font {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.windows-font {
    font-family: "Segoe UI", sans-serif;
}

.linux-font {
    font-family: Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.android-font {
    font-family: Roboto, sans-serif;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

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

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 1.5rem;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}