@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600&display=swap');

/* ===== Design tokens ===== */
:root {
    /* Brand blues */
    --blue-950: #020c1b;
    --blue-900: #0a1628;
    --blue-800: #0f2d6b;
    --blue-700: #1447b8;
    --blue-600: #1d5ce5;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-300: #93c5fd;
    --blue-200: #bfdbfe;
    --blue-100: #dbeafe;
    --blue-50:  #eff6ff;

    /* Neutrals */
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;

    --accent:     #0ea5e9;
    --accent-dim: #38bdf8;

    --text-dark:  #0f172a;
    --text-mid:   #475569;
    --text-light: #94a3b8;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
    --shadow-md: 0 4px 12px rgba(15,23,42,.09), 0 2px 4px rgba(15,23,42,.05);
    --shadow-lg: 0 12px 32px rgba(15,23,42,.12), 0 4px 10px rgba(15,23,42,.07);

    --header-grad: linear-gradient(160deg, #07111f 0%, #0d1e3d 60%, #112550 100%);
    --nav-grad:    linear-gradient(160deg, #07111f 0%, #0d1e3d 60%, #112550 100%);
    --cta-grad:    linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 50%, var(--accent) 100%);
}

/* ===== Global resets & defaults ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background: var(--slate-100);
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    line-height: 1.7;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-dark);
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 40px;
    text-align: center;
}

/* Override old <font face="..."> tags in legacy pages */
font { font-family: 'Plus Jakarta Sans', Arial, sans-serif; }
table, td, th { font-family: 'Plus Jakarta Sans', Arial, sans-serif; }

/* ===== Responsive images & media ===== */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* ===== Responsive tables ===== */
table { max-width: 100%; }
table[width] { width: 100% !important; }
td[width]    { width: auto !important; min-width: 0; }
a img        { max-width: 100%; height: auto; }

/* ===== Header ===== */
header {
    background: var(--header-grad);
    padding: 0;
    margin-bottom: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 80% at 70% 50%, rgba(14,165,233,.12) 0%, transparent 65%),
        radial-gradient(ellipse 30% 60% at 15% 30%, rgba(56,189,248,.06) 0%, transparent 55%);
    pointer-events: none;
}

h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    padding: 16px 24px;
    flex: 1;
    text-align: center;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 16px rgba(0,0,0,.35);
}

.site-logo {
    height: 96px;
    width: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,.3));
    transition: filter 0.2s;
}

/* ===== Address strip ===== */
.header-box {
    color: rgba(255,255,255,.45);
    font-size: 0.78rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    text-align: center;
    padding: 5px 20px 6px;
    background: #07111f;
    border-bottom: 1px solid rgba(255,255,255,.06);
    letter-spacing: 0.02em;
    box-sizing: border-box;
}

.header-box .red    { color: rgba(255,255,255,.75); font-weight: 600; }
.header-box .purple { color: var(--accent-dim); font-weight: 600; }

.separator {
    border: none;
    border-top: 1px solid var(--slate-200);
    width: 90%;
    margin: 8px auto;
}

/* ===== Language switch in header (always visible on mobile) ===== */
.lang-switch-header {
    display: none;
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 6px;
    text-decoration: none;
    margin-right: 8px;
    flex-shrink: 0;
    align-self: center;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.06em;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    background: rgba(255,255,255,.07);
    z-index: 10;
}

.lang-switch-header:hover {
    background: rgba(255,255,255,.16);
    color: #ffffff;
    border-color: rgba(255,255,255,.5);
}

/* ===== Hamburger button ===== */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0 18px 0 auto;
    flex-shrink: 0;
    align-self: center;
    z-index: 10;
}

.nav-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.2s;
}

.nav-toggle-cb { display: none; }

.nav-toggle-cb:checked ~ header .nav-burger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.nav-toggle-cb:checked ~ header .nav-burger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle-cb:checked ~ header .nav-burger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== Top nav ===== */
.nav-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-bottom: 0;
    background: var(--nav-grad);
    padding: 6px 20px;
    box-sizing: border-box;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-top: 1px solid rgba(255,255,255,.07);
    border-bottom: 1px solid rgba(14,165,233,.25);
    box-shadow: 0 4px 24px rgba(7,17,31,.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ===== Nav links (flat) ===== */
.btn-applet {
    display: inline-block;
    padding: 7px 15px;
    white-space: nowrap;
    text-align: center;
    background: transparent;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    border: none;
    cursor: pointer;
    letter-spacing: 0.015em;
    position: relative;
}

.btn-applet::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 55%;
    height: 1.5px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform 0.2s cubic-bezier(.4,0,.2,1);
}

.btn-applet:hover {
    background: rgba(255,255,255,.08);
    color: #ffffff;
}

.btn-applet:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.btn-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 15px;
    white-space: nowrap;
    text-align: center;
    background: transparent;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    border: none;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.015em;
}

.btn-dropdown::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(255,255,255,.5);
    transition: transform 0.22s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
    margin-top: 1px;
}

.dropdown.open .btn-dropdown::after {
    transform: rotate(180deg);
}

.dropdown:hover .btn-dropdown,
.dropdown.open  .btn-dropdown {
    background: rgba(255,255,255,.08);
    color: #ffffff;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 40, 0.88);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 200;
    min-width: 200px;
    box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(14,165,233,.12);
    animation: dropFade 0.16s cubic-bezier(.4,0,.2,1);
}

@keyframes dropFade {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown:hover .dropdown-menu,
.dropdown.open  .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

.dropdown-menu a:last-child { border-bottom: none; }

.dropdown-menu a:hover {
    background: rgba(14,165,233,.15);
    color: #ffffff;
}

/* ===== Language switch in nav (desktop) ===== */
.lang-switch-nav {
    border: 1px solid rgba(255,255,255,.28) !important;
    border-radius: 6px !important;
    padding: 6px 11px !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,.07) !important;
    margin-left: 6px;
}

.lang-switch-nav:hover {
    background: rgba(255,255,255,.16) !important;
    border-color: rgba(255,255,255,.5) !important;
    color: #ffffff;
}

.lang-switch-nav::after { display: none !important; }

/* ===== Main content ===== */
.main-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 48px;
    max-width: 1000px;
    margin: 0 auto;
}

/* ===== Page frame ===== */
.page-frame {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--slate-200);
    margin: 24px 0 16px;
    padding: 32px 36px 40px;
    text-align: left;
}

/* ===== Page title ===== */
.page-title {
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--slate-900);
    text-align: left;
    margin: 0 0 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--slate-200);
    letter-spacing: -0.02em;
}

/* ===== Welcome text ===== */
.welcome-text {
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    line-height: 1.8;
    color: var(--text-dark);
    text-align: left;
}

.welcome-text h1 {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--slate-200);
    color: var(--slate-900);
    letter-spacing: -0.02em;
    text-align: left;
}

.welcome-text p {
    margin-bottom: 1em;
    color: var(--text-mid);
}

.welcome-text h2 {
    font-size: 1.15em;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--blue-700);
    letter-spacing: -0.01em;
}

.welcome-separator {
    border: none;
    border-top: 1px solid var(--slate-200);
    margin: 28px 0;
}

.welcome-list {
    margin: 0 0 1em 0;
    padding-left: 1.4em;
    line-height: 1.85;
}

.welcome-list li {
    margin-bottom: 6px;
    color: var(--text-mid);
}

/* ===== Colors ===== */
.red    { color: var(--blue-600); font-weight: bold; }
.purple { color: var(--accent); font-weight: bold; }

/* ===== Tech table ===== */
.tech-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-200);
}

.tech-table td {
    padding: 11px 14px;
    border: 1px solid var(--slate-200);
}

.blue-cell {
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 100%);
    color: #ffffff;
    font-weight: 600;
}

.grey-cell {
    background-color: var(--slate-50);
    color: var(--slate-700);
    font-weight: 600;
}

/* ===== CTA box ===== */
.cta-box {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 52px 24px;
    background: var(--cta-grad);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 90% at 80% 50%, rgba(14,165,233,.18) 0%, transparent 60%);
    pointer-events: none;
}

.cta-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.cta-text {
    font-size: 0.93rem;
    margin: 0 0 28px;
    color: rgba(255,255,255,.65);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: var(--blue-800);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 13px 28px;
    border-radius: var(--radius-md);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.cta-btn:hover {
    background: var(--blue-100);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
}

.cta-btn img {
    filter: none;
    width: 22px;
}

/* ===== Order / Contact ===== */
.order-section { margin-top: 60px; }

.order-link {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.15s;
}

.order-link:hover { color: var(--accent); }

.contact-links {
    margin-top: 50px;
    color: var(--slate-600);
}

.contact-links a {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    transition: color 0.15s;
}

.contact-links a:hover { color: var(--accent); }

/* ===== Footer ===== */
footer {
    margin-top: 0;
    text-align: center;
    font-size: 0.88em;
    color: rgba(255,255,255,.35);
    background: #07111f;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 24px 16px;
    box-sizing: border-box;
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* ===== Responsive image grid ===== */
.img-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.img-grid img {
    max-width: 300px;
    width: calc(50% - 6px);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@media (max-width: 600px) {
    .img-grid img {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== Legacy page wrapper ===== */
.legacy-wrap {
    max-width: 100%;
    overflow-x: auto;
    padding: 0 4px;
}

/* ===== Effect-list table (effets1-8.php etc.) ===== */
.effect-table { width: 100%; border-collapse: collapse; }
.effect-table td { vertical-align: top; padding: 6px 8px; }

@media (max-width: 600px) {
    .effect-table,
    .effect-table tbody,
    .effect-table tr,
    .effect-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }
    .effect-table thead { display: none; }
    .effect-table tr {
        margin-bottom: 16px;
        border-bottom: 2px solid var(--slate-300);
        padding-bottom: 8px;
    }
    .effect-table td img {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ===== Legacy inline-style overrides ===== */
@media (max-width: 768px) {
    [style*="MARGIN-LEFT: 80"],
    [style*="margin-left: 80px"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* --- Tablet (≤ 768px) --- */
@media (max-width: 768px) {
    body {
        padding: 0 16px 24px;
    }

    h1 {
        font-size: 2.8rem;
        padding: 10px 16px;
    }

    .site-logo { height: 72px; }

    .main-content {
        flex-direction: column;
        gap: 20px;
    }

    .page-frame {
        padding: 22px 22px 30px;
        border-radius: var(--radius-md);
        margin: 16px 0 12px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row label {
        min-width: unset;
        width: 100%;
    }

    .form-row input[type="text"] {
        width: 100%;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tech-table {
        font-size: 0.88rem;
    }

    .tech-table td {
        padding: 8px 8px;
    }

    .cta-box {
        padding: 36px 20px;
    }
}

/* --- Mobile (≤ 600px) --- */
@media (max-width: 600px) {

    body {
        padding: 0 12px 20px;
    }

    .nav-burger { display: flex; }
    .lang-switch-header { display: flex; align-items: center; }
    .lang-switch-nav { display: none !important; }

    .nav-top {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin-bottom: 16px;
        width: 100%;
        margin-left: 0;
        border-top: none;
        border-bottom: none;
        position: static;
        background: #07111f;
    }

    .nav-toggle-cb:checked ~ .nav-top {
        display: flex;
    }

    .nav-top { text-align: left; }

    .btn-applet,
    .btn-dropdown {
        width: 100%;
        border-radius: 0;
        text-align: left;
        padding: 14px 20px;
        font-family: 'Outfit', sans-serif;
        font-size: 15.5px;
        background: transparent;
        box-shadow: none;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,.07);
        color: rgba(255,255,255,.8);
    }

    .btn-applet::after { display: none; }

    .btn-dropdown::after {
        margin-left: auto;
    }

    .btn-applet:hover,
    .dropdown:hover .btn-dropdown,
    .dropdown.open  .btn-dropdown {
        background: rgba(255,255,255,.06);
        box-shadow: none;
        color: #ffffff;
    }

    .dropdown {
        display: block;
        width: 100%;
    }

    .dropdown:hover .dropdown-menu { display: none; }
    .dropdown.open  .dropdown-menu { display: block; }

    .dropdown-menu {
        position: static;
        transform: none;
        min-width: unset;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,.3);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        animation: none;
        border: none;
        border-top: 1px solid rgba(255,255,255,.06);
    }

    .dropdown-menu a {
        padding: 12px 36px;
        font-size: 13.5px;
        white-space: normal;
        text-align: left;
        color: rgba(255,255,255,.65);
    }

    .dropdown-menu a:hover {
        padding-left: 36px;
        background: rgba(14,165,233,.12);
        color: #ffffff;
    }

    h1 {
        font-size: 2rem;
        text-align: center;
        width: 100%;
        padding: 12px;
    }

    .site-logo { height: 58px; }

    .page-frame {
        padding: 16px 14px 24px;
        border-radius: var(--radius-md);
        margin: 10px 0 10px;
    }

    .welcome-text h1 { font-size: 1.35em; }
    .welcome-text h2 { font-size: 1.1em; }

    .cta-box {
        padding: 32px 16px;
    }

    .cta-btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        padding: 15px 16px;
        font-size: 1rem;
        display: flex;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row label {
        min-width: unset;
        width: 100%;
        margin-bottom: 4px;
    }

    .form-row input[type="text"] {
        width: 100%;
    }

    .select-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    select {
        width: 100%;
    }

    .legacy-wrap div[style*="MARGIN-LEFT"],
    .legacy-wrap div[style*="margin-left"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    table:not([width]):not(.tech-table) {
        width: 100% !important;
    }
    table:not([width]):not(.tech-table) td,
    table:not([width]):not(.tech-table) th {
        width: auto !important;
        min-width: 0;
    }
}
