:root {
    color-scheme: dark;
    --ink: #f8f6f0;
    --muted: #aeb8c5;
    --muted-strong: #cbd2da;
    --navy: #071426;
    --navy-deep: #040b15;
    --panel: rgba(14, 32, 53, 0.82);
    --panel-solid: #0e2035;
    --line: rgba(212, 175, 55, 0.2);
    --line-soft: rgba(255, 255, 255, 0.09);
    --gold: #d4af37;
    --gold-soft: #f0d778;
    --max-width: 960px;
}

body[data-theme="ivory"] {
    color-scheme: light;
    --ink: #18263a;
    --muted: #4b5563;
    --muted-strong: #263548;
    --navy: #fdf8f0;
    --navy-deep: #f3eadb;
    --panel: rgba(255, 255, 255, .88);
    --panel-solid: #fffdf9;
    --line: rgba(140, 107, 16, .26);
    --line-soft: rgba(24, 38, 58, .12);
    --gold: #8c6b10;
    --gold-soft: #73560b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(37, 83, 128, 0.45), transparent 33rem),
        radial-gradient(circle at 92% 18%, rgba(212, 175, 55, 0.08), transparent 24rem),
        linear-gradient(145deg, var(--navy) 0%, #081a2f 48%, var(--navy-deep) 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.75;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: var(--gold-soft); text-underline-offset: 3px; transition: color .2s ease, opacity .2s ease; }
a:hover { color: #fff2ad; }

.topbar {
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--line);
    background: rgba(4, 14, 27, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 18px 24px;
}

.topbar-inner, .container { max-width: var(--max-width); margin: 0 auto; }

.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-actions { display: inline-flex; align-items: center; gap: 18px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    text-decoration: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    letter-spacing: .1em;
}

.brand img { width: 118px; height: 50px; object-fit: contain; object-position: left center; }

.brand span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(212,175,55,.62);
    border-radius: 50%;
    color: var(--gold-soft);
    font-size: .72rem;
    letter-spacing: .04em;
}

.back { color: var(--muted-strong); font-size: .88rem; text-decoration: none; }
.back::before { content: "←"; margin-right: 8px; color: var(--gold); }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--gold-soft);
    cursor: pointer;
    font: inherit;
    transition: background .2s ease, transform .2s ease;
}
.theme-toggle:hover { background: rgba(212,175,55,.12); transform: translateY(-1px); }

main { position: relative; z-index: 1; padding: clamp(54px, 8vw, 94px) 20px 96px; }

.hero { max-width: 720px; margin: 0 auto 38px; text-align: center; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .28em; font-size: .7rem; font-weight: 700; }

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; }
h1 { margin: 15px 0 13px; font-size: clamp(2.55rem, 7vw, 4.6rem); font-weight: 400; letter-spacing: -.035em; }
.updated { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); margin: 0; font-size: .86rem; }
.updated::before { content: ""; width: 28px; height: 1px; background: var(--gold); opacity: .65; }

.card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(19, 43, 70, .94), var(--panel));
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(28px, 6vw, 64px);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255,255,255,.045);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 9%;
    right: 9%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240,215,120,.8), transparent);
}

.card > p:first-child { color: var(--muted-strong); font-size: 1.08rem; line-height: 1.8; }
p { color: var(--muted); margin: 0 0 1.1em; }

h2 {
    position: relative;
    color: var(--gold-soft);
    margin: 2.35em 0 .72em;
    padding-bottom: .52em;
    border-bottom: 1px solid var(--line-soft);
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 400;
}

h2:first-child { margin-top: 0; }
h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 46px; height: 2px; background: var(--gold); }
h3 { color: var(--gold-soft); font-size: 1.15rem; margin-top: 1.7em; }

ul, ol { margin: .5em 0 1.3em; padding-left: 1.35rem; }
li { color: var(--muted); margin: .55em 0; padding-left: .25rem; }
li::marker { color: var(--gold); }
strong { color: var(--ink); font-weight: 600; }

.notice {
    margin: 24px 0;
    padding: 17px 20px;
    border: 1px solid rgba(212,175,55,.25);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    background: linear-gradient(100deg, rgba(212,175,55,.13), rgba(212,175,55,.035));
}

footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line-soft);
    color: #8290a0;
    text-align: center;
    padding: 26px 20px 32px;
    font-size: .8rem;
}

body[data-theme="ivory"] {
    background:
        radial-gradient(circle at 12% 0%, rgba(212, 175, 55, .13), transparent 33rem),
        radial-gradient(circle at 92% 18%, rgba(37, 83, 128, .08), transparent 24rem),
        linear-gradient(145deg, #fdf8f0 0%, #fbf4e9 48%, #f3eadb 100%);
}
body[data-theme="ivory"]::before { opacity: .16; background-image: linear-gradient(rgba(24,38,58,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(24,38,58,.04) 1px, transparent 1px); }
body[data-theme="ivory"] .topbar { background: rgba(255, 253, 249, .82); }
body[data-theme="ivory"] .card { background: linear-gradient(145deg, rgba(255,253,249,.98), rgba(255,250,242,.92)); box-shadow: 0 24px 70px rgba(90, 70, 35, .13), inset 0 1px 0 rgba(255,255,255,.9); }
body[data-theme="ivory"] footer { color: #667085; }

::selection { color: var(--navy-deep); background: var(--gold-soft); }

@media (max-width: 600px) {
    .topbar { padding: 14px 16px; }
    .brand img { width: 104px; height: 44px; }
    .topbar-inner { gap: 10px; }
    .topbar-actions { gap: 10px; }
    .back { font-size: 0; }
    .back::before { font-size: 1.15rem; margin: 0; }
    main { padding: 48px 14px 64px; }
    .hero { margin-bottom: 28px; }
    h1 { font-size: clamp(2.35rem, 13vw, 3.5rem); }
    .card { border-radius: 18px; padding: 25px 21px; }
    .card > p:first-child { font-size: 1rem; }
}

@media print {
    body { background: #fff; color: #111; }
    body::before, .topbar { display: none; }
    main { padding: 0; }
    .hero { margin: 0 0 24px; text-align: left; }
    h1, h2, h3, strong { color: #111; }
    .card { border: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
    p, li { color: #333; }
    a { color: #333; }
    footer { color: #555; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
