:root {
    /* Primitive Color Tokens */
    --color-white: rgba(255, 255, 255, 1);
    --color-black: rgba(0, 0, 0, 1);
    --color-cream-50: rgba(252, 252, 249, 1);
    --color-cream-100: rgba(255, 255, 253, 1);
    --color-gray-200: rgba(245, 245, 245, 1);
    --color-gray-300: rgba(167, 169, 169, 1);
    --color-gray-400: rgba(119, 124, 124, 1);
    --color-slate-500: rgba(98, 108, 113, 1);
    --color-brown-600: rgba(94, 82, 64, 1);
    --color-charcoal-700: rgba(31, 33, 33, 1);
    --color-charcoal-800: rgba(38, 40, 40, 1);
    --color-slate-900: rgba(19, 52, 59, 1);
    --color-teal-300: rgba(50, 184, 198, 1);
    --color-teal-400: rgba(45, 166, 178, 1);
    --color-teal-500: rgba(33, 128, 141, 1);
    --color-teal-600: rgba(29, 116, 128, 1);
    --color-teal-700: rgba(26, 104, 115, 1);
    --color-teal-800: rgba(41, 150, 161, 1);
    --color-red-400: rgba(255, 84, 89, 1);
    --color-red-500: rgba(192, 21, 47, 1);
    --color-orange-400: rgba(230, 129, 97, 1);
    --color-orange-500: rgba(168, 75, 47, 1);
    /* RGB versions for opacity control */
    --color-brown-600-rgb: 94, 82, 64;
    --color-teal-500-rgb: 33, 128, 141;
    --color-slate-900-rgb: 19, 52, 59;
    --color-slate-500-rgb: 98, 108, 113;
    --color-red-500-rgb: 192, 21, 47;
    --color-red-400-rgb: 255, 84, 89;
    --color-orange-500-rgb: 168, 75, 47;
    --color-orange-400-rgb: 230, 129, 97;
    /* Background color tokens (Light Mode) */
    --color-bg-1: rgba(59, 130, 246, 0.08);
    /* Light blue */
    --color-bg-2: rgba(245, 158, 11, 0.08);
    /* Light yellow */
    --color-bg-3: rgba(34, 197, 94, 0.08);
    /* Light green */
    --color-bg-4: rgba(239, 68, 68, 0.08);
    /* Light red */
    --color-bg-5: rgba(147, 51, 234, 0.08);
    /* Light purple */
    --color-bg-6: rgba(249, 115, 22, 0.08);
    /* Light orange */
    --color-bg-7: rgba(236, 72, 153, 0.08);
    /* Light pink */
    --color-bg-8: rgba(6, 182, 212, 0.08);
    /* Light cyan */
    /* Semantic Color Tokens (Light Mode) */
    --color-background: var(--color-cream-50);
    --color-surface: rgba(233, 209, 177, 1);
    --color-text: var(--color-slate-900);
    --color-text-secondary: var(--color-slate-500);
    --color-primary: var(--color-teal-500);
    --color-primary-hover: var(--color-teal-600);
    --color-primary-active: var(--color-teal-700);
    --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
    --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
    --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
    --color-border: rgba(var(--color-brown-600-rgb), 0.2);
    --color-btn-primary-text: var(--color-cream-50);
    --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
    --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
    --color-error: var(--color-red-500);
    --color-success: var(--color-teal-500);
    --color-warning: var(--color-orange-500);
    --color-info: var(--color-slate-500);
    --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
    --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);
    /* Common style patterns */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    /* RGB versions for opacity control */
    --color-success-rgb: 33, 128, 141;
    --color-error-rgb: 192, 21, 47;
    --color-warning-rgb: 168, 75, 47;
    --color-info-rgb: 98, 108, 113;
    /* Typography */
    --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 30px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 550;
    --font-weight-bold: 600;
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --letter-spacing-tight: -0.01em;
    /* Spacing */
    --space-0: 0;
    --space-1: 1px;
    --space-2: 2px;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    /* Border Radius */
    --radius-sm: 6px;
    --radius-base: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 14px 24px -6px rgba(0, 0, 0, 0.12), 0 10px 14px -6px rgba(0, 0, 0, 0.08);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    /* Animation */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
    /* Layout */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
}

/* Dark mode colors */

@media (prefers-color-scheme: dark) {
    :root {
        /* RGB versions for opacity control (Dark Mode) */
        --color-gray-400-rgb: 160, 168, 178;
        --color-teal-300-rgb: 69, 214, 227;
        --color-gray-300-rgb: 205, 212, 220;
        --color-gray-200-rgb: 234, 239, 244;
        /* Background color tokens (Dark Mode) */
        --color-bg-1: rgba(69, 214, 227, 0.12);
        --color-bg-2: rgba(255, 184, 108, 0.12);
        --color-bg-3: rgba(120, 221, 173, 0.12);
        --color-bg-4: rgba(255, 134, 134, 0.12);
        --color-bg-5: rgba(199, 164, 255, 0.14);
        --color-bg-6: rgba(255, 171, 128, 0.12);
        --color-bg-7: rgba(255, 150, 205, 0.12);
        --color-bg-8: rgba(137, 207, 255, 0.12);
        /* Semantic Color Tokens (Dark Mode) */
        --color-background: #0f151a;
        --color-surface: #182027;
        --color-text: rgba(246, 248, 250, 1);
        --color-text-secondary: rgba(222, 228, 235, 0.72);
        --color-primary: #40d3e1;
        --color-primary-hover: #25b7c6;
        --color-primary-active: #1a8795;
        --color-secondary: rgba(255, 255, 255, 0.06);
        --color-secondary-hover: rgba(255, 255, 255, 0.12);
        --color-secondary-active: rgba(255, 255, 255, 0.18);
        --color-border: rgba(255, 255, 255, 0.12);
        --color-error: #ff6b73;
        --color-success: #4bdcb5;
        --color-warning: #f7b971;
        --color-info: rgba(214, 223, 232, 0.85);
        --color-focus-ring: rgba(64, 211, 225, 0.45);
        --color-btn-primary-text: #041f24;
        --color-card-border: rgba(255, 255, 255, 0.08);
        --color-card-border-inner: rgba(255, 255, 255, 0.05);
        --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
        --button-border-secondary: rgba(255, 255, 255, 0.08);
        --color-border-secondary: rgba(255, 255, 255, 0.12);
        --color-select-caret: rgba(245, 245, 245, 0.9);
        /* Common style patterns - updated for dark mode */
        --focus-ring: 0 0 0 3px var(--color-focus-ring);
        --focus-outline: 2px solid var(--color-primary);
        --status-bg-opacity: 0.15;
        --status-border-opacity: 0.25;
        --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        /* RGB versions for dark mode */
        --color-success-rgb: 75, 220, 181;
        --color-error-rgb: 255, 107, 115;
        --color-warning-rgb: 247, 185, 113;
        --color-info-rgb: 214, 223, 232;
    }
}

/* Data attribute for manual theme switching */

[data-color-scheme="dark"] {
    /* RGB versions for opacity control (dark mode) */
    --color-gray-400-rgb: 160, 168, 178;
    --color-teal-300-rgb: 69, 214, 227;
    --color-gray-300-rgb: 205, 212, 220;
    --color-gray-200-rgb: 234, 239, 244;
    /* Colorful background palette - Dark Mode */
    --color-bg-1: rgba(69, 214, 227, 0.12);
    --color-bg-2: rgba(255, 184, 108, 0.12);
    --color-bg-3: rgba(120, 221, 173, 0.12);
    --color-bg-4: rgba(255, 134, 134, 0.12);
    --color-bg-5: rgba(199, 164, 255, 0.14);
    --color-bg-6: rgba(255, 171, 128, 0.12);
    --color-bg-7: rgba(255, 150, 205, 0.12);
    --color-bg-8: rgba(137, 207, 255, 0.12);
    /* Semantic Color Tokens (Dark Mode) */
    --color-background: #0f151a;
    --color-surface: #182027;
    --color-text: rgba(246, 248, 250, 1);
    --color-text-secondary: rgba(222, 228, 235, 0.72);
    --color-primary: #40d3e1;
    --color-primary-hover: #25b7c6;
    --color-primary-active: #1a8795;
    --color-secondary: rgba(255, 255, 255, 0.06);
    --color-secondary-hover: rgba(255, 255, 255, 0.12);
    --color-secondary-active: rgba(255, 255, 255, 0.18);
    --color-border: rgba(255, 255, 255, 0.12);
    --color-error: #ff6b73;
    --color-success: #4bdcb5;
    --color-warning: #f7b971;
    --color-info: rgba(214, 223, 232, 0.85);
    --color-focus-ring: rgba(64, 211, 225, 0.45);
    --color-btn-primary-text: #041f24;
    --color-card-border: rgba(255, 255, 255, 0.08);
    --color-card-border-inner: rgba(255, 255, 255, 0.05);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    --color-border-secondary: rgba(255, 255, 255, 0.12);
    --color-select-caret: rgba(245, 245, 245, 0.9);
    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    /* RGB versions for dark mode */
    --color-success-rgb: 75, 220, 181;
    --color-error-rgb: 255, 107, 115;
    --color-warning-rgb: 247, 185, 113;
    --color-info-rgb: 214, 223, 232;
}

[data-color-scheme="light"] {
    /* RGB versions for opacity control (light mode) */
    --color-brown-600-rgb: 94, 82, 64;
    --color-teal-500-rgb: 33, 128, 141;
    --color-slate-900-rgb: 19, 52, 59;
    /* Semantic Color Tokens (Light Mode) */
    --color-background: var(--color-cream-50);
    --color-surface: var(--color-cream-100);
    --color-text: var(--color-slate-900);
    --color-text-secondary: var(--color-slate-500);
    --color-primary: var(--color-teal-500);
    --color-primary-hover: var(--color-teal-600);
    --color-primary-active: var(--color-teal-700);
    --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
    --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
    --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
    --color-border: rgba(var(--color-brown-600-rgb), 0.2);
    --color-btn-primary-text: var(--color-cream-50);
    --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
    --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
    --color-error: var(--color-red-500);
    --color-success: var(--color-teal-500);
    --color-warning: var(--color-orange-500);
    --color-info: var(--color-slate-500);
    --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
    /* RGB versions for light mode */
    --color-success-rgb: var(--color-teal-500-rgb);
    --color-error-rgb: var(--color-red-500-rgb);
    --color-warning-rgb: var(--color-orange-500-rgb);
    --color-info-rgb: var(--color-slate-500-rgb);
}

/* Base styles */

html {
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
    scroll-behavior: auto;
}

body {
    margin: 0;
    padding: 0;
    /* Safe area insets for iOS devices with notch */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Typography */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    letter-spacing: var(--letter-spacing-tight);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-md);
}

p {
    margin: 0 0 var(--space-16) 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
    color: var(--color-primary-hover);
}

code,
pre {
    font-family: var(--font-family-mono);
    font-size: calc(var(--font-size-base) * 0.95);
    background-color: var(--color-secondary);
    border-radius: var(--radius-sm);
}

code {
    padding: var(--space-1) var(--space-4);
}

pre {
    padding: var(--space-16);
    margin: var(--space-16) 0;
    overflow: auto;
    border: 1px solid var(--color-border);
}

pre code {
    background: none;
    padding: 0;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-base);
    font-size: var(--font-size-base);
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-standard);
    border: none;
    text-decoration: none;
    position: relative;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

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

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

.btn--primary:active {
    background: var(--color-primary-active);
}

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

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

.btn--secondary:active {
    background: var(--color-secondary-active);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn--outline:hover {
    background: var(--color-secondary);
}

.btn--sm {
    padding: var(--space-4) var(--space-12);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

.btn--lg {
    padding: var(--space-10) var(--space-20);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-md);
}

.btn--full-width {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form elements */

.form-control {
    display: block;
    width: 100%;
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
    pointer-events: auto;
}

textarea.form-control {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
}

select.form-control {
    padding: var(--space-8) var(--space-12);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: var(--select-caret-light);
    background-repeat: no-repeat;
    background-position: right var(--space-12) center;
    background-size: 16px;
    padding-right: var(--space-32);
}

/* Add a dark mode specific caret */

@media (prefers-color-scheme: dark) {
    select.form-control {
        background-image: var(--select-caret-dark);
    }
}

/* Also handle data-color-scheme */

[data-color-scheme="dark"] select.form-control {
    background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
    background-image: var(--select-caret-light);
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: var(--focus-outline);
}

.form-label {
    display: block;
    margin-bottom: var(--space-8);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.form-group {
    margin-bottom: var(--space-16);
}

/* Card component */

.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card__body {
    padding: var(--space-16);
}

.card__header,
.card__footer {
    padding: var(--space-16);
    border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */

.status {
    display: inline-flex;
    align-items: center;
    padding: var(--space-6) var(--space-12);
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.status--success {
    background-color: rgba( var(--color-success-rgb, 33, 128, 141), var(--status-bg-opacity));
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
    background-color: rgba( var(--color-error-rgb, 192, 21, 47), var(--status-bg-opacity));
    color: var(--color-error);
    border: 1px solid rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
    background-color: rgba( var(--color-warning-rgb, 168, 75, 47), var(--status-bg-opacity));
    color: var(--color-warning);
    border: 1px solid rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
    background-color: rgba( var(--color-info-rgb, 98, 108, 113), var(--status-bg-opacity));
    color: var(--color-info);
    border: 1px solid rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */

.container {
    position: relative;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    /* Safe area support for iOS with max() function */
    padding-right: max(var(--space-16), env(safe-area-inset-right));
    padding-left: max(var(--space-16), env(safe-area-inset-left));
}

@media (min-width: 640px) {
    .container {
        max-width: var(--container-sm);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: var(--container-md);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: var(--container-lg);
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: var(--container-xl);
    }
}

/* Utility classes */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-16 {
    gap: var(--space-16);
}

.m-0 {
    margin: 0;
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mx-8 {
    margin-left: var(--space-8);
    margin-right: var(--space-8);
}

.my-8 {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
}

.p-0 {
    padding: 0;
}

.py-8 {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.px-8 {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
}

.py-16 {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

.px-16 {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
}

.block {
    display: block;
}

.hidden {
    display: none;
}

/* Accessibility */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

/* Hide outline when focused via mouse/touch */

:focus:not(:focus-visible) {
    outline: none;
}

/* Accessibility: Reduced motion support */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode specifics */

[data-color-scheme="dark"] .btn--outline {
    border: 1px solid var(--color-border-secondary);
}

@font-face {
    font-family: 'FKGroteskNeue';
    src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2') format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */

/* Additional styles for guitar school landing */

/* Mode-specific scroll locking */

body.home-mode,
body.calculator-mode {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100lvh;
    min-height: 100dvh;
    overflow: hidden;
}

body.home-mode .container,
body.calculator-mode .container {
    min-height: inherit;
}

body.home-mode #home-page,
body.calculator-mode #calculator-page {
    height: auto;
    min-height: inherit;
    overflow: hidden;
}

body.home-mode #home-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.home-mode #home-page.home-unlocked {
    justify-content: flex-start;
}

body.calculator-mode #calculator-page {
    padding: var(--space-16) 0;
}

/* Layout */

.page {
    position: relative;
    display: none;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
    padding: var(--space-24) 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    contain: layout paint;
    transform: translateZ(0);
}

.page.active {
    display: flex;
    visibility: visible;
    pointer-events: auto;
}

.page.viewport-unlocked {
    overflow-y: auto;
    justify-content: flex-start;
}

body.achievements-isolation .page {
    display: none;
}

body.achievements-isolation #achievements-page {
    display: flex;
    visibility: visible;
    pointer-events: auto;
}

/* Header */

.header {
    text-align: center;
    margin-bottom: var(--space-32);
}

.header h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-16);
    color: var(--color-primary);
}

.header-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Home page specific spacing: keep within viewport */

#home-page.page {
    padding: var(--space-12) 0;
}

#home-page .header {
    margin-bottom: var(--space-20);
}

#home-page .main-nav {
    margin-bottom: var(--space-16);
}

#home-page .nav-grid {
    /* Desktop gap to match reference screenshot */
    gap: var(--space-24);
}

/* Navigation Grid */

.main-nav {
    margin-bottom: var(--space-32);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-24);
    max-width: 900px;
    margin: 0 auto;
}

.nav-card {
    background: var(--color-surface);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: 40px var(--space-24) 24px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-standard);
    position: relative;
    text-align: center;
    font-family: inherit;
    color: var(--color-text);
    font-size: var(--font-size-base);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Hardware acceleration for smooth hover effects */
    will-change: transform;
    transform: translateZ(0);
}

.nav-card * {
    pointer-events: none;
}

.nav-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.nav-card:active {
    transform: translateY(0);
}

.nav-card--highlighted {
    border-color: var(--color-card-border);
    background: var(--color-surface);
}

.nav-card--highlighted:hover {
    box-shadow: var(--shadow-lg);
}

.nav-icon {
    margin-bottom: var(--space-16);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.nav-icon img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.nav-icon--teachers img {
    width: 210px;
    height: 210px;
}

@media (min-width: 768px) {
    button.nav-card[data-section="teachers"] .nav-icon img {
        width: 140px !important;
        height: 140px !important;
    }
}

.nav-card h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    pointer-events: none;
}

.highlight-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-success);
    color: var(--color-white);
    width: var(--space-32);
    height: var(--space-32);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    pointer-events: none;
}

.nav-card--highlighted .highlight-badge {
    display: none;
}

/* CTA Section */

.cta-section {
    text-align: center;
}

/* Page Header */

.page-header {
    display: flex;
    align-items: center;
    gap: var(--space-24);
    margin-bottom: var(--space-32);
    flex-wrap: wrap;
}

.page-header h2 {
    flex: 1;
    margin: 0;
    font-size: var(--font-size-3xl);
}

/* Calculator */

.calculator {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-32);
    max-width: 1000px;
    margin: 0 auto;
}

.calculator-form {
    background: var(--color-surface);
    padding: var(--space-24);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
}

.calculator-result {
    background: var(--color-surface);
    padding: var(--space-24);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
    height: fit-content;
    position: sticky;
    top: var(--space-24);
}

/* Package Selector */

.package-selector {
    display: flex;
    gap: var(--space-8);
    margin-top: var(--space-8);
}

.package-btn {
    flex: 1;
    padding: var(--space-12) var(--space-16);
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-base);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    pointer-events: auto;
    user-select: none;
}

.package-btn:hover {
    border-color: var(--color-primary);
}

.package-btn:active {
    transform: translateY(1px);
}

.package-btn--active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-btn-primary-text);
}

/* Lessons Selector */

.lessons-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    margin-top: var(--space-8);
}

.lesson-count-btn {
    padding: var(--space-12);
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-base);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-standard);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: center;
    pointer-events: auto;
    user-select: none;
}

.lesson-count-btn:hover {
    border-color: var(--color-primary);
}

.lesson-count-btn:active {
    transform: translateY(1px);
}

.lesson-count-btn--active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-btn-primary-text);
}

/* Discounts */

.discounts {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-top: var(--space-8);
}

.discount-item {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    cursor: pointer;
    font-size: var(--font-size-sm);
    pointer-events: auto;
}

.discount-item input[type="checkbox"] {
    width: var(--space-16);
    height: var(--space-16);
    accent-color: var(--color-primary);
    pointer-events: auto;
}

.discounts-section.hidden {
    display: none;
}

/* Price Display */

.price-display {
    text-align: center;
    margin-bottom: var(--space-24);
}

.original-price {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    text-decoration: line-through;
    margin-bottom: var(--space-8);
}

.original-price.hidden {
    display: none;
}

.final-price {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-8);
}

.savings {
    font-size: var(--font-size-lg);
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-8);
}

.savings.hidden {
    display: none;
}

.discount-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.discount-info.hidden {
    display: none;
}

/* Content sections */

.content-section {
    background: var(--color-surface);
    padding: var(--space-32);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-card-border);
    max-width: 800px;
    margin: 0 auto;
}

.content-section p {
    font-size: var(--font-size-lg);
    line-height: 1.6;
    margin-bottom: var(--space-24);
}

.content-section p:last-of-type {
    margin-bottom: var(--space-24);
}

/* Contact styles */

.contact-info {
    margin-bottom: var(--space-32);
    max-width: 600px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    padding: var(--space-16) 0;
    border-bottom: 1px solid var(--color-card-border);
    gap: var(--space-16);
    min-height: 60px;
    opacity: 0;
    transform: translateY(var(--space-20));
    animation: contactSlideIn 0.6s ease-out forwards;
}

.contact-item:nth-child(1) {
    animation-delay: 0.1s;
}

.contact-item:nth-child(2) {
    animation-delay: 0.2s;
}

.contact-item:nth-child(3) {
    animation-delay: 0.3s;
}

.contact-item:nth-child(4) {
    animation-delay: 0.4s;
}

.contact-item:nth-child(5) {
    animation-delay: 0.5s;
}

.contact-item:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes contactSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ÐšÐ°ÑÐºÐ°Ð´Ð½Ð°Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸Ñ Ð´Ð»Ñ Ð²ÑÐµÑ… ÑÑ‚Ñ€Ð°Ð½Ð¸Ñ† */

.page.active .page-header {
    opacity: 0;
    transform: translateY(-80px);
    animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.15s;
}

.page.active .calculator,
.page.active .content-section,
.page.active .teacher-photo-container,
.page.active .schedule-content,
.page.active .achievements-grid {
    opacity: 0;
    transform: translateY(-80px);
    animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.35s;
}

.page.active .cta-section,
.page.active .btn--primary.trial-lesson-btn {
    opacity: 0;
    transform: translateY(-80px);
    animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.55s;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item strong {
    display: inline-block;
    min-width: 140px;
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.contact-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
}

.contact-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.contact-icon--telegram {
    background-image: url('icons/nav/telegram.png');
}

.contact-icon--email {
    background-image: url('icons/nav/email.png');
}

.contact-icon--phone {
    background-image: url('icons/nav/call.png');
}

.contact-icon--map {
    background-image: url('icons/nav/maps.png');
}

.contact-icon--email,
.contact-icon--map {
    width: 24px;
    height: 24px;
}

@media (min-width: 769px) {
    .contact-icon--map {
        width: 28px;
        height: 28px;
    }
}

.contact-item a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: all var(--duration-fast) var(--ease-standard);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    display: inline-block;
    margin: var(--space-2) 0;
}

.contact-item a:hover {
    color: var(--color-primary-hover);
    background-color: rgba(var(--color-teal-500-rgb), 0.08);
    text-decoration: underline;
}

.contact-item a:active {
    color: var(--color-primary-active);
    transform: translateY(1px);
}

.contact-item a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.contact-separator {
    color: var(--color-text-secondary);
    margin: 0 var(--space-8);
    font-weight: var(--font-weight-normal);
}

.contact-item a[href^="tel:"]:before {
    content: none;
}

.contact-item a[href^="https://wa.me/"]:before {
    content: "";
    display: inline-block;
    width: var(--space-16);
    height: var(--space-16);
    margin-right: var(--space-8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325D366'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.890-5.335 11.893-11.893A11.821 11.821 0 0020.064 3.687'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
}

.contact-item a[href^="mailto:"]:before {
    content: none;
}

.contact-item a[href^="https://t.me/"]:before,
.contact-item a[href^="https://telegram.me/"]:before {
    content: none;
    margin-right: 0;
}

.contact-item a[href^="https://yandex.ru/maps"]:before {
    content: none;
}

.contact-item a[href^="https://wa.me/"] {
    color: #25D366;
    font-weight: var(--font-weight-semibold);
}

.contact-item a[href^="https://t.me/"],
.contact-item a[href^="https://telegram.me/"] {
    color: #0088CC;
    font-weight: var(--font-weight-semibold);
}

.contact-item a[href^="https://t.me/"]:hover,
.contact-item a[href^="https://telegram.me/"]:hover {
    color: #006AA6;
    background-color: rgba(0, 136, 204, 0.08);
}

.contact-item a[href^="https://wa.me/"]:hover {
    color: #1EA952;
    background-color: rgba(37, 211, 102, 0.08);
}

/* Teacher Photo Section */

.teacher-photo-container {
    text-align: center;
    margin: var(--space-20) 0;
}

.teacher-photo {
    max-width: 400px;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-normal) var(--ease-standard), box-shadow var(--duration-normal) var(--ease-standard);
}

.hover-zoom:hover {
    transform: scale(1.12);
    box-shadow: var(--shadow-lg);
}

.photo-caption {
    margin-top: var(--space-16);
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
}

/* Photo Modal */

#photo-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
}

#photo-modal.active {
    display: flex;
}

#photo-modal .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    background: none;
    border: none;
}

#photo-modal .modal-content img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

#photo-modal video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

#photo-modal .close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: var(--color-white);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: background var(--duration-fast) var(--ease-standard);
}

#photo-modal .close:hover {
    background: var(--color-red-400);
}

.selected-price {
    background: var(--color-bg-1);
    padding: var(--space-16);
    border-radius: var(--radius-base);
    margin-bottom: var(--space-24);
    text-align: center;
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.selected-price.hidden {
    display: none;
}

.selected-price strong {
    display: block;
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    margin-bottom: var(--space-8);
}

/* Modal */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    pointer-events: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--color-card-border);
    pointer-events: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-24);
    border-bottom: 1px solid var(--color-card-border);
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-2xl);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-3xl);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    width: var(--space-32);
    height: var(--space-32);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-base);
    transition: all var(--duration-fast) var(--ease-standard);
    pointer-events: auto;
}

.modal-close:hover {
    background: var(--color-secondary);
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-24);
}

/* Focus states for accessibility */

.nav-card:focus-visible,
.package-btn:focus-visible,
.lesson-count-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Loading state for calculator */

.calculator-result.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success state for form submission */

.form-success {
    background: var(--color-bg-3);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
    color: var(--color-success);
    padding: var(--space-16);
    border-radius: var(--radius-base);
    text-align: center;
    margin-bottom: var(--space-16);
}

/* ACHIEVEMENTS GALLERY - CLEAN STYLES WITHOUT DUPLICATES */

/* Achievements Gallery Section */

.diplomas-gallery {
    margin: var(--space-32) 0;
    padding: 0;
    /* Ensure grid layout applied to diplomas container */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Diploma items ensure images respect grid cell */

.diploma-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.achievements-section {
    margin-bottom: 32px;
}

.achievements-section:last-child {
    margin-bottom: 0;
}

.achievements-section-title {
    font-size: 20px;
    font-weight: 550;
    color: #218089;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.achievements-section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #218089;
    margin: 8px auto 0;
    border-radius: 50px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0;
}

.achievement-item {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.achievement-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.achievement-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 12px;
}

/* Diploma specific styles */

.diploma-item .diploma-photo.hover-zoom-diploma:hover {
    transform: scale(1.05);
}

.diploma-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient( 135deg, rgba(var(--color-teal-500-rgb), 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-standard);
    pointer-events: none;
    z-index: 1;
}

.diploma-item:hover::before {
    opacity: 1;
}

.diploma-item::after {
    content: "+";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    background: rgba(var(--color-teal-500-rgb), 0.9);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--duration-normal) var(--ease-standard);
    pointer-events: none;
    z-index: 2;
}

.diploma-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Video specific styles */

.video-item {
    background: linear-gradient(135deg, #1f2121 0%, #262828 100%);
    border: 2px solid rgba(94, 82, 64, 0.12);
}

.video-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(33, 128, 141, 0.1) 0%, rgba(19, 52, 59, 0.3) 100%);
    color: white;
    position: relative;
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.video-thumbnail:hover {
    background: linear-gradient(135deg, rgba(33, 128, 141, 0.2) 0%, rgba(19, 52, 59, 0.4) 100%);
}

.video-play-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(33, 128, 141, 0.8);
    border-radius: 50px;
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 12px;
}

.video-thumbnail:hover .video-play-button {
    background: rgba(33, 128, 141, 1);
    transform: scale(1.1);
}

.video-play-button svg {
    margin-left: 4px;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 0 8px;
}

/* Dark mode adjustments for videos */

@media (prefers-color-scheme: dark) {
    .video-item {
        background: linear-gradient(135deg, #262828 0%, #1a1c1c 100%);
        border-color: rgba(119, 124, 124, 0.2);
    }
    .video-thumbnail {
        background: linear-gradient(135deg, rgba(50, 184, 198, 0.1) 0%, rgba(19, 52, 59, 0.4) 100%);
    }
    .video-thumbnail:hover {
        background: linear-gradient(135deg, rgba(50, 184, 198, 0.2) 0%, rgba(19, 52, 59, 0.5) 100%);
    }
    .contact-item a {
        color: var(--color-teal-300);
    }
    .contact-item a:hover {
        color: var(--color-teal-400);
        background-color: rgba(var(--color-teal-300-rgb), 0.1);
    }
    .contact-item a[href^="https://wa.me/"] {
        color: #25D366;
    }
    .contact-item a[href^="https://wa.me/"]:hover {
        color: #1EA952;
        background-color: rgba(37, 211, 102, 0.1);
    }
}

[data-color-scheme="dark"] .video-item {
    background: linear-gradient(135deg, #262828 0%, #1a1c1c 100%);
    border-color: rgba(119, 124, 124, 0.2);
}

[data-color-scheme="dark"] .video-thumbnail {
    background: linear-gradient(135deg, rgba(50, 184, 198, 0.1) 0%, rgba(19, 52, 59, 0.4) 100%);
}

[data-color-scheme="dark"] .video-thumbnail:hover {
    background: linear-gradient(135deg, rgba(50, 184, 198, 0.2) 0%, rgba(19, 52, 59, 0.5) 100%);
}

[data-color-scheme="dark"] .contact-item a {
    color: var(--color-teal-300);
}

[data-color-scheme="dark"] .contact-item a:hover {
    color: var(--color-teal-400);
    background-color: rgba(var(--color-teal-300-rgb), 0.1);
}

[data-color-scheme="dark"] .contact-item a[href^="https://wa.me/"] {
    color: #25D366;
}

[data-color-scheme="dark"] .contact-item a[href^="https://wa.me/"]:hover {
    color: #1EA952;
    background-color: rgba(37, 211, 102, 0.1);
}

/* Responsive Design */

@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-16);
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-16);
    }
    .lessons-selector {
        grid-template-columns: 1fr 1fr;
    }
    .calculator {
        grid-template-columns: 1fr;
        gap: var(--space-24);
    }
    .calculator-result {
        position: static;
    }
    .package-selector {
        flex-direction: column;
    }
    .contact-item {
        padding: var(--space-12) 0;
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
    }
    .contact-item strong {
        font-size: var(--font-size-sm);
        color: var(--color-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .contact-separator {
        display: block;
        margin: var(--space-4) 0;
    }
    .contact-item a {
        font-size: var(--font-size-lg);
        padding: var(--space-8);
        border: 1px solid rgba(var(--color-teal-500-rgb), 0.2);
        border-radius: var(--radius-base);
        text-align: center;
        background: linear-gradient(135deg, var(--color-surface) 0%, rgba(var(--color-teal-500-rgb), 0.03) 100%);
    }
    .contact-item a:hover {
        border-color: var(--color-primary);
        box-shadow: 0 2px 8px rgba(var(--color-teal-500-rgb), 0.1);
    }
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .achievements-section-title {
        font-size: 18px;
    }
    .video-play-button {
        width: 60px;
        height: 60px;
    }
    .video-title {
        font-size: 14px;
    }
    .diploma-item::after {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-xl);
    }
}

@media (min-width: 769px) {
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .lessons-selector {
        grid-template-columns: repeat(4, 1fr);
    }
    .calculator {
        grid-template-columns: 1fr 400px;
    }
    .contact-item a {
        position: relative;
        overflow: hidden;
    }
    .contact-item a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--color-primary);
        transition: width var(--duration-normal) var(--ease-standard);
    }
    .contact-item a:hover::after {
        width: 100%;
    }
    .contact-item a:hover {
        text-decoration: none;
    }
}

/* Mobile Portrait Responsive Design - 480px breakpoint */

@media (max-width: 480px) {
    body {
        overscroll-behavior: contain;
        -webkit-text-size-adjust: 100%;
    }
    body.calculator-mode {
        height: 100vh;
        height: 100svh;
        height: 100lvh;
        height: 100dvh;
        overflow: hidden;
    }
    body.calculator-mode .container {
        position: fixed;
        inset: 0;
        overflow: auto;
    }
    body.calculator-mode .page {
        display: none;
    }
    body.calculator-mode #calculator-page {
        display: flex;
    }
    #calculator-page.page {
        overflow: auto;
    }
    #calculator-page {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100lvh;
        min-height: 100dvh;
        height: 100vh;
        height: 100svh;
        height: 100lvh;
        height: 100dvh;
        gap: var(--space-8);
        padding: var(--space-8) var(--space-4) var(--space-8);
    }
    #calculator-page .page-header {
        flex-shrink: 0;
        margin-bottom: var(--space-4);
    }
    .page {
        padding: 0;
        min-height: 100%;
    }
    .calculator {
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
        max-width: 420px;
        margin: 0 auto;
        flex: 1;
        min-height: 0;
        width: 100%;
    }
    .calculator-form {
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        background: var(--color-surface);
        padding: var(--space-10) var(--space-12);
        border-radius: var(--radius-lg);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        max-height: calc(100vh - 260px);
        max-height: calc(100svh - 260px);
        max-height: calc(100lvh - 260px);
        max-height: calc(100dvh - 260px);
        /* header/back + gaps + result panel */
    }
    .calculator-form .form-group {
        margin-bottom: 0;
        padding: var(--space-4) 0;
    }
    .calculator-form .form-label {
        font-size: 13px;
        margin-bottom: var(--space-4);
    }
    .package-selector,
    .lessons-selector,
    .calculator-form .discounts {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--space-6);
    }
    .package-selector {
        flex-direction: initial;
    }
    .package-btn,
    .lesson-count-btn,
    .calculator-form .discount-item,
    .calculator-form select,
    .calculator-form input {
        font-size: 12px;
        padding: var(--space-4) var(--space-6);
    }
    .calculator-result {
        position: sticky;
        bottom: var(--space-6);
        flex: 0 0 auto;
        padding: var(--space-10) var(--space-12);
        border-radius: var(--radius-lg);
        background: var(--color-surface);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 160px;
        max-height: 180px;
        gap: var(--space-4);
        z-index: 3;
    }
    .calculator-result .price-display {
        flex: 1 1 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--space-2);
        text-align: left;
        min-height: 0;
        overflow: hidden;
    }
    .calculator-result .price-display>div {
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .calculator-result .btn {
        flex: 0 0 auto;
        width: 100%;
        margin-top: auto;
    }
    .calculator-result .final-price {
        font-size: 19px;
        line-height: 1.1;
    }
    .calculator-result .savings {
        font-size: 12px;
        background: rgba(var(--color-success-rgb, 75, 220, 181), 0.12);
        padding: var(--space-3) var(--space-8);
        border-radius: var(--radius-base);
        display: inline-flex;
        align-items: center;
        min-height: 24px;
    }
    .calculator-result .savings.hidden {
        display: none !important;
    }
    #discount-info {
        display: none;
    }
    .page {
        padding: 0;
        min-height: auto;
    }
    .header {
        margin-bottom: var(--space-20);
    }
    .header h1 {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: var(--space-12);
    }
    .header-subtitle {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin-bottom: var(--space-12);
    }
    .main-nav {
        margin-bottom: var(--space-20);
    }
    .nav-grid {
        gap: 8px !important;
        padding: 0 var(--space-8);
        grid-template-columns: 1fr 1fr !important;
    }
    .nav-card {
        padding: 24px !important;
        min-height: 140px !important;
    }
    .nav-card h3 {
        font-size: 16px !important;
        margin-top: 6px !important;
        line-height: 1.2 !important;
    }
    .nav-icon {
        font-size: 36px !important;
        margin-bottom: 10px !important;
    }
    .nav-icon img {
        width: 76px !important;
        height: 76px !important;
    }
    /* Home page: tighter spacing on mobile */
    #home-page.page {
        padding: var(--space-8) 0;
    }
    #home-page .header {
        margin-bottom: var(--space-16);
    }
    #home-page .main-nav {
        margin-bottom: var(--space-12);
    }
    #home-page .nav-grid {
        gap: var(--space-8) !important;
    }
    .content-section {
        padding: 16px !important;
        margin-bottom: var(--space-16);
    }
    .content-section p {
        font-size: var(--font-size-base);
        line-height: var(--line-height-normal);
        margin-bottom: var(--space-16);
    }
    .container {
        padding: 8px !important;
    }
    .cta-section {
        margin-top: var(--space-16);
        padding: var(--space-16) 0;
    }
    .contact-info {
        margin-bottom: var(--space-20);
    }
    .contact-item {
        padding: var(--space-12) 0;
        min-height: auto;
    }
    .contact-item .contact-separator {
        display: none;
    }
    .contact-item a[href^="https://wa.me/"] {
        display: inline-flex;
        margin-top: var(--space-8);
    }
    .teacher-photo-container {
        margin: var(--space-16) 0;
    }
    .teacher-photo {
        max-width: 240px;
    }
    .photo-caption {
        margin-top: var(--space-12);
        font-size: var(--font-size-base);
    }
    .btn {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
    .page.active {
        max-height: 100vh;
        max-height: 100svh;
        max-height: 100lvh;
        max-height: 100dvh;
        overflow-y: auto;
    }
    body {
        line-height: 1.4;
    }
    html {
        font-size: 13px;
    }
    /* Achievements mobile styles */
    .achievements-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .achievements-section {
        margin-bottom: 20px;
    }
    .achievements-section-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    .video-play-button {
        width: 50px;
        height: 50px;
    }
    .video-title {
        font-size: 12px;
    }
    .diploma-item::after {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-lg);
    }
    /* ÐšÐ°ÑÐºÐ°Ð´Ð½Ð°Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸Ñ Ð´Ð»Ñ Ð¼Ð¾Ð±Ð¸Ð»ÑŒÐ½Ñ‹Ñ… */
    .page.active .page-header {
        opacity: 0;
        transform: translateY(-60px);
        animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        animation-delay: 0.15s;
    }
    .page.active .calculator,
    .page.active .content-section,
    .page.active .teacher-photo-container,
    .page.active .schedule-content,
    .page.active .achievements-grid {
        opacity: 0;
        transform: translateY(-60px);
        animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        animation-delay: 0.35s;
    }
    .page.active .cta-section,
    .page.active .btn--primary.trial-lesson-btn {
        opacity: 0;
        transform: translateY(-60px);
        animation: contactSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        animation-delay: 0.55s;
    }
}

/* Mobile Landscape Optimization - Fix for horizontal orientation */

@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    /* Allow scroll in landscape to see all content - HOME */
    body.home-mode {
        overflow-y: auto;
    }
    body.home-mode #home-page {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100lvh;
        min-height: 100dvh;
        overflow-y: visible;
        padding: var(--space-8) 0;
        justify-content: flex-start;
    }
    /* Allow scroll in landscape to see all content - CALCULATOR */
    body.calculator-mode {
        overflow-y: auto;
    }
    body.calculator-mode .container {
        position: relative;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100lvh;
        min-height: 100dvh;
    }
    body.calculator-mode #calculator-page {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100lvh;
        min-height: 100dvh;
        overflow-y: visible;
    }
    /* Compact calculator layout for landscape */
    #calculator-page {
        padding: var(--space-8) var(--space-4);
        gap: var(--space-6);
    }
    #calculator-page .page-header {
        margin-bottom: var(--space-8);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    #calculator-page .page-header h2 {
        font-size: var(--font-size-xl);
        margin: 0;
    }
    .calculator {
        gap: var(--space-12);
        grid-template-columns: 1fr;
    }
    .calculator-form {
        padding: var(--space-12);
        gap: var(--space-8);
    }
    .calculator-form .form-group {
        margin-bottom: var(--space-8);
    }
    .calculator-form .form-label {
        font-size: var(--font-size-xs);
        margin-bottom: var(--space-4);
    }
    .package-selector,
    .lessons-selector {
        gap: var(--space-4);
    }
    .package-btn,
    .lesson-count-btn {
        padding: var(--space-6) var(--space-8);
        font-size: var(--font-size-xs);
    }
    .calculator-result {
        position: relative;
        padding: var(--space-12);
        min-height: auto;
        margin-bottom: var(--space-8);
    }
    .calculator-result .final-price {
        font-size: var(--font-size-3xl);
    }
    /* Compact header for landscape - HOME */
    #home-page .header {
        margin-bottom: var(--space-12);
    }
    #home-page .header h1 {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--space-8);
        line-height: 1.2;
    }
    #home-page .header-subtitle {
        font-size: var(--font-size-sm);
        line-height: 1.3;
    }
    /* Compact navigation grid */
    #home-page .nav-grid {
        gap: var(--space-8);
        grid-template-columns: repeat(3, 1fr);
    }
    /* Smaller cards */
    .nav-card {
        padding: var(--space-12) var(--space-8);
        min-height: 100px;
    }
    .nav-card h3 {
        font-size: var(--font-size-sm);
        margin-top: var(--space-4);
    }
    .nav-icon {
        margin-bottom: var(--space-8);
    }
    .nav-icon img {
        width: 50px !important;
        height: 50px !important;
    }
    /* Tighter container */
    .container {
        padding: var(--space-8);
    }
}

@media (min-width: 1200px) {
    .achievements-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
