/* =========================================================
   Small Ships Mod – "Sea chart" theme
   Palette: harbour ink, chart paper, signal red, brass, kelp
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #14304A;
  --ink-2: #1C4262;
  --ink-3: #0F2638;
  --paper: #EAF1F0;
  --paper-2: #DCE8E6;
  --flag: #C8372D;
  --flag-dark: #A52A22;
  --brass: #D9A441;
  --brass-dark: #B8862E;
  --kelp: #2E6B5E;
  --foam: #FFFFFF;
  --sail: #F4EFE2;
  --line: #B9CFCC;
  --muted: #4A6173;
  --on-dark: #C9D6DD;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1200px;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow: 0 1px 2px rgba(20,48,74,.06), 0 8px 24px rgba(20,48,74,.08);
  --header-h: 72px;
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--flag-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--flag); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0 0 .5em; letter-spacing: .005em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 900; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; background: var(--paper-2); padding: .12em .4em; border-radius: 4px; overflow-wrap: anywhere; }
kbd { background: var(--foam); border: 1px solid var(--line); border-bottom-width: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -60px; background: var(--brass); color: var(--ink); padding: .6rem 1rem; z-index: 200; font-weight: 700; border-radius: var(--radius-s); }
.skip-link:focus { top: 1rem; }
.icon { flex: none; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; line-height: 1;
  padding: .8rem 1.5rem; border-radius: var(--radius-s); text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { font-size: 1.4rem; padding: .95rem 1.8rem; min-height: 56px; }
.btn-block { width: 100%; }
.btn-flag { background: var(--flag); color: var(--foam); box-shadow: 0 4px 0 var(--flag-dark); }
.btn-flag:hover { background: var(--flag-dark); color: var(--foam); }
.btn-ink { background: var(--ink); color: var(--foam); box-shadow: 0 4px 0 var(--ink-3); }
.btn-ink:hover { background: var(--ink-2); color: var(--foam); }
.btn-ghost { color: var(--sail); border-color: rgba(244,239,226,.55); }
.btn-ghost:hover { background: var(--sail); color: var(--ink); }
.btn-ghost-dark { color: var(--ink); border-color: var(--ink); }
.btn-ghost-dark:hover { background: var(--ink); color: var(--sail); }
.read-more { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 700; color: var(--flag-dark); text-decoration: none; }
.read-more:hover { gap: .65rem; color: var(--flag); }
.read-more .icon { transition: transform .15s; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--flag-dark); text-decoration: underline; cursor: pointer; }

/* ---------- 4. Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--sail); }
.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--sail); text-decoration: none; font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; line-height: 1; }
.brand:hover { color: var(--foam); }
.site-nav ul { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .6rem .85rem; color: var(--sail); text-decoration: none; font-weight: 700; border-radius: var(--radius-s); }
.site-nav a:hover { background: var(--ink-2); color: var(--foam); }
.site-nav a[aria-current="page"] { color: var(--brass); }
.site-nav .nav-guide { background: var(--brass); color: var(--ink); margin-left: .4rem; }
.site-nav .nav-guide:hover, .site-nav .nav-guide[aria-current="page"] { background: var(--sail); color: var(--ink); }
.flag-strip { height: 8px; background: repeating-linear-gradient(90deg, var(--flag) 0 48px, var(--sail) 48px 96px, var(--brass) 96px 144px, var(--kelp) 144px 192px, var(--ink-2) 192px 240px); }
.nav-toggle { display: none; background: none; border: 2px solid rgba(244,239,226,.4); border-radius: var(--radius-s); width: 48px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { position: absolute; left: 50%; width: 22px; height: 2.5px; background: var(--sail); transform: translateX(-50%); content: ""; transition: transform .2s; }
.nav-toggle-bars { top: 50%; margin-top: -1px; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateX(-50%) translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateX(-50%) translateY(-7px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero { position: relative; background: var(--ink); color: var(--sail); overflow: hidden; padding: clamp(2.75rem, 6vw, 5rem) 0 0; isolation: isolate; }
.hero::before { content: ""; position: absolute; right: -10%; top: -20%; width: 70%; height: 120%; z-index: -1; background: radial-gradient(closest-side, rgba(62,142,143,.35), transparent 70%); }
.hero-chart { position: absolute; inset: 0; opacity: .12; pointer-events: none; z-index: -1;
  background-image: linear-gradient(var(--sail) 1px, transparent 1px), linear-gradient(90deg, var(--sail) 1px, transparent 1px); background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 25%, transparent 80%); mask-image: radial-gradient(ellipse at 70% 40%, #000 25%, transparent 80%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.hero-copy { padding-bottom: 4.5rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; padding: .45rem .95rem .45rem .75rem; border: 1px solid rgba(217,164,65,.5); border-radius: 999px; color: var(--brass); font-weight: 700; font-size: .95rem; background: rgba(217,164,65,.08); }
.hero-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 4px rgba(217,164,65,.2); flex: none; }
.hero h1 { color: var(--foam); max-width: 15ch; font-size: clamp(2.5rem, 5.6vw, 4.8rem); line-height: .98; }
.hero-lede { font-size: 1.2rem; max-width: 50ch; color: #D4DEE3; margin-top: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.9rem 0 2.25rem; }
.hero-facts { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; row-gap: 1rem; }
.hero-facts li { padding: 0 1.75rem; border-left: 1px solid rgba(244,239,226,.2); }
.hero-facts li:first-child { padding-left: 0; border-left: 0; }
.hero-facts strong { display: block; font-family: var(--font-display); font-size: 2.1rem; color: var(--sail); line-height: 1; }
.hero-facts span { color: #B7C7D0; font-size: .95rem; }
.hero-stage { position: relative; padding-bottom: 3.5rem; }
.ship-picker { display: flex; gap: .4rem; justify-content: center; margin-bottom: .75rem; flex-wrap: wrap; }
.ship-pick { font: 700 1rem var(--font-body); color: var(--sail); background: rgba(244,239,226,.06); border: 1px solid rgba(244,239,226,.3); border-radius: 999px; padding: .5rem 1.1rem; min-height: 44px; cursor: pointer; }
.ship-pick:hover { background: rgba(244,239,226,.14); }
.ship-pick.is-active { background: var(--sail); color: var(--ink); border-color: var(--sail); }
.hero-ship { width: 100%; height: auto; overflow: hidden; }
.hs { opacity: 0; transition: opacity .35s ease; }
.hs.is-shown { opacity: 1; }
.ship-bob { animation: bob 5s ease-in-out infinite; transform-origin: 260px 300px; transform-box: view-box; }
.gull { animation: glide 9s ease-in-out infinite; }
.wv1 { animation: drift 6s linear infinite; }
.wv2 { animation: drift 9s linear infinite reverse; }
.ship-caption { text-align: center; color: var(--on-dark); margin: .25rem auto 0; max-width: 42ch; min-height: 3.2em; }
.ship-caption strong { color: var(--brass); }
.hero-sea { display: block; width: 100%; height: clamp(50px, 7vw, 110px); margin-top: -3rem; margin-bottom: -2px; position: relative; }
.sea-back { animation: swell 8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(8px) rotate(1.2deg); } }
@keyframes glide { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-8px); } }
@keyframes swell { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-40px); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(60px); } }

/* ---------- 6. Sections ---------- */
.section { padding: var(--section-y) 0; }
.section-alt { background: var(--paper-2); }
.section-kelp { background: var(--kelp); color: var(--sail); }
.section-ink { background: var(--ink); color: var(--sail); }
.section-ink h2, .section-kelp h2 { color: var(--foam); }
.section-about { padding-top: clamp(2.5rem, 6vw, 4rem); }
.section-head { max-width: 64ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.section-ink .section-head p, .section-kelp .section-head p, .section-kelp p, .section-ink p { color: var(--on-dark); }
.section-kelp p { color: #D3E5E0; }
.section-head .btn { margin-top: 1.5rem; }
.section-head-center { text-align: center; margin-inline: auto; }
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; }
.section-head-row > div { max-width: 64ch; }
.section-head-row h2 { margin-bottom: .3em; }
.kicker { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--flag-dark); margin: 0 0 .75rem !important; font-size: 1rem !important; }
.kicker::before { content: ""; width: 18px; height: 12px; background: linear-gradient(90deg, var(--flag) 50%, var(--brass) 50%); border-radius: 2px; flex: none; }
.section-ink .kicker, .section-kelp .kicker, .page-hero .kicker { color: var(--brass); }
.lead { font-size: 1.3rem; font-weight: 700; line-height: 1.45; color: var(--ink); }
.split { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split > div > p:not(.lead):not(.kicker) { color: var(--muted); max-width: 62ch; }
.split-media { grid-template-columns: 1fr 1fr; align-items: center; }
.section-kelp .split > div > p:not(.kicker) { color: #D3E5E0; }
.section-ink .split > div > p:not(.kicker) { color: var(--on-dark); }
.panel { background: var(--foam); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: var(--shadow); color: var(--ink); }
.panel p { color: var(--muted); }
.media-frame { margin: 0; border-radius: var(--radius-l); overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.2); border: 4px solid rgba(244,239,226,.25); }
.media-frame img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* About glance */
.glance h3 { font-size: 1.6rem; }
.glance dl, .dl-meta { margin: 0; }
.glance dl div, .dl-meta div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.glance dl div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; text-align: right; }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature { background: var(--foam); border-radius: var(--radius-m); padding: 1.75rem; border-top: 4px solid var(--ink); box-shadow: var(--shadow); }
.feature svg { width: 48px; height: 48px; color: var(--flag); margin-bottom: 1rem; }
.feature p { color: var(--muted); margin: 0; }

/* Benefits */
.benefit-list { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1.25rem; }
.benefit-list li { display: flex; gap: 1rem; align-items: flex-start; }
.benefit-list .icon { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--brass); color: var(--ink); }
.benefit-list h3 { font-size: 1.35rem; margin-bottom: .15em; }
.benefit-list p { margin: 0; }
.benefit-list-light .icon { background: var(--kelp); color: var(--foam); }
.benefit-list-light p { color: var(--muted); }

/* How it works / download */
.download-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.9rem 4.25rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -.15rem; width: 2.9rem; height: 2.9rem; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; background: var(--ink); color: var(--brass); border-radius: 50%; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.4rem; top: 3rem; bottom: .25rem; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 12px); }
.steps h3 { margin-bottom: .25em; }
.steps p { color: var(--muted); margin: 0; }
.download-card { position: sticky; top: calc(var(--header-h) + 24px); background: var(--foam); border: 2px solid var(--ink); border-radius: var(--radius-l); padding: 2rem; box-shadow: 8px 8px 0 var(--ink); }
.download-card .logo-mark { margin-bottom: 1rem; }
.download-card h3 { font-size: 2rem; }
.dl-meta { margin-bottom: 1.5rem; }
.dl-note, .dl-req { font-size: .92rem; color: var(--muted); margin: 1rem 0 0; }
.dl-req { display: flex; gap: .5rem; align-items: flex-start; color: var(--kelp); font-weight: 700; }

/* Why choose */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2.5rem; }
.why { border: 1px solid rgba(244,239,226,.2); border-radius: var(--radius-m); padding: 1.75rem; background: rgba(244,239,226,.04); }
.why h3 { color: var(--brass); }
.why p { margin: 0; }
.why-grid-light .why { background: var(--foam); border-color: var(--line); box-shadow: var(--shadow); }
.why-grid-light .why h3 { color: var(--flag-dark); }
.why-grid-light .why p { color: var(--muted); }

/* Tables */
.table-scroll { overflow-x: auto; border-radius: var(--radius-m); border: 2px solid var(--ink); background: var(--foam); -webkit-overflow-scrolling: touch; }
.section-ink .table-scroll { border-color: var(--foam); }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; color: var(--ink); }
.data-table th, .data-table td { text-align: left; padding: .95rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--ink); color: var(--sail); font-family: var(--font-display); font-size: 1.2rem; }
.data-table tbody th { font-family: var(--font-display); font-size: 1.3rem; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tr.is-us { background: #FBF3E1; }
.data-table tr.is-us th { color: var(--flag-dark); }

/* Stats */
.stats { background: var(--brass); color: var(--ink); padding: clamp(2.5rem, 6vw, 4rem) 0; position: relative; }
.stat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stat-list li { padding: .5rem 1rem; border-left: 2px solid rgba(20,48,74,.18); }
.stat-list li:first-child { border-left: 0; }
.stat-list strong { display: block; font-family: var(--font-display); font-weight: 900; font-size: clamp(3rem, 7vw, 5rem); line-height: 1; }
.stat-list span { font-weight: 700; font-size: 1.05rem; }

/* Testimonials */
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.quote { margin: 0; background: var(--foam); border-radius: var(--radius-l); padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; border-bottom: 5px solid var(--kelp); }
.quote-mark { width: 40px; color: var(--brass); margin-bottom: 1rem; }
.quote blockquote { margin: 0 0 1.5rem; flex: 1; }
.quote blockquote p { font-size: 1.12rem; margin: 0; }
.quote figcaption strong { display: block; font-family: var(--font-display); font-size: 1.3rem; }
.quote figcaption span { color: var(--muted); font-size: .95rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery-item { margin: 0; position: relative; }
.gallery-item.is-wide { grid-column: span 2; grid-row: span 2; }
.gallery-open { display: block; width: 100%; padding: 0; border: 0; background: var(--ink); border-radius: var(--radius-m); overflow: hidden; cursor: zoom-in; position: relative; }
.gallery-open img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .35s ease; }
.gallery-item.is-wide .gallery-open, .gallery-item.is-wide .gallery-open img { height: 100%; }
.gallery-open:hover img, .gallery-open:focus-visible img { transform: scale(1.04); }
.gallery-zoom { position: absolute; right: .75rem; top: .75rem; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(20,48,74,.75); color: var(--foam); border-radius: 50%; }
.gallery-item figcaption { position: absolute; left: .75rem; bottom: .75rem; background: var(--foam); color: var(--ink); font-weight: 700; padding: .3rem .8rem; border-radius: 999px; font-size: .95rem; pointer-events: none; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); width: 100%; overflow: visible; }
.lightbox::backdrop { background: rgba(10,22,34,.88); }
.lightbox img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: var(--radius-m); background: var(--ink); }
.lightbox-caption { color: var(--sail); text-align: center; margin: 1rem 0 0; }
.lightbox-close { position: absolute; top: -56px; right: 0; width: 48px; height: 48px; display: grid; place-items: center; background: var(--foam); color: var(--ink); border: 0; border-radius: 50%; cursor: pointer; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.faq-list { border-top: 2px solid var(--ink); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.15rem 3rem 1.15rem 0; position: relative; font-weight: 700; font-size: 1.12rem; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 2px solid var(--line); border-radius: 50%; background: linear-gradient(var(--flag), var(--flag)) center / 14px 2.5px no-repeat, linear-gradient(var(--flag), var(--flag)) center / 2.5px 14px no-repeat; transition: transform .2s, background-color .2s; }
.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); background-color: var(--paper-2); }
.faq summary:hover { color: var(--flag-dark); }
.faq-a p { color: var(--muted); padding-bottom: 1.2rem; margin: 0; max-width: 68ch; }
.faq-groups { min-width: 0; }
.faq-group + .faq-group { margin-top: 2.75rem; }
.faq-group h2 { font-size: 2rem; }

/* CTA band */
.cta-band { background: var(--flag); color: var(--foam); padding: clamp(3rem, 7vw, 4.75rem) 0; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(90deg, var(--ink) 0 48px, var(--sail) 48px 96px, var(--brass) 96px 144px); }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-inner h2 { max-width: 18ch; color: var(--foam); }
.cta-inner p { margin: 0; max-width: 52ch; color: #FBE3E0; }
.cta-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.cta-band .btn-ghost { border-color: rgba(255,255,255,.75); color: var(--foam); }
.cta-band .btn-ghost:hover { background: var(--foam); color: var(--flag-dark); }

/* ---------- 7. Blog cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.card-post { display: flex; flex-direction: column; background: var(--foam); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card-post:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,48,74,.06), 0 16px 36px rgba(20,48,74,.14); }
.card-post-img { display: block; background: var(--ink); overflow: hidden; }
.card-post-img img { width: 100%; aspect-ratio: 1200/630; object-fit: cover; transition: transform .35s; }
.card-post:hover .card-post-img img { transform: scale(1.03); }
.card-post-body { padding: 1.4rem 1.5rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.card-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; font-size: .9rem; color: var(--muted); margin: 0 0 .7rem; }
.tag { display: inline-block; background: var(--paper-2); color: var(--kelp); font-weight: 700; padding: .15rem .65rem; border-radius: 999px; font-size: .85rem; }
.tag-new { background: var(--flag); color: var(--foam); }
.card-post-title { font-size: 1.5rem; margin-bottom: .45em; }
.card-post-title a { color: var(--ink); text-decoration: none; }
.card-post-title a:hover { color: var(--flag); }
.card-post-excerpt { color: var(--muted); margin: 0 0 .75rem; flex: 1; }
.featured-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.75rem; margin-bottom: 1.75rem; }
.featured-post { display: grid; grid-template-columns: 1.1fr .9fr; }
.featured-post .card-post-img { display: flex; align-items: center; background: #0C1C2C; }
.featured-post .card-post-img img { object-fit: contain; }
.featured-post .card-post-body { padding: clamp(1.5rem, 4vw, 2.75rem); justify-content: center; }
.featured-post .card-post-title { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.featured-post .card-post-excerpt { flex: 0 0 auto; margin-bottom: 1.5rem; font-size: 1.1rem; }
.featured-post .btn { align-self: flex-start; }
.empty-state { padding: 2rem; border: 2px dashed var(--line); border-radius: var(--radius-m); text-align: center; color: var(--muted); margin-top: 1.5rem; }

/* ---------- 8. Inner pages ---------- */
.page-hero { background: var(--ink); color: var(--sail); padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.75rem); position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none; background-image: linear-gradient(var(--sail) 1px, transparent 1px), linear-gradient(90deg, var(--sail) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: var(--foam); margin-bottom: .3em; max-width: 20ch; }
.page-lede { color: var(--on-dark); max-width: 60ch; font-size: 1.15rem; margin: 0; }
.page-hero a { color: var(--brass); }
.page-hero .btn-flag { color: var(--foam); }
.page-hero .btn-ghost { color: var(--sail); }
.page-hero-404 { text-align: center; padding: 5rem 0; }
.page-hero-404 h1, .page-hero-404 .page-lede { margin-inline: auto; }
.page-hero-404 .hero-actions { justify-content: center; }
.big-404 { font-family: var(--font-display); font-weight: 900; font-size: clamp(6rem, 18vw, 11rem); line-height: .9; color: var(--brass); margin: 0; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .95rem; color: #A9BBC6; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin: 0 .4rem; opacity: .6; }
.crumbs a { color: var(--brass); display: inline-block; padding: .55rem .15rem; min-height: 44px; line-height: 1.8; }
.crumbs span { padding: .55rem 0; }
.guide-tools { margin-top: 1.75rem; }
.search-box { display: flex; align-items: center; gap: .6rem; max-width: 480px; background: var(--foam); color: var(--muted); border-radius: var(--radius-s); padding: 0 1rem; min-height: 52px; }
.search-box input { flex: 1; border: 0; background: transparent; font: inherit; padding: .85rem 0; color: var(--ink); min-width: 0; }
.search-box input:focus { outline: none; }
.search-box:focus-within { outline: 3px solid var(--brass); outline-offset: 2px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1.1rem; font: 700 1rem var(--font-body); color: var(--ink); background: var(--foam); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip span { background: var(--paper-2); border-radius: 999px; padding: 0 .5rem; font-size: .85rem; }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--foam); border-color: var(--ink); }
.chip.is-active span { background: var(--brass); color: var(--ink); }

/* Article */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: var(--flag); transform: scaleX(0); transform-origin: 0 50%; }
.article-head { padding: clamp(1.75rem, 4vw, 2.75rem) 0 1.75rem; }
.article-head .crumbs ol { color: var(--muted); }
.article-head .crumbs a { color: var(--flag-dark); }
.article-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 22ch; }
.article-lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; margin: 0; }
.article-figure { margin-top: 0; margin-bottom: clamp(2rem, 5vw, 3rem); }
.article-figure img { width: 100%; border-radius: var(--radius-l); box-shadow: var(--shadow); }
.article-layout, .doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(3rem, 7vw, 5rem); align-items: start; }
.doc-layout { padding-bottom: 0; }
.article-side { position: sticky; top: calc(var(--header-h) + 24px); }
.side-title { font-size: 1.4rem; border-bottom: 3px solid var(--ink); padding-bottom: .4rem; }
.toc ol { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: block; padding: .6rem .25rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem; border-left: 3px solid transparent; padding-left: .6rem; }
.toc a:hover, .toc a.is-active { color: var(--flag-dark); border-left-color: var(--flag); background: rgba(200,55,45,.05); }
.prose { max-width: 72ch; font-size: 1.1rem; min-width: 0; }
.prose h2 { font-size: 2.05rem; margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1rem; display: block; overflow-x: auto; background: var(--foam); border-radius: var(--radius-m); }
.prose th, .prose td { text-align: left; padding: .75rem .95rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--ink); color: var(--sail); }
.doc-updated { color: var(--muted); font-size: .95rem; background: var(--paper-2); display: inline-block; padding: .3rem .8rem; border-radius: 999px; }
.takeaways { background: var(--foam); border-radius: var(--radius-m); padding: 1.5rem 1.75rem; border-left: 6px solid var(--kelp); box-shadow: var(--shadow); margin-bottom: 2.25rem; }
.takeaways-title { font-size: 1.5rem !important; margin: 0 0 .75rem !important; }
.takeaways ul { list-style: none; padding: 0; margin: 0; }
.takeaways li { display: flex; gap: .6rem; align-items: flex-start; }
.takeaways .icon { color: var(--kelp); margin-top: .3rem; }
.article-cta { margin-top: 2.5rem; padding: 1.5rem 1.75rem; background: var(--ink); color: var(--sail); border-radius: var(--radius-m); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.article-cta p { margin: 0; color: var(--on-dark); }
.article-cta .article-cta-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--foam); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.post-nav-link { display: block; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--foam); text-decoration: none; color: var(--ink); }
.post-nav-link span { display: block; font-size: .9rem; color: var(--muted); }
.post-nav-link strong { font-family: var(--font-display); font-size: 1.35rem; }
.post-nav-link:hover { border-color: var(--flag); color: var(--flag-dark); }
.post-nav-link.is-next { text-align: right; grid-column: 2; }
.side-cta { margin-top: .5rem; }

/* Contact */
.contact-split { grid-template-columns: .9fr 1.1fr; align-items: center; }
.contact-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .9rem; }
.contact-points li { display: flex; gap: .75rem; align-items: center; }
.contact-points .icon { color: var(--brass); }
.contact-points a { color: var(--sail); }
.contact-page { display: grid; grid-template-columns: 1.3fr .7fr; gap: 2rem; align-items: start; }
.contact-page .form-panel h2 { font-size: 2rem; }
.contact-cards { display: grid; gap: 1rem; }
.info-card { background: var(--foam); border-radius: var(--radius-m); padding: 1.35rem 1.5rem; border: 1px solid var(--line); }
.info-card .icon { color: var(--flag); margin-bottom: .6rem; }
.info-card h3 { font-size: 1.3rem; margin-bottom: .2em; }
.info-card p { margin: 0; color: var(--muted); }
.contact-form { display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .4rem; font-weight: 700; color: var(--ink); }
.field input, .field textarea, .field select { width: 100%; font: inherit; font-weight: 400; padding: .8rem .95rem; min-height: 50px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--foam); color: var(--ink); }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(217,164,65,.35); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--flag); }
.contact-form .btn { justify-self: start; }
.form-note { font-size: .9rem; color: var(--muted); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--radius-s); margin-bottom: 1rem; color: var(--ink); }
.notice p { margin: 0; color: var(--ink) !important; }
.notice ul { margin: 0; padding-left: 1.1rem; }
.notice-ok { background: #D7EDE4; border-left: 5px solid var(--kelp); }
.notice-error { background: #F6DEDB; border-left: 5px solid var(--flag); }

/* ---------- 9. Footer ---------- */
.site-footer { background: var(--ink-3); color: #BFCDD6; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; padding: 4rem 0 3rem; }
.footer-brand p { margin: 1rem 0; max-width: 40ch; font-size: .98rem; }
.footer-gh { display: inline-flex; align-items: center; gap: .5rem; color: var(--brass); font-weight: 700; text-decoration: none; min-height: 44px; }
.footer-gh:hover { color: var(--sail); }
.footer-title { font-size: 1.35rem; color: var(--sail); margin-bottom: .75rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-block; color: #BFCDD6; text-decoration: none; padding: .35rem 0; }
.footer-links a:hover { color: var(--brass); text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(191,205,214,.16); padding: 1.25rem 0; font-size: .95rem; }
.footer-bottom-row { display: flex; justify-content: space-between; gap: .5rem 2rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--brass); font-weight: 700; }
.footer-legal { color: #8FA3B1; }

/* ---------- 10. Responsive ---------- */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-row { grid-template-columns: 1fr 1fr; }
  .featured-post { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); border-top: 1px solid var(--ink-2); box-shadow: 0 16px 30px rgba(0,0,0,.25); display: none; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1.25rem; gap: 0; }
  .site-nav a { padding: .9rem .5rem; border-bottom: 1px solid var(--ink-2); border-radius: 0; }
  .site-nav .nav-guide { margin: .9rem 0 0; border-radius: var(--radius-s); text-align: center; border: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 1rem; }
  .hero h1 { max-width: 18ch; }
  .hero-copy { padding-bottom: 1rem; }
  .hero-stage { max-width: 540px; margin: 0 auto; width: 100%; padding-bottom: 2.5rem; }
  .split, .split-media, .faq-wrap, .download-grid, .contact-split, .contact-page { grid-template-columns: 1fr; }
  .split-media .media-frame { order: -1; }
  .download-card { position: static; }
  .feature-grid, .why-grid, .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-grid .quote:last-child { grid-column: span 2; }
  .stat-list { grid-template-columns: repeat(2, 1fr); row-gap: 1.5rem; }
  .stat-list li:nth-child(3) { border-left: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.is-wide { grid-row: auto; }
  .gallery-item:last-child { grid-column: span 2; }
  .gallery-item:last-child .gallery-open img { aspect-ratio: 16/9; }
  .featured-row { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .article-layout, .doc-layout { grid-template-columns: 1fr; }
  .article-side { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: .5rem; }
  .toc li { border: 0; }
  .toc a { border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; background: var(--foam); font-size: .92rem; }
  .side-cta { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .wrap { width: min(100% - 2rem, var(--wrap)); }
  .brand { font-size: 1.35rem; }
  .brand .logo-mark { width: 32px; height: 32px; }
  .hero-actions .btn, .cta-actions .btn { flex: 1 1 100%; }
  .hero-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; }
  .hero-facts li { padding: 0 .9rem; }
  .hero-facts strong { font-size: 1.6rem; }
  .hero-facts span { font-size: .85rem; }
  .ship-picker { flex-wrap: nowrap; }
  .ship-pick { padding: .45rem .75rem; font-size: .92rem; }
  .feature-grid, .why-grid, .quote-grid, .card-grid, .footer-grid, .field-row, .post-nav { grid-template-columns: 1fr; }
  .quote-grid .quote:last-child { grid-column: auto; }
  .post-nav-link.is-next { grid-column: auto; }
  .gallery { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .gallery-item.is-wide { grid-column: span 2; grid-row: auto; }
  .gallery-item figcaption { font-size: .82rem; left: .5rem; bottom: .5rem; }
  .gallery-zoom { display: none; }
  .steps li { padding-left: 3.6rem; }
  .download-card { box-shadow: 5px 5px 0 var(--ink); padding: 1.5rem; }
  .contact-form .btn { justify-self: stretch; }
  .lightbox-close { top: -54px; }
}

/* ---------- 11. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
