/* ============================================
   John-Mark Taika Ambrose - Author Website
   Dark cinematic military-history theme
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #0a0a0a;
  --color-bg-alt: #111111;
  --color-bg-card: #141414;
  --color-surface: #1a1a1a;
  --color-primary: #c4302b;
  --color-primary-light: #e04038;
  --color-primary-dim: #8b2220;
  --color-accent: #4a90d9;
  --color-accent-light: #6aabef;
  --color-text: #c8c8c8;
  --color-text-muted: #707070;
  --color-text-bright: #e8e8e8;
  --color-border: #2a2a2a;
  --font-heading: 'Archivo Black', Impact, sans-serif;
  --font-body: 'Hind', 'Segoe UI', Tahoma, sans-serif;
  --max-width: 1100px;
  --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Noise / Grain Texture Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-bright);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }

p {
  margin-bottom: 1.2em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-light);
}

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

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }

.separator {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border: none;
  margin: 1.5rem auto;
}

.separator--left {
  margin-left: 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 48, 43, 0.2);
  transition: background var(--transition);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-bright);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav__brand span {
  color: var(--color-primary);
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav__links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  padding: 0.25rem 0;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--color-primary);
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav__hamburger span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
  border-radius: 1px;
}

.nav__hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center bottom, rgba(196, 48, 43, 0.06) 0%, transparent 70%),
              linear-gradient(180deg, var(--color-bg) 0%, rgba(10, 10, 10, 0.95) 50%, var(--color-bg) 100%);
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: var(--max-width);
  width: 100%;
}

.hero__book {
  flex-shrink: 0;
  width: 320px;
}

.hero__book-cover {
  width: 100%;
  border-radius: 4px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(196, 48, 43, 0.1);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero__book-cover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(196, 48, 43, 0.15);
}

.hero__text {
  flex: 1;
}

.hero__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-primary-dim);
  border-radius: 2px;
}

.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: var(--color-text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--color-primary);
  font-style: normal;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.hero__description {
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.btn--primary:hover {
  background: var(--color-primary-light);
  color: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 48, 43, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary-dim);
}

.btn--outline:hover {
  background: rgba(196, 48, 43, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary-light);
  transform: translateY(-2px);
}

/* --- Author Message / Blog Section --- */
.message {
  position: relative;
}

.message__card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  padding: 3rem;
  border-radius: 4px;
  position: relative;
}

.message__card::before {
  content: '\201C';
  font-family: var(--font-heading);
  font-size: 6rem;
  color: var(--color-primary-dim);
  opacity: 0.3;
  position: absolute;
  top: -10px;
  left: 20px;
  line-height: 1;
}

.message__text {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--color-text);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.message__attribution {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-primary);
  font-style: normal;
  font-weight: 600;
}

.message__attribution span {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* --- Book Details Section --- */
.book-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.book-details__info h2 {
  margin-bottom: 0.5rem;
}

.book-details__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.book-details__meta-item {
  font-size: 0.85rem;
}

.book-details__meta-item strong {
  display: block;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.book-details__description {
  font-size: 1.05rem;
  line-height: 1.85;
}

.book-details__features {
  list-style: none;
  margin-top: 1.5rem;
}

.book-details__features li {
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--color-text);
  border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

.book-details__features li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-size: 0.8rem;
}

/* --- Bio Page --- */
.bio-hero {
  padding: 8rem 0 4rem;
  text-align: center;
}

.bio-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
}

.bio-portrait {
  position: sticky;
  top: 5rem;
}

.bio-portrait__img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  filter: contrast(1.05);
}

.bio-portrait__caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.bio-text h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
}

.bio-text h3:first-child {
  margin-top: 0;
}

.bio-text p {
  font-size: 1.05rem;
  line-height: 1.9;
}

.bio-text blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--color-primary);
  background: rgba(196, 48, 43, 0.04);
  font-style: italic;
  color: var(--color-text);
  border-radius: 0 4px 4px 0;
}

/* --- Newsletter Page --- */
.newsletter-section {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 6rem 0;
}

.newsletter__inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter__icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.newsletter__form {
  margin-top: 2.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-bright);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(196, 48, 43, 0.2);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
}

.newsletter__submit {
  width: 100%;
  margin-top: 0.5rem;
}

.newsletter__note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* --- Footer --- */
.footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  text-align: center;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer__name {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-bright);
  margin-bottom: 0.5rem;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer__links a:hover {
  color: var(--color-primary);
}

/* --- Success Page Styles --- */
.success-section {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
}

.success-section h1 {
  margin-bottom: 1rem;
}

.success-section p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--color-primary-light);
  transform: translateY(-3px);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero__content {
    flex-direction: column;
    text-align: center;
  }

  .hero__book {
    width: 250px;
    order: -1;
  }

  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .book-details {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .bio-content {
    grid-template-columns: 1fr;
  }

  .bio-portrait {
    position: static;
    max-width: 280px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
  }

  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__hamburger {
    display: flex;
  }

  .section {
    padding: 3.5rem 0;
  }

  .message__card {
    padding: 2rem 1.5rem;
  }

  .hero {
    min-height: auto;
    padding: 7rem 1.5rem 3rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .hero__book {
    width: 200px;
  }

  .hero__cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- Page transition fade-in --- */
.page-enter {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Map line decoration --- */
.topographic-line {
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(196, 48, 43, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.topographic-line:nth-child(1) {
  top: 10%;
  right: -100px;
  width: 400px;
  height: 400px;
}

.topographic-line:nth-child(2) {
  top: 12%;
  right: -50px;
  width: 350px;
  height: 350px;
}

.topographic-line:nth-child(3) {
  top: 14%;
  right: 0;
}
