/* ============================================
   СУДОХОДСТВО.СПБ.РФ — Единая дизайн-система
   ============================================ */

:root {
    /* Цвета */
    --navy: #0B3D91;
    --navy-dark: #082C6B;
    --navy-light: #1E5AB8;
    --aqua: #00A8CC;
    --aqua-light: #E6F7FB;
    --sand: #F7F4EE;
    --ink: #0F172A;
    --ink-2: #334155;
    --muted: #64748B;
    --line: #E5E9F0;
    --bg: #FAFBFC;
    --surface: #FFFFFF;
    --success: #0E9F6E;
    --warning: #D97706;
    --danger: #DC2626;

    /* Типографика */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-head: 'Manrope', 'Inter', sans-serif;

    /* Размеры */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --container: 1200px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 14px rgba(11, 61, 145, 0.06), 0 10px 30px rgba(11, 61, 145, 0.05);
    --shadow-lg: 0 20px 50px rgba(11, 61, 145, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 72px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: var(--header-h);
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--ink);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== SITE HEADER ========== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: var(--transition);
}
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: var(--line);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.nav-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--ink);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--aqua) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 168, 204, 0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 0.7rem; color: var(--muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-links a {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-2);
    position: relative;
}
.nav-links a:hover {
    background: var(--aqua-light);
    color: var(--navy);
}
.nav-links a.is-active {
    color: var(--navy);
    background: var(--aqua-light);
    font-weight: 600;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--ink);
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}
.nav-cta:hover { background: var(--navy); transform: translateY(-1px); }

.burger {
    display: none;
    width: 44px; height: 44px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: var(--sand);
}
.burger span {
    display: block;
    width: 20px; height: 2px;
    background: var(--ink);
    position: relative;
    transition: var(--transition);
}
.burger span::before,
.burger span::after {
    content: ''; position: absolute; left: 0;
    width: 20px; height: 2px; background: var(--ink);
    transition: var(--transition);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger.active span { background: transparent; }
.burger.active span::before { top: 0; transform: rotate(45deg); }
.burger.active span::after { top: 0; transform: rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    bottom: 0;
    background: #fff;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu a {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-menu a:hover, .mobile-menu a.is-active {
    background: var(--aqua-light);
    color: var(--navy);
}
.mobile-menu a .arrow { color: var(--muted); }

/* ========== PAGE HEAD ========== */
.page-head {
    padding: 56px 0 32px;
    background:
        radial-gradient(ellipse at top left, rgba(0, 168, 204, 0.08), transparent 60%),
        radial-gradient(ellipse at top right, rgba(11, 61, 145, 0.06), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--line);
}
.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.crumbs a:hover { color: var(--navy); }
.crumbs .sep { opacity: 0.5; }
.crumbs .current { color: var(--ink-2); font-weight: 500; }

.page-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    text-wrap: pretty;
}
.page-lead {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--ink-2);
    max-width: 720px;
    text-wrap: pretty;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-2);
}
.pill .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.15);
}
.pill .dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(14, 159, 110, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(14, 159, 110, 0); }
}

/* ========== SECTIONS & CARDS ========== */
.section { padding: 48px 0; }
.section-sm { padding: 32px 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.section-head h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-head .sub { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}
.card-lg { padding: 36px; }
.card-sm { padding: 20px; border-radius: var(--radius-sm); }
.card-flat { box-shadow: none; }
.card-elevate { box-shadow: var(--shadow); border-color: transparent; }
.card:hover.card-interactive {
    border-color: var(--aqua);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    justify-content: center;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--navy); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--aqua); color: #fff; }
.btn-accent:hover { background: var(--navy); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sand { background: var(--sand); color: var(--ink); }
.btn-sand:hover { background: var(--aqua-light); }
.btn-full { width: 100%; }

/* ========== TABLES ========== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
table.t th {
    text-align: left;
    padding: 14px 18px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: var(--sand);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.t td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--ink-2);
}
table.t tbody tr:last-child td { border-bottom: none; }
table.t tbody tr:hover { background: var(--aqua-light); }
table.t td strong { color: var(--ink); font-weight: 600; }

.subtable-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.subtable-title::before {
    content: '';
    width: 4px; height: 18px;
    background: var(--aqua);
    border-radius: 2px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-open { background: rgba(14, 159, 110, 0.1); color: var(--success); }
.badge-closed { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.badge-info { background: var(--aqua-light); color: var(--navy); }
.badge-warn { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.badge-neutral { background: var(--sand); color: var(--ink-2); }

/* ========== ALERTS ========== */
.alert {
    display: flex;
    gap: 14px;
    padding: 18px 22px;
    border-radius: var(--radius);
    border: 1px solid;
    margin: 20px 0;
}
.alert-icon { flex-shrink: 0; font-size: 1.2rem; margin-top: 2px; }
.alert-body { font-size: 0.93rem; line-height: 1.55; }
.alert-body strong { display: block; margin-bottom: 4px; }
.alert-warn { background: #FEF3C7; border-color: #FDE68A; color: #78350F; }
.alert-warn .alert-icon { color: var(--warning); }
.alert-info { background: var(--aqua-light); border-color: #BEE6F0; color: var(--navy-dark); }
.alert-info .alert-icon { color: var(--aqua); }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.75);
    margin-top: 80px;
    padding: 64px 0 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand .brand { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: 0.92rem; line-height: 1.65; margin-bottom: 20px; }
.footer-col h4 {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 0.93rem; color: rgba(255, 255, 255, 0.65); }
.footer-col a:hover { color: var(--aqua); }
.footer-col .contact-item {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.65);
}
.footer-col .contact-item i { color: var(--aqua); width: 16px; margin-top: 4px; flex-shrink: 0; }

.socials { display: flex; gap: 10px; }
.social-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    transition: var(--transition);
}
.social-btn:hover { background: var(--aqua); transform: translateY(-2px); }

.footer-bot {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========== UTILS ========== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ========== ADAPTIVE ========== */
@media (max-width: 960px) {
    :root { --header-h: 64px; }
    .nav-links, .nav-cta { display: none; }
    .burger { display: flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
    .brand-text small { display: none; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .page-head { padding: 36px 0 24px; }
    .section { padding: 32px 0; }
    .card { padding: 20px; }
    .card-lg { padding: 24px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .site-footer { padding: 48px 0 24px; margin-top: 48px; }
    table.t th, table.t td { padding: 10px 12px; font-size: 0.85rem; }
    .section-head { flex-direction: column; align-items: flex-start; }
}
