:root {
    --sea-night: #07131b;
    --deep-sea: #0d202b;
    --deck-brown: #2f2015;
    --rope-brown: #6a4a2a;
    --gold: #c99b45;
    --gold-bright: #e0bb6d;
    --parchment: #e9d7b1;
    --parchment-soft: #f2e6c8;
    --ink-dark: #2d1d12;
    --mist: #bfc7cd;
    --danger: #a23b26;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    --panel-border: rgba(98, 66, 35, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--parchment-soft);
    background:
        linear-gradient(rgba(4, 16, 24, 0.74), rgba(10, 21, 28, 0.8)),
        radial-gradient(circle at 50% 45%, rgba(201, 155, 69, 0.12), transparent 32%),
        url("/img/pirate.jpg") center top / cover fixed no-repeat,
        linear-gradient(180deg, #041018 0%, #0b1d28 40%, #122936 100%);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        radial-gradient(circle at center, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.35)),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.012) 0,
            rgba(255, 255, 255, 0.012) 1px,
            transparent 1px,
            transparent 90px
        );
    pointer-events: none;
    opacity: 0.48;
}

.decor-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.decor-item {
    position: absolute;
    display: block;
    opacity: 0.11;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    animation: decorFloat 7s ease-in-out infinite;
}

.decor-scroll {
    top: 7rem;
    left: 1.5rem;
    width: 170px;
    height: 170px;
    transform: rotate(-10deg);
    animation-delay: 0s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cpath fill='%23f2e6c8' d='M40 44c0-13 11-24 24-24h67c5 0 9 4 9 9v92c0 22-18 40-40 40H55c-10 0-18-8-18-18 0-10 8-18 18-18h47c10 0 18-8 18-18V44H40z'/%3E%3Cpath fill='%23c99b45' d='M28 46c0-14 11-26 26-26 12 0 22 8 25 19H64c-4 0-7 2-9 6H28zM44 143c-8 0-15 6-15 14 0 8 7 15 15 15 12 0 21-10 21-21v-8H44z'/%3E%3Cpath fill='none' stroke='%236a4a2a' stroke-width='6' d='M41 45h79M54 126h48M54 104h48M54 82h48'/%3E%3C/svg%3E");
}

.decor-bottle {
    right: 2rem;
    top: 10rem;
    width: 150px;
    height: 150px;
    transform: rotate(14deg);
    animation-delay: 1.4s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cpath fill='%23d4c4a0' d='M74 18h32v18l10 14c8 11 13 23 13 37v28c0 24-19 43-43 43s-43-19-43-43V87c0-14 5-26 13-37l10-14V18h8z' opacity='.82'/%3E%3Cpath fill='%2380b6b5' d='M58 94h56v31c0 15-12 28-28 28s-28-13-28-28V94z' opacity='.72'/%3E%3Cpath fill='none' stroke='%236a4a2a' stroke-width='6' d='M74 18h32M66 36h48M55 72c8 8 18 11 31 11 16 0 28-4 38-11M58 95h57'/%3E%3C/svg%3E");
}

.decor-skull {
    left: 4rem;
    bottom: 3rem;
    width: 140px;
    height: 140px;
    transform: rotate(-8deg);
    animation-delay: 2.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cpath fill='%23f0e7d1' d='M90 24c-31 0-56 23-56 52 0 18 10 34 25 43v20c0 9 7 16 16 16h8v-18h14v18h8c9 0 16-7 16-16v-20c15-9 25-25 25-43 0-29-25-52-56-52z'/%3E%3Ccircle cx='68' cy='80' r='12' fill='%232d1d12'/%3E%3Ccircle cx='112' cy='80' r='12' fill='%232d1d12'/%3E%3Cpath fill='%232d1d12' d='M90 92l-10 15h20zM76 122h8v17h-8zM88 122h8v17h-8zM100 122h8v17h-8z'/%3E%3Cpath fill='none' stroke='%236a4a2a' stroke-width='6' d='M48 50c10-14 25-21 42-21 21 0 38 8 47 24'/%3E%3C/svg%3E");
}

.decor-ship {
    right: 4rem;
    bottom: 2rem;
    width: 210px;
    height: 210px;
    transform: rotate(4deg);
    animation-delay: 0.8s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cpath fill='%23d9bf86' d='M51 133h112l-16 30H67z'/%3E%3Cpath fill='%236a4a2a' d='M68 76h8v57h-8zM103 60h8v73h-8zM137 82h8v51h-8z'/%3E%3Cpath fill='%23f2e6c8' d='M76 80c15 4 23 14 27 27H76zM111 64c19 6 31 20 34 40h-34zM145 86c12 4 20 12 24 24h-24z'/%3E%3Cpath fill='none' stroke='%236a4a2a' stroke-width='6' d='M38 163c16 12 33 17 51 17 18 0 29-7 41-7 12 0 23 7 41 7 18 0 35-5 51-17M51 133h112M58 148h93'/%3E%3Cpath fill='none' stroke='%23c99b45' stroke-width='4' d='M22 184c17-9 32-13 46-13 14 0 24 4 34 8 10 4 20 8 34 8 17 0 34-6 61-21'/%3E%3C/svg%3E");
}

a {
    color: inherit;
    text-decoration: none;
}

.top-nav {
    padding: 1rem 1.5rem;
    background:
        linear-gradient(180deg, rgba(13, 32, 43, 0.96), rgba(9, 23, 30, 0.96));
    border-bottom: 2px solid rgba(201, 155, 69, 0.36);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand-title {
    color: var(--gold-bright);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-subtitle {
    color: rgba(233, 215, 177, 0.72);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pirate-toggler {
    border-color: rgba(201, 155, 69, 0.35);
    background-color: rgba(233, 215, 177, 0.06);
}

.pirate-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28242, 230, 200, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-links .nav-link {
    color: rgba(242, 230, 200, 0.84);
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    margin-left: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links .nav-link:hover,
.nav-links .nav-link:focus {
    color: var(--gold-bright);
    background: rgba(201, 155, 69, 0.1);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
    animation: pageRise 0.85s ease-out both;
}

.narrow-shell {
    width: min(760px, calc(100% - 2rem));
}

.hero-banner {
    margin-bottom: 2rem;
}

.scroll-panel,
.compass-card,
.feature-card {
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.scroll-panel {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.22), transparent 25%),
        linear-gradient(180deg, rgba(242, 230, 200, 0.98), rgba(225, 205, 160, 0.95));
    border: 1px solid var(--panel-border);
    color: var(--ink-dark);
}

.hero-card {
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    animation: parchmentReveal 0.9s ease-out both;
}

.hero-card::after,
.content-card::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(106, 74, 42, 0.2);
    border-radius: 18px;
    pointer-events: none;
}

.hero-card h1,
.section-header h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    color: #362112;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero-copy {
    margin: 1rem 0 0;
    max-width: 700px;
    color: rgba(45, 29, 18, 0.82);
    line-height: 1.8;
    font-size: 1.04rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--rope-brown);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
}

.compass-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background:
        radial-gradient(circle, rgba(201, 155, 69, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(16, 37, 47, 0.88), rgba(8, 20, 27, 0.9));
    border: 1px solid rgba(201, 155, 69, 0.28);
    backdrop-filter: blur(3px);
}

.compass-ring {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    padding: 18px;
    border: 3px solid rgba(201, 155, 69, 0.45);
    background:
        radial-gradient(circle, rgba(233, 215, 177, 0.12), transparent 55%),
        linear-gradient(135deg, rgba(201, 155, 69, 0.18), rgba(255, 255, 255, 0.04));
    display: grid;
    place-items: center;
    animation: compassPulse 5s ease-in-out infinite;
}

.compass-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(233, 215, 177, 0.28);
    position: relative;
}

.compass-core span {
    position: absolute;
    color: var(--gold-bright);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.compass-core span:nth-child(1) {
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-core span:nth-child(2) {
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-core span:nth-child(3) {
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-core span:nth-child(4) {
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-text {
    margin: 1.5rem 0 0;
    max-width: 280px;
    text-align: center;
    color: rgba(242, 230, 200, 0.78);
    line-height: 1.7;
}

.feature-card {
    background:
        linear-gradient(180deg, rgba(242, 230, 200, 0.98), rgba(231, 214, 174, 0.95));
    border: 1px solid var(--panel-border);
    color: var(--ink-dark);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: cardReveal 0.75s ease-out both;
}

.feature-card:hover {
    transform: translateY(-6px) rotate(-0.3deg);
    box-shadow: 0 22px 42px rgba(0, 0, 0, 0.3);
}

.row .col-md-4:nth-child(1) .feature-card {
    animation-delay: 0.08s;
}

.row .col-md-4:nth-child(2) .feature-card {
    animation-delay: 0.18s;
}

.row .col-md-4:nth-child(3) .feature-card {
    animation-delay: 0.28s;
}

.feature-card .card-body {
    padding: 1.7rem;
}

.card-kicker {
    margin-bottom: 0.6rem;
    color: var(--rope-brown);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
}

.feature-card .card-title {
    color: #332014;
    margin-bottom: 0.85rem;
    font-size: 1.65rem;
}

.feature-card .card-text {
    color: rgba(45, 29, 18, 0.76);
    line-height: 1.7;
}

.card-link-text {
    display: inline-block;
    margin-top: 1rem;
    color: #6f4520;
    font-weight: 700;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.content-card {
    position: relative;
    padding: 1.6rem;
    animation: parchmentReveal 0.8s ease-out both;
}

.btn-pirate,
.btn-outline-pirate {
    padding: 0.8rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-pirate {
    background: linear-gradient(180deg, #dcb96e, #ba8540);
    border: 1px solid #8f6128;
    color: #2a1808;
}

.btn-pirate:hover,
.btn-pirate:focus {
    background: linear-gradient(180deg, #e3c27b, #c08d48);
    color: #2a1808;
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(95, 61, 22, 0.25);
}

.btn-outline-pirate {
    background: rgba(242, 230, 200, 0.08);
    border: 1px solid rgba(201, 155, 69, 0.42);
    color: var(--parchment-soft);
}

.btn-outline-pirate:hover,
.btn-outline-pirate:focus {
    background: rgba(201, 155, 69, 0.12);
    color: var(--gold-bright);
    transform: translateY(-2px);
}

.data-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink-dark);
    --bs-table-hover-color: var(--ink-dark);
    --bs-table-hover-bg: rgba(201, 155, 69, 0.08);
}

.data-table th {
    color: #6a4424;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid rgba(106, 74, 42, 0.18);
}

.data-table td {
    color: rgba(45, 29, 18, 0.84);
    border-bottom: 1px solid rgba(106, 74, 42, 0.1);
}

.empty-state {
    margin: 0;
    color: rgba(45, 29, 18, 0.72);
}

.data-form {
    color: var(--ink-dark);
}

.form-row {
    gap: 0.45rem;
}

.form-row label {
    font-weight: 600;
    color: #55351d;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(106, 74, 42, 0.26);
    background: rgba(255, 251, 241, 0.72);
    color: var(--ink-dark);
}

.form-row input:focus,
.form-row select:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(201, 155, 69, 0.18);
    border-color: var(--gold);
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.92rem;
}

.form-errors {
    display: grid;
    gap: 0.25rem;
}

.status-pill {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(201, 155, 69, 0.14);
    border: 1px solid rgba(106, 74, 42, 0.24);
    color: #6a4521;
    font-size: 0.85rem;
    font-weight: 700;
    animation: statusGlow 3.8s ease-in-out infinite;
}

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

@keyframes parchmentReveal {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(20px) rotate(0.4deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes decorFloat {
    0%, 100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -10px;
    }
}

@keyframes compassPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(201, 155, 69, 0.08);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 14px rgba(201, 155, 69, 0);
    }
}

@keyframes statusGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(201, 155, 69, 0);
    }
    50% {
        box-shadow: 0 0 16px rgba(201, 155, 69, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-shell,
    .hero-card,
    .content-card,
    .feature-card,
    .decor-item,
    .compass-ring,
    .status-pill {
        animation: none !important;
    }

    .btn-pirate,
    .btn-outline-pirate,
    .feature-card {
        transition: none !important;
    }
}

@media (max-width: 720px) {
    .top-nav,
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-shell,
    .narrow-shell {
        width: min(100% - 1rem, 100%);
    }

    .hero-card,
    .content-card {
        padding: 1.25rem;
    }

    .brand-subtitle {
        display: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(214, 173, 79, 0.12);
    }

    .data-table td {
        padding: 0.45rem 0;
        border-bottom: none;
    }

    .decor-scroll,
    .decor-bottle,
    .decor-skull,
    .decor-ship {
        opacity: 0.1;
        transform: scale(0.78);
    }

    .decor-scroll,
    .decor-skull {
        left: -1rem;
    }

    .decor-bottle,
    .decor-ship {
        right: -1.5rem;
    }
}
