/* =========================================================
   AncientSailor.com — site.css
   Mythic nautical manga editorial style
   Dark, readable, mobile-friendly, no white-on-white
   ========================================================= */

:root {
  --bg: #07111f;
  --bg-2: #0d1b2f;
  --bg-3: #12243d;
  --panel: #10223a;
  --panel-2: #172f4f;
  --ink: #f5ead2;
  --ink-soft: #d9c9a7;
  --muted: #aab8c5;
  --gold: #d8a84f;
  --gold-2: #f0c66b;
  --bronze: #a96f3a;
  --sea: #1f6f8b;
  --sea-bright: #4db5d8;
  --danger: #d9684a;
  --line: rgba(245, 234, 210, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1180px;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(77, 181, 216, 0.16), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(216, 168, 79, 0.12), transparent 28%),
    linear-gradient(180deg, #06101d 0%, #07111f 48%, #03070d 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 234, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 234, 210, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 80%);
  z-index: -1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-2);
  text-decoration: none;
}

a:hover,
a:focus {
  color: #fff3c4;
  text-decoration: underline;
}

p {
  margin: 0 0 1rem;
}

strong {
  color: #fff3c4;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 82px 0;
}

.section.tight {
  padding: 48px 0;
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--ink);
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(3rem, 8vw, 7.6rem);
  max-width: 980px;
}

h2 {
  font-size: clamp(2.15rem, 5vw, 4.5rem);
}

h3 {
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.lead {
  font-size: clamp(1.12rem, 2.2vw, 1.45rem);
  color: var(--ink-soft);
  max-width: 780px;
}

.kicker {
  color: var(--muted);
  max-width: 760px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 17, 31, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(var(--max), calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: #fff3c4;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 198, 107, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(240, 198, 107, 0.42), transparent 30%),
    linear-gradient(145deg, #132946, #07111f);
  box-shadow: 0 0 24px rgba(216, 168, 79, 0.2);
}

.logo-mark::before {
  content: "☸";
  color: var(--gold-2);
  font-size: 1.2rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.main-nav a {
  color: var(--ink-soft);
  padding: 0.72rem 0.85rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.94rem;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
  color: #07111f;
  background: var(--gold-2);
  text-decoration: none;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  width: 46px;
  height: 46px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(245, 234, 210, 0.08);
  position: relative;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  content: "";
}

.nav-toggle-label span {
  top: 22px;
}

.nav-toggle-label span::before {
  top: -7px;
  left: 0;
}

.nav-toggle-label span::after {
  top: 7px;
  left: 0;
}

/* ---------- Hero ---------- */

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  align-items: center;
  position: relative;
  padding: 86px 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.96) 0%, rgba(7, 17, 31, 0.76) 48%, rgba(7, 17, 31, 0.48) 100%),
    radial-gradient(circle at 75% 38%, rgba(31, 111, 139, 0.46), transparent 32%),
    radial-gradient(circle at 78% 70%, rgba(216, 168, 79, 0.22), transparent 28%);
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  right: -8vw;
  bottom: -15vw;
  width: min(780px, 75vw);
  height: min(780px, 75vw);
  border: 1px solid rgba(240, 198, 107, 0.2);
  border-radius: 50%;
  background:
    conic-gradient(from 20deg, transparent, rgba(240, 198, 107, 0.12), transparent 30%),
    radial-gradient(circle, transparent 47%, rgba(245, 234, 210, 0.08) 48%, transparent 50%);
  opacity: 0.9;
  z-index: -1;
}

.hero-content {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero p {
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  color: var(--ink-soft);
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.82rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(240, 198, 107, 0.55);
  background: var(--gold-2);
  color: #07111f;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(216, 168, 79, 0.22);
}

.btn:hover,
.btn:focus {
  color: #07111f;
  background: #ffe39a;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn.secondary {
  background: rgba(245, 234, 210, 0.08);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.btn.secondary:hover,
.btn.secondary:focus {
  background: rgba(245, 234, 210, 0.16);
  color: #fff3c4;
}

/* ---------- Cards / Grids ---------- */

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(23, 47, 79, 0.92), rgba(10, 25, 44, 0.92)),
    radial-gradient(circle at 85% 0%, rgba(216, 168, 79, 0.15), transparent 35%);
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 243, 196, 0.18);
  pointer-events: none;
}

.card h3 {
  color: #fff3c4;
}

.card p {
  color: var(--ink-soft);
}

.card .tag {
  display: inline-flex;
  margin-bottom: 0.9rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(77, 181, 216, 0.14);
  color: #bfeeff;
  border: 1px solid rgba(77, 181, 216, 0.28);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-link {
  display: inline-flex;
  margin-top: 0.8rem;
  font-weight: 850;
}

/* ---------- Feature Panels ---------- */

.feature {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.feature-panel {
  min-height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 20, 35, 0.18), rgba(8, 20, 35, 0.86)),
    radial-gradient(circle at 50% 20%, rgba(77, 181, 216, 0.32), transparent 34%),
    linear-gradient(145deg, #173150, #07111f);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.feature-panel::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(240, 198, 107, 0.28);
  border-radius: 50%;
}

.feature-panel::after {
  content: "Ancient Sailor";
  position: absolute;
  left: 1.3rem;
  bottom: 1.2rem;
  color: rgba(245, 234, 210, 0.18);
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.9;
}

/* ---------- Episode Cards ---------- */

.episode-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.episode-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(216, 168, 79, 0.16);
  border: 1px solid rgba(240, 198, 107, 0.42);
  color: var(--gold-2);
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 900;
}

/* ---------- Callout ---------- */

.callout {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid rgba(240, 198, 107, 0.32);
  background:
    linear-gradient(135deg, rgba(216, 168, 79, 0.16), rgba(31, 111, 139, 0.14)),
    linear-gradient(180deg, rgba(16, 34, 58, 0.98), rgba(8, 18, 32, 0.98));
  box-shadow: var(--shadow);
}

.callout h2 {
  color: #fff3c4;
}

/* ---------- Lists ---------- */

.clean-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}

.clean-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.clean-list li::before {
  content: "✦";
  color: var(--gold-2);
  margin-right: 0.55rem;
}

/* ---------- Forms ---------- */

form {
  display: grid;
  gap: 1rem;
}

label {
  color: var(--ink-soft);
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(245, 234, 210, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 13, 0.55);
  color: var(--ink);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(240, 198, 107, 0.55);
  border-color: var(--gold-2);
}

textarea {
  min-height: 150px;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: rgba(16, 34, 58, 0.78);
}

th,
td {
  padding: 0.95rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: #fff3c4;
  background: rgba(216, 168, 79, 0.12);
}

td {
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 56px 0 36px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 0%, rgba(216, 168, 79, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.6), #03070d);
  color: var(--ink-soft);
}

.footer-grid {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.footer-brand {
  font-family: var(--font-head);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 900;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.footer-nav a {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  color: var(--ink-soft);
  border: 1px solid transparent;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: #fff3c4;
  border-color: var(--line);
  text-decoration: none;
}

.copyright {
  width: min(var(--max), calc(100% - 32px));
  margin: 2rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Utility ---------- */

.center {
  text-align: center;
}

.center .lead,
.center .kicker {
  margin-left: auto;
  margin-right: auto;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.muted {
  color: var(--muted);
}

.gold {
  color: var(--gold-2);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 2rem 0;
}

.rounded-img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 100;
  padding: 0.8rem 1rem;
  background: var(--gold-2);
  color: #07111f;
  border-radius: 999px;
  font-weight: 900;
}

.skip-link:focus {
  left: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    min-height: 320px;
  }
}

@media (max-width: 780px) {
  .nav-toggle-label {
    display: block;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    background: rgba(7, 17, 31, 0.98);
    box-shadow: var(--shadow);
  }

  .main-nav a {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: rgba(245, 234, 210, 0.055);
  }

  .nav-toggle:checked ~ .main-nav {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 72px 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .split {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .container,
  .nav-wrap,
  .hero-content,
  .footer-grid,
  .copyright {
    width: min(100% - 24px, var(--max));
  }

  .section {
    padding: 58px 0;
  }

  .card,
  .callout {
    border-radius: 18px;
  }

  .logo {
    font-size: 1.12rem;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
  }
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .site-footer,
  .hero-actions,
  .nav-toggle-label {
    display: none;
  }

  a {
    color: #111;
    text-decoration: underline;
  }

  .card,
  .callout {
    box-shadow: none;
    border-color: #999;
    background: #fff;
  }
}
