:root {
    --color-bg: #faf8f5;
    --color-surface: #ffffff;
    --color-surface-soft: #f7f5f1;
    --color-text: #1a1a1a;
    --color-text-soft: #6b6b6b;
    --color-text-muted: #9a9a9a;
    --color-accent: #2d5a4d;
    --color-accent-soft: #4a7c6d;
    --color-accent-light: #e6f0ec;
    --color-border: #e5e2dc;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 24px rgba(0, 0, 0, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hero {
    padding: 48px 24px 32px;
    text-align: center;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.logo-mark {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.logo-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.logo-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.hero-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-soft);
    font-weight: 300;
    letter-spacing: 0.01em;
}

.workspace {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 520px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-medium);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(to bottom, var(--color-surface-soft), var(--color-surface));
}

.panel-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-icon {
    font-size: 1.25rem;
    opacity: 0.8;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.editor-wrapper {
    flex: 1;
    padding: 24px;
}

#asciiInput {
    width: 100%;
    height: 340px;
    padding: 20px;
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: none;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#asciiInput:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light);
}

#asciiInput::placeholder {
    color: var(--color-text-muted);
}

.examples-bar {
    padding: 0 24px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.examples-label {
    font-size: 0.875rem;
    color: var(--color-text-soft);
    font-weight: 500;
}

.example-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-soft);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    color: var(--color-accent);
    border-color: var(--color-accent-soft);
    background: var(--color-accent-light);
    transform: translateY(-1px);
}

.divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
}

.divider-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(to bottom, transparent, var(--color-border), transparent);
}

.divider-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-wrapper input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--color-surface);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-wrapper input:checked + .toggle-slider {
    background: var(--color-accent);
}

.toggle-wrapper input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--color-text-soft);
    font-weight: 500;
}

.primary-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--color-accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 77, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn svg {
    width: 18px;
    height: 18px;
}

.canvas-wrapper {
    flex: 1;
    padding: 24px;
}

.canvas-container {
    width: 100%;
    height: 340px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
}

#outputCanvas {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

.footer {
    padding: 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .divider {
        flex-direction: row;
        padding: 0;
    }

    .divider-line {
        width: auto;
        height: 1px;
    }

    .divider-icon {
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 32px 16px 24px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .workspace {
        padding: 0 16px 32px;
    }

    .panel-header {
        padding: 16px;
    }

    .editor-wrapper,
    .canvas-wrapper {
        padding: 16px;
    }

    .examples-bar {
        padding: 0 16px 16px;
    }
}
