/* =====================================================================
   THE FLOOD CHRONICLES — shared stylesheet
   One file styles every page. Change a value here and the whole site
   follows. Palette: aged parchment, iron-gall ink, antique gold leaf.
   Typeface: IM Fell DW Pica (an authentic 17th-century book face).
   ===================================================================== */

:root {
    /* --- Parchment surfaces --- */
    --paper:        #f4eee1;   /* base page */
    --paper-2:      #efe7d5;   /* raised panels */
    --paper-3:      #e7dcc5;   /* insets, table headers */
    --paper-ink:    #fdfbf7;   /* form fields, "fresh" paper */

    /* --- Ink --- */
    --ink:          #2b2620;   /* body */
    --ink-soft:     #574f43;   /* secondary */
    --ink-faint:    #897d69;   /* captions, meta */

    /* --- Gold leaf --- */
    --gold:         #9c7d3c;
    --gold-deep:    #7a5f2c;
    --gold-bright:  #bb9650;

    /* --- Heraldic accents --- */
    --wine:         #7a2e2a;   /* seals, "full", war */
    --wine-deep:    #5d2320;
    --sea:          #3f5e6e;   /* links, cool accent */
    --sea-deep:     #2c4451;
    --green:        #436b4b;   /* "open for applications" */
    --green-deep:   #2f4f36;

    /* --- Lines & shadow --- */
    --line:         #d6cbb4;
    --line-strong:  #c2b393;
    --shadow:       rgba(58,44,24,0.13);
    --shadow-deep:  rgba(58,44,24,0.22);

    --maxw:         1080px;
    --measure:      66ch;     /* comfortable reading column */
    --radius:       5px;
    --serif:        'IM Fell DW Pica', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.72;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    position: relative;
}

/* faint paper grain + vignette, drawn in CSS so nothing extra to upload */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(120% 120% at 50% -10%, rgba(255,250,238,0.55), transparent 55%),
        radial-gradient(140% 140% at 50% 115%, rgba(90,70,40,0.10), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* keep real content above the texture layer */
.brandbar, main, footer, .skip-link { position: relative; z-index: 1; }

/* --------------------------------------------------------- typography */
h1, h2, h3, h4 {
    font-weight: 400;
    line-height: 1.2;
    color: #211c16;
    margin: 0 0 .5em;
    letter-spacing: .01em;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.3rem; color: var(--gold-deep); }
h4 { font-size: 1.08rem; color: var(--ink-soft); }

p { margin: 0 0 1.1em; }
strong, b { font-weight: 400; color: #1f1a14; border-bottom: 1px dotted var(--line-strong); }
em, i { font-style: italic; }

a {
    color: var(--sea);
    text-decoration: none;
    border-bottom: 1px solid rgba(63,94,110,0.35);
    transition: color .2s, border-color .2s, background .2s;
}
a:hover { color: var(--sea-deep); border-bottom-color: var(--sea-deep); }

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .5em; }
li::marker { color: var(--gold); }

hr {
    border: 0;
    height: 1px;
    background: var(--line-strong);
    margin: 2em 0;
}

/* an "eyebrow" kicker above headings */
.kicker {
    display: inline-block;
    font-size: .82rem;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 0 0 .8em;
    border: 0;
}

/* drop-cap for lead paragraphs */
.lead { font-size: 1.22rem; color: var(--ink-soft); }
.lead--cap::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: .82;
    padding: .06em .12em 0 0;
    color: var(--wine);
    font-style: italic;
}

/* ornamental divider:  ───  ❖  ─── */
.rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gold);
    margin: 2.6rem 0;
}
.rule::before, .rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 40%, var(--line-strong) 60%, transparent);
}
.rule span { font-size: 1.1rem; opacity: .8; }

/* --------------------------------------------------------------- layout */
.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--ink); color: var(--paper); padding: .6em 1em; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; z-index: 100; }

main { width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 820px; }
.section { padding: 56px 0; }
.section--tight { padding: 34px 0; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.center { text-align: center; }

/* ------------------------------------------------------------ brand bar */
.brandbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(238,229,212,0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 6px 18px -14px var(--shadow-deep);
}
.brandbar__inner {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; gap: 16px;
    padding: 10px 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    border: 0; color: inherit;
}
.brand img {
    width: 46px; height: 46px; object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--gold);
    box-shadow: 0 2px 6px var(--shadow);
    background: var(--paper-3);
}
.brand__text { line-height: 1.05; }
.brand__name { font-size: 1.32rem; color: #211c16; letter-spacing: .02em; }
.brand__sub  { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); }

.mainnav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 7px 13px;
    color: var(--ink-soft);
    font-size: 1rem;
    letter-spacing: .02em;
}
.mainnav a:hover { background: var(--paper-3); color: var(--ink); border-color: var(--line); }
.mainnav a[aria-current="page"] {
    color: var(--wine-deep);
    border-color: var(--line-strong);
    background: var(--paper);
    box-shadow: inset 0 -2px 0 var(--gold);
}

/* --------------------------------------------------------------- hero */
.hero {
    text-align: center;
    padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
    position: relative;
}
.hero::after {
    content: "";
    display: block;
    width: min(640px, 86%);
    height: 1px;
    margin: 2.4rem auto 0;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.hero h1 { margin-bottom: .25em; }
.hero .lead { max-width: 660px; margin-inline: auto; }
.hero__tagline {
    font-style: italic; color: var(--gold-deep); font-size: 1.15rem;
    letter-spacing: .03em; margin-bottom: 1.2em;
}

/* ------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; gap: .5em;
    font-family: var(--serif); font-size: 1.05rem; line-height: 1;
    padding: .82em 1.5em;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--paper-2);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    letter-spacing: .02em;
    transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s, color .2s;
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 3px 10px -6px var(--shadow-deep);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px var(--shadow-deep); }
.btn:active { transform: translateY(0); }
.btn--primary {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    border-color: var(--gold-deep);
    color: #2a200d;
}
.btn--primary:hover { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #fff8e9; }
.btn--wine { background: linear-gradient(180deg, #8c3a35, var(--wine)); border-color: var(--wine-deep); color: #fbeae6; }
.btn--wine:hover { color: #fff; }
.btn--ghost { background: transparent; }
.btn[aria-disabled="true"], .btn:disabled {
    opacity: .55; cursor: not-allowed; pointer-events: none;
    background: var(--paper-3); color: var(--ink-faint); box-shadow: none; transform: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 1.6em; }
.btn-row--left { justify-content: flex-start; }

/* --------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: .45em;
    font-size: .76rem; letter-spacing: .16em; text-transform: uppercase;
    padding: .4em .8em; border-radius: 999px;
    border: 1px solid currentColor;
    background: rgba(255,255,255,.35);
}
.badge::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.badge--open { color: var(--green-deep); }
.badge--full { color: var(--wine); }
.badge--soon { color: var(--ink-faint); }

/* ----------------------------------------------------------- panels/cards */
.panel {
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 28px 30px;
    box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 30px -22px var(--shadow-deep);
}
.panel--quiet { background: linear-gradient(180deg, var(--paper-2), var(--paper)); }

/* a manuscript "marginalia" callout (replaces the docx boxed notes) */
.note {
    border-left: 3px solid var(--gold);
    background: linear-gradient(90deg, rgba(156,125,60,0.07), transparent 60%);
    padding: .9em 1.2em;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.note__title { display:block; color: var(--gold-deep); letter-spacing:.12em; text-transform:uppercase; font-size:.78rem; margin-bottom:.3em; }

/* grid of cards */
.grid { display: grid; gap: 26px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* server card */
.server-card {
    display: flex; flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 12px 34px -26px var(--shadow-deep);
    transition: transform .16s ease, box-shadow .2s, border-color .2s;
}
.server-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px var(--shadow-deep); border-color: var(--gold); }
.server-card__top {
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--paper-3), var(--paper-2));
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.server-card__name { font-size: 1.7rem; margin: 0; }
.server-card__role { font-style: italic; color: var(--ink-faint); font-size: .98rem; }
.server-card__body { padding: 20px 26px 8px; flex: 1; }
.server-card__facts { list-style: none; margin: 0 0 .4em; padding: 0; }
.server-card__facts li { display: flex; justify-content: space-between; gap: 1em; padding: .35em 0; border-bottom: 1px dotted var(--line); }
.server-card__facts li:last-child { border-bottom: 0; }
.server-card__facts .k { color: var(--ink-faint); }
.server-card__foot { padding: 16px 26px 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* definition grid for "current state" */
.deflist { display: grid; grid-template-columns: max-content 1fr; gap: 0 1.4em; }
.deflist dt { color: var(--gold-deep); padding: .55em 0; border-bottom: 1px dotted var(--line); letter-spacing:.02em; }
.deflist dd { margin: 0; padding: .55em 0; border-bottom: 1px dotted var(--line); }

/* step list (how it works) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps li {
    position: relative; padding: 4px 0 4px 64px; margin: 0;
}
.steps li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--paper-2); border: 1px solid var(--gold);
    color: var(--gold-deep); font-size: 1.25rem;
    box-shadow: 0 4px 10px -6px var(--shadow-deep);
}
.steps li h4 { margin: .15em 0 .25em; color: #211c16; }
.steps li p { margin: 0; color: var(--ink-soft); }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
table { width: 100%; border-collapse: collapse; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-3); font-weight: 400; color: var(--gold-deep); letter-spacing: .03em; }
tbody tr:nth-child(even) { background: rgba(231,220,197,0.35); }
tbody tr:last-child td { border-bottom: 0; }

/* images */
.figure { margin: 1.8em 0; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line-strong); box-shadow: 0 14px 34px -24px var(--shadow-deep); display: block; }
.figure figcaption { font-size: .9rem; color: var(--ink-faint); font-style: italic; margin-top: .6em; text-align: center; }

/* ------------------------------------------------------------------ forms */
form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field > label { color: var(--gold-deep); letter-spacing: .03em; }
.field .hint { font-size: .9rem; font-style: italic; color: var(--ink-faint); margin: -2px 0 2px; }
.req { color: var(--wine); }

input[type="text"], input[type="email"], select, textarea {
    font-family: var(--serif); font-size: 1.02rem; color: var(--ink);
    background: var(--paper-ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 12px 14px; width: 100%;
    transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold-deep) 50%), linear-gradient(135deg, var(--gold-deep) 50%, transparent 50%); background-position: calc(100% - 20px) 1.05em, calc(100% - 14px) 1.05em; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(156,125,60,0.18);
}
.fieldset-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* compiled-preview / copy box */
.preview {
    display: none;
    margin-top: 8px;
    background: var(--paper-ink);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.preview.is-visible { display: block; }
.preview h4 { margin: 0 0 .4em; color: var(--gold-deep); }
.preview pre { white-space: pre-wrap; font-family: var(--serif); font-size: .98rem; color: var(--ink-soft); margin: 0; }
.toast { font-size: .92rem; color: var(--green-deep); font-style: italic; min-height: 1.4em; }

/* --------------------------------------------------------- price tag pill */
.price {
    display: inline-flex; align-items: baseline; gap: .35em;
    font-size: 1.05rem; color: var(--ink-soft);
}
.price b { font-size: 1.45rem; color: var(--wine); border: 0; }

/* ----------------------------------------------------------------- footer */
footer.site {
    margin-top: 40px;
    border-top: 1px solid var(--line-strong);
    background: linear-gradient(180deg, transparent, rgba(231,220,197,0.5));
}
footer.site .wrap { padding-top: 34px; padding-bottom: 34px; text-align: center; }
footer.site .rule { margin: 0 0 1.4rem; }
footer.site a { color: var(--sea-deep); }
.foot-contacts { font-size: 1rem; color: var(--ink-soft); }
.foot-contacts span { white-space: nowrap; }
.foot-legal { font-size: .85rem; color: var(--ink-faint); margin-top: .8em; }

/* ----------------------------------------------------------------- misc */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 1em 0; }
.tag-list li { border: 1px solid var(--line-strong); border-radius: 999px; padding: .3em .85em; font-size: .92rem; color: var(--ink-soft); background: var(--paper-2); }

.toc { background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 18px 22px; margin: 1.5em 0 2.4em; }
.toc h2 { font-size: 1.05rem; letter-spacing:.12em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 .6em; border:0; }
.toc ol { columns: 2; column-gap: 2.4em; margin: 0; padding-left: 1.2em; }
@media (max-width: 620px){ .toc ol { columns: 1; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 1.4em 0; }
.gallery a { border: 0; }
.gallery figure { margin: 0; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 26px -20px var(--shadow-deep); transition: transform .15s, box-shadow .2s; }
.gallery figure:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -20px var(--shadow-deep); }
.gallery img { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--paper-3); }
.gallery figcaption { padding: 10px 12px; font-size: .92rem; color: var(--ink-soft); }
.gallery--empty { color: var(--ink-faint); font-style: italic; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align:center; }

.subnav { display:flex; flex-wrap:wrap; gap:8px; margin: 0 0 1.6em; }
.subnav button {
    font-family: var(--serif); font-size: 1rem; cursor: pointer;
    background: var(--paper-2); border:1px solid var(--line-strong); border-radius: 999px;
    padding: .4em 1em; color: var(--ink-soft); transition: all .18s;
}
.subnav button:hover { border-color: var(--gold); color: var(--ink); }
.subnav button[aria-selected="true"] { background: var(--gold); border-color: var(--gold-deep); color:#2a200d; }

.gallery-group { display:none; }
.gallery-group.is-active { display:block; }

/* ------------------------------------------------------------ animations */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
    .reveal-2 { animation-delay: .09s; }
    .reveal-3 { animation-delay: .18s; }
    .reveal-4 { animation-delay: .27s; }
    .reveal-5 { animation-delay: .36s; }
    @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
    .grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    body { font-size: 18px; }
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
    .fieldset-split { grid-template-columns: 1fr; }
    .brandbar__inner { padding: 8px 16px; }
    .mainnav { width: 100%; margin-left: 0; justify-content: center; }
    .deflist { grid-template-columns: 1fr; gap: 0; }
    .deflist dt { border-bottom: 0; padding-bottom: 0; }
    .deflist dd { padding-top: .15em; }
    .wrap { padding: 0 18px; }
    .panel { padding: 22px; }
}

/* ------------------------------------------------- small helpers / addenda */
.muted { color: var(--ink-faint); }
code, kbd {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
    font-size: .92em;
    background: var(--paper-3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: .08em .4em;
    color: var(--wine-deep);
    word-break: break-word;
}
pre.code {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
    font-size: .9rem; line-height: 1.55;
    background: #2b2620; color: #f2ead9;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 16px 18px; overflow-x: auto; margin: 1em 0;
    white-space: pre;
}
pre.code code { background: none; border: 0; padding: 0; color: inherit; font-size: 1em; }
pre.code .c { color: #b8a98a; font-style: italic; }   /* comment */
pre.code .s { color: #cdb36a; }                        /* string  */
.admin-banner {
    background: var(--wine); color: #f6ece0;
    border-radius: var(--radius); padding: 12px 18px;
    margin: 0 0 1.8em; font-size: .98rem;
    box-shadow: 0 10px 26px -18px var(--shadow-deep);
}
.admin-banner strong { color: #fff; }
.checklist { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: .55em; }
.checklist li { position: relative; padding-left: 1.9em; }
.checklist li::before {
    content: "☐"; position: absolute; left: 0; top: -.05em;
    color: var(--gold-deep); font-size: 1.15em;
}

/* ----------------------------------------------- front-page featured logo */
.hero__crest {
    display: block;
    width: clamp(180px, 30vw, 290px);
    height: auto;
    margin: 0 auto 1.6rem;
    border-radius: var(--radius);
    box-shadow: 0 24px 54px -30px var(--shadow-deep);
}
@media (max-width: 760px) {
    .hero__crest { width: clamp(150px, 52vw, 220px); margin-bottom: 1.2rem; }
}

/* ---------------------------------------------- world banner (page hero art) */
.world-banner {
    display: block;
    width: 100%;
    max-width: 860px;
    height: auto;
    margin: 0 auto 1.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    box-shadow: 0 26px 60px -34px var(--shadow-deep);
}
@media (max-width: 760px) { .world-banner { margin-bottom: 1.1rem; } }

/* -------------------------------------------------------- checkbox row (forms) */
.check { display: flex; align-items: flex-start; gap: .6em; cursor: pointer; color: var(--ink-soft); }
.check input[type="checkbox"] { width: 1.15em; height: 1.15em; margin-top: .2em; flex: none; accent-color: var(--gold-deep); }
.check span { line-height: 1.55; }
