/* ═══════════════════════════════════════════════════════════════════════════
   NaughtyGnome — aviation-dark design system
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted) ────────────────────────────────────────────────── */
@font-face {
  font-family: 'BioRhyme';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/biorhyme-v21-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'BioRhyme';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/biorhyme-v21-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jost-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jost-v20-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jost-v20-latin-600.woff2') format('woff2');
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #122733;
  --bg-2: #1C3442;
  --bg-3: #16303f;
  --btn-hover: #396B87;
  --accent: #477F8F;
  --accent-bright: #6fb3c4;
  --text: #E1E4E5;
  --text-dim: #a7b4ba;
  --white: #FFFFFF;
  --overlay: rgba(0, 0, 0, 0.4);
  --font-head: 'BioRhyme', Georgia, serif;
  --font-body: 'Jost', 'Segoe UI', sans-serif;
  --radius: 14px;
  --pill: 999px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --header-h: 74px;
  --max-w: 1180px;
}

/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-bright); text-decoration: none; transition: color .2s; }
a:hover { color: var(--white); }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--white);
  line-height: 1.15;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
::selection { background: var(--accent); color: var(--white); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--bg-2); }
.section-kicker {
  display: inline-block;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: .8rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--bg-2);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .04em;
  padding: .8rem 2rem;
  border: 0;
  border-radius: var(--pill);
  cursor: pointer;
  transition: background .25s, transform .2s;
}
.btn:hover { background: var(--btn-hover); color: var(--white); transform: translateY(-2px); }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--btn-hover); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.btn--ghost:hover { background: var(--accent); }

/* ── Header / nav ───────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(18, 39, 51, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background .3s, box-shadow .3s;
}
.site-header.is-scrolled { background: rgba(14, 30, 40, 0.97); box-shadow: 0 4px 24px rgba(0,0,0,.4); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--white); }
.brand img { height: 48px; width: auto; }
.brand span {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.6rem); }
.nav a {
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .05em;
  padding: .3rem 0;
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: -2px;
  height: 2px;
  background: var(--accent-bright);
  transition: right .25s ease;
}
.nav a:hover, .nav a.is-active { color: var(--white); }
.nav a:hover::after, .nav a.is-active::after { right: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 26px; height: 3px;
  margin: 5px 0;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: var(--header-h); right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: min(320px, 82vw);
    height: calc(100vh - var(--header-h));
    padding: 1.5rem;
    background: var(--bg-2);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform .3s ease;
  }
  .nav.is-open { transform: translateX(0); }
  .nav a { display: block; width: 100%; padding: .8rem 0; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
  body.nav-locked { overflow: hidden; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 62vh;
  padding: calc(var(--header-h) + 3rem) 1rem 4rem;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* parallax feel on desktop */
}
@media (hover: none), (max-width: 860px) {
  .hero { background-attachment: scroll; } /* iOS/touch: fixed unsupported */
}
.hero::before { content: ''; position: absolute; inset: 0; background: var(--overlay); }
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero > .hero-inner { position: relative; z-index: 1; max-width: 880px; }
.hero--tall { min-height: 92vh; }
.hero--short { min-height: 44vh; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}
.hero .hero-logo {
  display: block;
  margin: 0 auto 1.2rem;
  width: 220px;
  height: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45));
}
@media (max-width: 640px) {
  .hero .hero-logo { width: 104px; }
}
.hero .tagline {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--white);
  font-weight: 500;
  margin: 0 0 1.2rem;
}
.hero .hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }

/* ── Cards / blog grid ──────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-3); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.3rem 1.4rem 1.5rem; }
.card-meta { font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); font-weight: 600; margin-bottom: .5rem; }
.card-meta .sep { opacity: .5; margin: 0 .4rem; }
.card h3 { margin-bottom: .5rem; }
.card h3 a { color: var(--white); }
.card h3 a:hover { color: var(--accent-bright); }
.card p { color: var(--text-dim); font-size: .98rem; margin: 0 0 1rem; }
.card .read-more { margin-top: auto; font-weight: 600; font-size: .92rem; letter-spacing: .05em; }

/* ── Feature rows (home) ────────────────────────────────────────────────── */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.feature--flip > :first-child { order: 2; }
.feature img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 780px) {
  .feature { grid-template-columns: 1fr; }
  .feature--flip > :first-child { order: 0; }
}

/* ── Prose (rendered post bodies & static page copy) ────────────────────── */
.prose { max-width: 760px; margin: 0 auto; }
.prose img { border-radius: var(--radius); margin: 1.4rem 0; box-shadow: var(--shadow); }
.prose figure { margin: 1.6rem 0; }
.prose figure img { margin: 0; }
.prose figcaption { font-size: .88rem; color: var(--text-dim); text-align: center; margin-top: .6rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.8rem; }
.prose blockquote {
  margin: 1.6rem 0;
  padding: .6rem 1.4rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-style: italic;
}
.prose pre {
  background: #0d1c26;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: .92rem;
}
.prose code { background: #0d1c26; padding: .15em .45em; border-radius: 6px; font-size: .92em; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: .98rem; }
.prose th, .prose td { padding: .65rem .9rem; border: 1px solid rgba(255, 255, 255, .12); text-align: left; }
.prose th { background: var(--bg-2); color: var(--white); }
.prose tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }
.prose details {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin: 1.4rem 0;
  border: 1px solid rgba(255, 255, 255, .08);
}
.prose details summary { cursor: pointer; font-weight: 600; color: var(--white); }
.prose details[open] summary { margin-bottom: .8rem; }
.prose iframe { max-width: 100%; border: 0; border-radius: var(--radius); }
.prose hr { border: 0; height: 1px; background: rgba(255, 255, 255, .12); margin: 2.5rem 0; }
.prose ul li, .prose ol li { margin-bottom: .35rem; }

/* Responsive video/map embeds */
.embed-responsive { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.6rem 0; }
.embed-responsive iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius); }

/* ── Post header ────────────────────────────────────────────────────────── */
.post-header { text-align: center; max-width: 820px; margin: 0 auto 2.5rem; }
.post-header .card-meta { justify-content: center; }
.post-hero-img { max-width: 980px; margin: 0 auto 2.5rem; }
.post-hero-img img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 3rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  padding: .55rem .9rem;
  border-radius: var(--pill);
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
}
.pagination a:hover { background: var(--btn-hover); color: var(--white); }
.pagination .current { background: var(--accent); color: var(--white); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form { max-width: 640px; margin: 0 auto; }
.form label { display: block; font-weight: 600; color: var(--white); margin-bottom: .4rem; }
.form input, .form textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .8rem 1rem;
  margin-bottom: 1.2rem;
  transition: border-color .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent-bright); }
.form .hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.flash { max-width: 640px; margin: 0 auto 1.6rem; padding: 1rem 1.3rem; border-radius: var(--radius); font-weight: 500; }
.flash--ok { background: rgba(71, 127, 143, .25); border: 1px solid var(--accent); color: var(--white); }
.flash--err { background: rgba(180, 60, 60, .2); border: 1px solid #b45050; color: #ffd7d7; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #0d1c26;
  padding: 3.5rem 0 2rem;
  margin-top: 0;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 720px) { .site-footer .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--white); }
.footer-brand img { height: 64px; margin-bottom: 1rem; }
.footer-brand p { color: var(--text-dim); font-size: .95rem; max-width: 340px; }
.social-links { display: flex; gap: .9rem; margin-top: 1rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-2);
  transition: background .25s, transform .2s;
}
.social-links a:hover { background: var(--btn-hover); transform: translateY(-3px); }
.social-links svg { width: 20px; height: 20px; fill: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: .9rem;
}

/* ── Scroll-reveal animations ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.reveal--left { transform: translateX(-40px); }
.reveal--right { transform: translateX(40px); }
.reveal--zoom { transform: scale(.92); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Hero entrance (plays on load, no observer needed) */
@keyframes hero-rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
.hero-inner > * { animation: hero-rise .8s ease both; }
.hero-inner > *:nth-child(2) { animation-delay: .15s; }
.hero-inner > *:nth-child(3) { animation-delay: .3s; }
.hero-inner > *:nth-child(4) { animation-delay: .45s; }

/* Gentle float for avatar art */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.float { animation: float 5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal--left, .reveal--right, .reveal--zoom { opacity: 1; transform: none; transition: none; }
  .hero-inner > * { animation: none; }
  .float { animation: none; }
  .card, .card-media img, .btn { transition: none; }
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.avatar-round { border-radius: 50%; }
main { min-height: 40vh; }
.page-body { padding-top: 0; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--white);
  padding: .6rem 1.2rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }
