/* Copyright (c) 2026 Rory Ferrick. All rights reserved. Maritime Empire.
   The game's own look (tools/make_theme.gd): navy panels, Signal Flags red
   buttons with a raised bottom edge, signal-yellow accents, Cinzel and Lato. */

@font-face { font-family: "Cinzel"; src: url("assets/fonts/Cinzel-Variable.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Lato"; src: url("assets/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("assets/fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b1830;
  --bar: #0e1f3d;
  --card: #142a52;
  --card-hover: #1a3566;
  --line: #2a4373;
  --text: #ffffff;
  --muted: #b7c3da;
  --accent: #f2c230;
  --sea: #4f8fd6;
  --button: #c8343a;
  --button-hover: #dc4a50;
  --button-edge: #7e1a1e;
  --disabled: #3b4a6b;
  --radius: 6px;
  --heading: "Cinzel", Georgia, serif;
  --body: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--accent); color: var(--bg); border-radius: var(--radius); font-weight: 700; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: #ffd95a; }
h1, h2, h3 { font-family: var(--heading); font-weight: 700; line-height: 1.2; }
code { font-size: 0.88em; background: rgba(255,255,255,0.08); padding: 0.1em 0.35em; border-radius: 4px; word-break: break-word; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px; background: var(--bar); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 20px var(--heading); white-space: nowrap; }
.brand img { border-radius: 6px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav > a { color: var(--muted); text-decoration: none; font: 700 15px var(--heading); padding: 8px 12px; border-radius: var(--radius); }
.site-nav > a:hover, .site-nav > a.active { color: var(--text); background: var(--card); }

/* Buttons */
.btn { display: inline-block; font: 700 15px var(--heading); letter-spacing: 0.02em; text-decoration: none; color: var(--text);
  padding: 9px 16px; border-radius: 4px; background: var(--button); box-shadow: 0 3px 0 var(--button-edge); white-space: nowrap; }
.btn:hover { background: var(--button-hover); color: var(--text); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--button-edge); }
.btn-steam.is-soon { background: var(--disabled); box-shadow: 0 3px 0 #252f47; color: #dfe6f2; cursor: default; }
.btn-steam.is-soon:active { transform: none; }
.btn-big { font-size: 18px; padding: 13px 24px; }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Landing */
.hero { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,24,48,0.95) 0%, rgba(11,24,48,0.75) 40%, rgba(11,24,48,0.05) 75%),
  linear-gradient(0deg, var(--bg) 0%, transparent 30%); }
.hero-text { position: relative; z-index: 1; max-width: 780px; padding: 48px 24px 64px max(24px, calc((100vw - 1160px) / 2)); }
.hero h1 { font-size: clamp(44px, 7vw, 84px); margin: 0 0 8px; text-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.tagline { font: 700 clamp(20px, 2.6vw, 28px) var(--heading); color: var(--accent); margin: 0 0 12px; }
.hero p { font-size: 19px; color: #e4eaf5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }

main { display: block; }
.features, .gallery, .cta { max-width: 1160px; margin: 0 auto; padding: 56px 24px; }
.features > h2, .gallery > h2 { font-size: clamp(28px, 4vw, 40px); text-align: center; margin: 0 0 40px; }
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; margin-bottom: 64px; }
.feature.flip > img { order: 2; }
.feature img { border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,0.45); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.feature h3 { font-size: 28px; margin: 0 0 12px; }
.feature p { color: var(--muted); margin: 0 0 14px; }
.feature a { font-weight: 700; text-decoration: none; }
.feature a::after { content: " \2192"; }
.gallery .note { text-align: center; color: var(--muted); margin: -28px 0 28px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-grid img { border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border: 1px solid var(--line); transition: transform 0.15s; }
.gallery-grid a:hover img { transform: scale(1.02); }
.cta { text-align: center; }
.cta img { margin: 0 auto; width: min(420px, 80%); height: auto; }
.cta p { color: var(--muted); }
.cta .hero-actions { justify-content: center; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,10,20,0.92); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92vh; border-radius: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bar); color: var(--muted); text-align: center; padding: 24px; font-size: 14px; }
.site-footer p { margin: 4px 0; }

/* Privacy and other prose pages */
.prose { max-width: 780px; margin: 0 auto; padding: 40px 24px 64px; }
.prose h1 { font-size: 40px; }
.prose h2 { margin-top: 36px; }

/* Wiki */
.wiki-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.wiki-aside { position: sticky; top: 59px; align-self: start; max-height: calc(100vh - 59px); overflow-y: auto; padding: 20px 16px 40px; border-right: 1px solid var(--line); }
.search { position: relative; margin-bottom: 16px; }
.search input { width: 100%; padding: 10px 12px; font: 16px var(--body); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.results { position: absolute; left: 0; right: -260px; top: 46px; z-index: 30; background: var(--bar); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0,0,0,0.5); max-height: 70vh; overflow-y: auto; }
.results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.results a:hover, .results a.sel { background: var(--card-hover); }
.results small { display: block; color: var(--muted); font-size: 12px; }
.results span { display: block; color: var(--muted); font-size: 14px; }
.results mark { background: rgba(242,194,48,0.35); color: inherit; }
.results p { margin: 0; padding: 12px 14px; color: var(--muted); }
.side-toggle { display: none; }
.side-home { display: block; font: 700 15px var(--heading); color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); margin-bottom: 6px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 12px; border-left: 1px solid var(--line); margin: 2px 0 8px 10px; }
.tree a { display: block; padding: 5px 10px; color: var(--muted); text-decoration: none; border-radius: var(--radius); font-size: 15px; line-height: 1.35; }
.tree > li > a { font: 700 15px var(--heading); color: var(--text); }
.tree ul ul a { font-size: 14px; }
.tree a:hover, .side-home:hover { background: var(--card); color: var(--text); }
.tree a.current, .side-home.current { background: var(--card); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }

.wiki-main { padding: 28px 40px 64px; min-width: 0; }
.wiki-page, .wiki-home { max-width: 860px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 4px; opacity: 0.6; }
.wiki-main h1 { font-size: clamp(30px, 4vw, 42px); margin: 0 0 12px; }
.wiki-main h2 { font-size: 26px; margin: 40px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.wiki-main h3 { font-size: 20px; margin: 28px 0 10px; }
.wiki-main li { margin: 0 0 10px; }
.wiki-main ul ul { margin-top: 8px; }
.lead { font-size: 19px; color: #e4eaf5; }
.dated { display: inline-block; font-size: 14px; color: var(--bg); background: var(--accent); padding: 2px 10px; border-radius: 99px; margin: 0 0 14px; font-weight: 700; }
.shot { margin: 18px 0 26px; }
.shot img { border-radius: 8px; border: 1px solid var(--line); width: 100%; }
.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--card); font-family: var(--heading); }
tr:last-child td { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.card:hover { background: var(--card-hover); border-color: var(--accent); color: var(--text); }
.card strong { font-family: var(--heading); font-size: 17px; }
.card span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.card em, .topic em { font-style: normal; font-size: 13px; color: var(--accent); margin-top: auto; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 24px 0; }
.topic { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text); padding-bottom: 14px; }
.topic:hover { border-color: var(--accent); background: var(--card-hover); color: var(--text); }
.topic img, .topic-blank { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; margin-bottom: 6px; }
.topic-blank { background: linear-gradient(135deg, #2f8ee0, #0a3266); }
.topic strong, .topic span, .topic em { padding: 0 16px; }
.topic strong { font: 700 19px var(--heading); }
.topic span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.recent { list-style: none; padding: 0; }
.recent li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.recent time { color: var(--accent); font-size: 14px; min-width: 130px; }
.recent span { color: var(--muted); font-size: 14px; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.prev-next a { display: block; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-family: var(--heading); }
.prev-next a:hover { border-color: var(--accent); color: var(--text); }
.prev-next span { display: block; font: 13px var(--body); color: var(--muted); }
.prev-next .next { text-align: right; grid-column: 2; }

/* Phones and small tablets */
@media (max-width: 900px) {
  .site-header { padding: 10px 16px; }
  .site-nav > a { padding: 8px; }
  .site-header .btn-steam { display: none; }
  .feature { grid-template-columns: 1fr; gap: 18px; margin-bottom: 48px; }
  .feature.flip > img { order: 0; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 10%, rgba(11,24,48,0.75) 60%, rgba(11,24,48,0.3) 100%); }
  .hero-text { padding: 160px 16px 40px; }
  .features, .gallery, .cta { padding: 40px 16px; }
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-aside { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .results { right: 0; }
  .side-toggle { display: block; width: 100%; padding: 10px; font: 700 15px var(--heading); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
  .sidebar { display: none; margin-top: 12px; }
  .sidebar.open { display: block; }
  .wiki-main { padding: 20px 16px 48px; }
}
@media (max-width: 520px) {
  .brand { font-size: 17px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next .next { grid-column: 1; }
}
