/* Dalk Audio — Design System */
:root {
    --bg: #0D0D0D;
    --bg-card: #1A1A1A;
    --bg-elevated: #222;
    --text: #E8E8E8;
    --text-muted: #888;
    --accent: #1A6FFF;
    --accent-hover: #3d85ff;
    --border: #2a2a2a;
    --danger: #ff4444;
    --success: #22c55e;
    --font-heading: 'Manrope', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --radius: 8px;
    --header-h: 64px;
    --container: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.page-title,
.product-name,
.admin-page-title,
.admin-brand,
.admin-section-title,
.stat-value {
    font-family: var(--font-heading);
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); font-size: 0.875rem; }

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.container.narrow { max-width: 720px; }

/* Announcement */
.announcement-bar {
    background: var(--accent);
    color: #fff;
    text-align: center;
    padding: 0.5rem 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
}

.announcement-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: var(--header-h);
}

.logo { height: 36px; width: auto; }

.main-nav {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active { color: var(--text); }

.cart-link {
    position: relative;
    color: var(--text);
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.cart-icon { width: 24px; height: 24px; }

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

.cart-badge.hidden { display: none; }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
}

.site-main { flex: 1; }

/* Hero */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13,13,13,0.4) 0%, rgba(13,13,13,0.95) 100%),
        url('../images/hero-bg.svg') center/cover no-repeat;
    background-color: #111;
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 4rem 1rem;
}

.hero-logo {
    height: 240px;
    width: auto;
    max-width: min(90vw, 720px);
    margin: 0 auto 1.5rem;
    display: block;
}

.page-header-centered { text-align: center; }
.page-header-centered .container { margin-inline: auto; }

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* Sections */
.section { padding: 4rem 0; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; font-weight: 600; }
.section-text { color: var(--text-muted); margin: 0 0 1.5rem; }
.section-cta { text-align: center; margin-top: 2rem; }

.page-header { padding-bottom: 0; }
.page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 0.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); margin: 0; }

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.product-card:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.product-image-wrap {
    aspect-ratio: 1;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-lg { font-size: 0.8125rem; padding: 0.375rem 0.75rem; }

.badge-free { background: var(--accent); }
.badge-trial { background: #6b7280; }

.product-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-action-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.product-action-divider::before,
.product-action-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.product-card-body { padding: 1.25rem; }

.product-name { margin: 0 0 0.25rem; font-size: 1.0625rem; font-weight: 600; }
.product-version { margin: 0 0 0.5rem; font-size: 0.8125rem; color: var(--text-muted); }
.product-price { margin: 0 0 1rem; color: var(--accent); font-weight: 600; }
.product-price-lg { font-size: 1.5rem; color: var(--accent); font-family: var(--font-mono); margin: 0 0 1.5rem; }

.product-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-muted { color: var(--text-muted); font-size: 0.875rem; }
.link-muted:hover { color: var(--text); }

/* Product detail */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.product-detail-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
    background: var(--bg-card);
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-description { color: var(--text-muted); margin-bottom: 1.5rem; }

.demo-audio { margin-bottom: 1.5rem; }
.demo-audio audio { width: 100%; margin-top: 0.5rem; }

.system-requirements {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.system-requirements h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.system-requirements p { color: var(--text-muted); margin: 0; font-size: 0.9375rem; }

.label { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 0.5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: #444; color: var(--text); }

.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-icon { background: none; border: none; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; }
.btn-icon:hover { color: var(--danger); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 500; }

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 111, 255, 0.15);
}

.textarea { resize: vertical; min-height: 120px; }
.input-qty { width: 64px; text-align: center; }
.required { color: var(--accent); }

.contact-form, .newsletter-form, .free-download-form, .checkout-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.newsletter-form {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.newsletter-form .input { flex: 1; min-width: 160px; }

.contact-info { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.contact-item { color: var(--accent); }

/* Terms */
.terms-details summary { cursor: pointer; list-style: none; }
.terms-details summary::-webkit-details-marker { display: none; }
.scroll-box {
    max-height: 240px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-top: 1rem;
}

/* Cart */
.cart-table-wrap { overflow-x: auto; margin-bottom: 1rem; }

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th, .cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cart-table th { font-size: 0.8125rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.cart-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-product img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-card);
}

.cart-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    padding-top: 1rem;
}

.cart-subtotal { font-size: 1.125rem; margin: 0; }

/* Checkout */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.checkout-summary h2 { margin: 0 0 1rem; font-size: 1.125rem; }

.checkout-items {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.checkout-items li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

.checkout-totals .total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.checkout-totals .total {
    font-weight: 700;
    font-size: 1.125rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.checkout-totals .discount { color: var(--success); }

.coupon-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.coupon-message { font-size: 0.875rem; color: var(--text-muted); margin: -0.5rem 0 1rem; }

.checkout-fx-note,
.checkout-rate-note {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal h2 { margin: 0 0 1rem; }

.modal-scroll { flex: 1; margin-bottom: 1.5rem; }

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Thank you */
.thank-you-section { padding: 6rem 0; }
.text-center { text-align: center; }

.thank-you-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.hint-text { color: var(--text-muted); font-size: 0.9375rem; }

/* Social */
.social-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.social-btn svg { width: 20px; height: 20px; }
.social-btn:hover { border-color: var(--accent); color: var(--text); }
.social-btn-lg { padding: 0.875rem 1.5rem; }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.site-footer p { margin: 0; color: var(--text-muted); font-size: 0.875rem; text-align: center; width: 100%; }

/* Oscilloscope divider */
.oscilloscope-divider {
    height: 48px;
    background: var(--bg);
    overflow: hidden;
}

#oscilloscope-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Alerts & toasts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-error { background: rgba(255, 68, 68, 0.12); border: 1px solid rgba(255, 68, 68, 0.3); color: #fca5a5; }

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.9375rem;
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.empty-state { color: var(--text-muted); margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .main-nav.open { display: flex; }

    .mobile-menu-toggle { display: flex; margin-left: auto; }

    .header-inner { position: relative; }

    .product-detail-grid,
    .checkout-grid { grid-template-columns: 1fr; }

    .newsletter-form { flex-direction: column; }

    .cart-summary { align-items: stretch; }
}
