/* ============================================
   In the Nic of Time — Premium Dark Stylesheet
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0a1628;
  --navy-mid: #132038;
  --dark-navy: #060e1a;
  --blue-border: #1a2d4a;
  --accent: #1e3a5f;
  --gold: #c9a84c;
  --gold-hover: #dbb95e;
  --deep-red: #8b1a1a;
  --white: #ffffff;
  --off-white: #e8eaed;
  --light-gray: #f3f4f6;
  --text: #444;
  --text-light: #666;
  --heading: #1a1a1a;
  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --transition: .25s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--heading); line-height: 1.3; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }

/* --- Header --- */
.site-header {
  background: var(--navy);
  border-bottom: 1px solid var(--blue-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
}
.site-logo img { height: 46px; width: auto; }
.site-logo { margin-right: 24px; flex-shrink: 0; }

/* --- Desktop Nav --- */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: rgba(255,255,255,.85);
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 16px;
  line-height: 64px;
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.07); color: var(--gold); }

/* --- Nav Auth --- */
.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.nav-auth .btn-sm { padding: 6px 14px; font-size: .78rem; }

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* --- Mobile Nav --- */
.mobile-nav {
  display: none;
  background: var(--navy-mid);
  padding: 16px 5%;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 0;
  border-bottom: 1px solid var(--blue-border);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mobile-nav a:last-child { border-bottom: none; }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--accent) 100%);
  color: var(--white);
  padding: clamp(70px, 12vw, 140px) 0;
  min-height: 440px;
  display: flex;
  align-items: center;
}
.hero-content { text-align: center; }
.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 1rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 700;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero .hero-subtitle {
  font-size: clamp(.9rem, 1.4vw, 1.1rem);
  color: var(--gold);
  font-weight: 500;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: .02em;
}

/* --- Section spacing --- */
section { padding: clamp(50px, 8vw, 90px) 0; }

.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 { margin-bottom: 12px; }
.section-title .accent-line {
  width: 50px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto;
  border-radius: 2px;
}

.section-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 12px;
}

/* --- Book Section --- */
.book-section {
  background: var(--navy);
  color: var(--white);
  padding: clamp(50px, 8vw, 80px) 0;
}
.book-inner { max-width: 750px; margin: 0 auto; text-align: center; }
.book-section h2 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 8px; }
.book-tagline {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--gold);
  font-style: italic;
  margin-bottom: 20px;
}
.book-section p { color: rgba(255,255,255,.85); margin-bottom: 12px; }
.book-section .btn { margin-top: 16px; }

/* --- As Seen On / Media --- */
.media-seen-section { background: var(--light-gray); }

.media-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.media-logo-item {
  text-align: center;
}
.media-logo-text {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.logo-fox { color: #003366; }
.logo-epoch { color: #1a3a5c; }
.logo-podcast { color: #7c3aed; }
.media-logo-count {
  font-size: .78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.appearances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.appearance-card {
  display: block;
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.appearance-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.appearance-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: rgba(255,255,255,0.7);
}
.appearance-thumb-placeholder.podcast-thumb {
  background: linear-gradient(135deg, #4a1a6b 0%, #2d1b69 100%);
}
.appearance-thumb-placeholder.synack-thumb {
  background: linear-gradient(135deg, #1a3a2e 0%, #0d2818 100%);
}
.appearance-body {
  padding: 16px 20px 20px;
}
.appearance-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.appearance-source { display: block; margin-bottom: 8px; }
.source-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-fox { background: #003366; color: var(--white); }
.badge-epoch { background: #1a3a5c; color: var(--white); }
.badge-podcast { background: #7c3aed; color: var(--white); }
.appearance-card h3 {
  font-size: .95rem;
  color: var(--heading);
  margin-bottom: 6px;
  line-height: 1.4;
}
.appearance-date {
  display: block;
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.appearance-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.appearance-card:hover .appearance-link { color: var(--gold); }

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}
.about-photo { border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.about-text p { margin-bottom: 1rem; }
.about-text .highlight { color: var(--navy); font-weight: 700; }

/* --- Show Section --- */
.show-section { background: var(--navy-mid); color: var(--white); }
.show-section h2 { color: var(--white); }
.show-section p { color: rgba(255,255,255,.85); }
.show-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}
.show-logo { width: 180px; border-radius: 50%; }

/* --- YouTube --- */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.yt-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: transform var(--transition), box-shadow var(--transition);
}
.yt-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.yt-card iframe { width: 100%; aspect-ratio: 16/9; border: none; display: block; }
.yt-card .yt-info { padding: 16px; }
.yt-card .yt-info h3 { font-size: 1rem; margin-bottom: 4px; }
.yt-card .yt-info .yt-date { font-size: .82rem; color: var(--text-light); }

/* --- Articles --- */
.insights-section { background: var(--light-gray); }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.article-card img { width: 100%; height: 190px; object-fit: cover; }
.article-card .card-body { padding: 20px; }
.article-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.article-card p { font-size: .88rem; color: var(--text-light); margin-bottom: 12px; }
.article-card .read-more {
  color: var(--accent);
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.article-card .read-more:hover { color: var(--gold); }

/* --- Subscribe / CTA --- */
.subscribe-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%);
  color: var(--white);
  text-align: center;
}
.subscribe-section h2 { color: var(--white); margin-bottom: 12px; }
.subscribe-section p { color: rgba(255,255,255,.8); margin-bottom: 28px; }

/* --- Subscribe Form --- */
.subscribe-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subscribe-form .form-group { margin-bottom: 14px; }
.subscribe-form input,
.subscribe-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: var(--white);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--transition);
}
.subscribe-form input::placeholder { color: rgba(255,255,255,.5); }
.subscribe-form select { color: rgba(255,255,255,.7); }
.subscribe-form select option { color: #333; background: var(--white); }
.subscribe-form input:focus,
.subscribe-form select:focus {
  outline: none;
  border-color: var(--gold);
}



.subscribe-form .g-recaptcha-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

/* --- Contact Form --- */
.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form .form-group { margin-bottom: 16px; }
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
  color: var(--heading);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--transition);
  background: var(--white);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}

/* --- Form States --- */
.form-error { color: #d32f2f; font-size: .88rem; margin-bottom: 12px; min-height: 1.2em; }
.form-success { color: #2e7d32; font-size: .88rem; margin-bottom: 12px; min-height: 1.2em; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: .9rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-align: center;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-hover); color: var(--navy); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: #24466e; color: var(--white); }
.btn-outline { border: 2px solid rgba(255,255,255,.4); color: var(--white); background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); color: var(--white); }
.btn-outline-dark { border: 2px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline-dark:hover { background: var(--navy); color: var(--white); }
.btn-full { display: block; width: 100%; }
.btn-sm { padding: 6px 16px; font-size: .78rem; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: #24466e; color: var(--white); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}
.modal-close:hover { color: var(--heading); }
.modal-box h2 { margin-bottom: 16px; }
.modal-box .form-subtitle { color: var(--text-light); margin-bottom: 20px; font-size: .9rem; }
.modal-box .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-box .form-group { margin-bottom: 14px; }
.modal-box label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .88rem; }
.modal-box input, .modal-box select {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d0d0; border-radius: 6px;
  font-family: inherit; font-size: .95rem;
}
.modal-box input:focus, .modal-box select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}


.modal-box .terms-text { max-height: 400px; overflow-y: auto; font-size: .88rem; line-height: 1.6; }
.modal-box .terms-text h3 { font-size: 1rem; margin: 16px 0 8px; }
.modal-box .terms-text ul { margin: 8px 0 8px 20px; }
.modal-box .terms-text li { margin-bottom: 4px; }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--white);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  max-width: 400px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #2e7d32; }
.toast-info { background: var(--accent); }
.toast-error { background: #d32f2f; }

/* --- User Bar --- */
.user-bar { display: flex; align-items: center; gap: 10px; color: var(--white); font-size: .85rem; }
.auth-buttons { display: flex; gap: 6px; }
.badge-warn { background: var(--gold); color: var(--navy); padding: 2px 8px; border-radius: 3px; font-size: .72rem; font-weight: 700; }

/* --- Media list --- */
.media-list { list-style: none; }
.media-list li { padding: 14px 0; border-bottom: 1px solid #e0e0e0; font-size: .95rem; }
.media-list li:last-child { border-bottom: none; }
.media-list a { font-weight: 600; }

/* --- Footer --- */
.site-footer {
  background: var(--dark-navy);
  color: rgba(255,255,255,.6);
  padding: 40px 0;
  text-align: center;
  font-size: .85rem;
}
.footer-social { margin-bottom: 14px; display: flex; justify-content: center; gap: 18px; }
.footer-social a {
  color: rgba(255,255,255,.5);
  font-size: 1.2rem;
  transition: color var(--transition);
}
.footer-social a:hover { color: var(--gold); }
.footer-tagline { font-size: .78rem; margin-bottom: 8px; color: rgba(255,255,255,.35); }

/* --- Sub-page layout --- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 48px 0 38px;
  text-align: center;
}
.page-hero h1 { color: var(--white); margin-bottom: 8px; }
.page-hero .subtitle {
  font-family: 'Abel', sans-serif;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: 1px;
  color: var(--gold);
}
.page-content { padding: 60px 0 80px; }
.page-content p { margin-bottom: 1rem; }

/* --- CV page --- */
.cv-section { margin-bottom: 40px; }
.cv-section h3 { border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 16px; }
.cv-entry { margin-bottom: 16px; padding-left: 16px; border-left: 3px solid var(--gold); }
.cv-entry .cv-date { font-size: .85rem; color: var(--text-light); font-weight: 600; }
.cv-entry .cv-title { font-weight: 700; color: var(--heading); }
.cv-boards li { padding: 6px 0; border-bottom: 1px solid #eee; }
.cv-boards li:last-child { border-bottom: none; }

/* --- Form placeholder --- */
.form-placeholder {
  background: var(--light-gray);
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: var(--text-light);
}

/* --- Hide old top-bar if present --- */
.top-bar { display: none !important; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .nav-auth { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; margin: 0 auto; }
  .show-grid { grid-template-columns: 1fr; text-align: center; }
  .show-logo { margin: 0 auto; }
  .media-logos { gap: 24px; }
}

@media (max-width: 600px) {
  .yt-grid, .articles-grid, .appearances-grid { grid-template-columns: 1fr; }
  .header-inner { height: 56px; padding: 0 4%; }
  .site-logo img { height: 38px; }
  .hero { min-height: 360px; padding: clamp(50px, 8vw, 80px) 0; }
  .subscribe-form .form-row { grid-template-columns: 1fr; }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .modal-box { padding: 24px 20px; }
  .modal-box .form-row { grid-template-columns: 1fr; }
  .media-logos { gap: 16px; }
  .media-logo-text { font-size: 1rem; }
}

/* Nav Register/Login buttons */
.nav-auth {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.btn-nav-register, .btn-register {
  padding: 8px 18px;
  border: 2px solid #c9a84c;
  border-radius: 6px;
  color: #c9a84c;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  transition: background .2s, color .2s;
  background: transparent;
  white-space: nowrap;
}
.btn-nav-register:hover, .btn-register:hover {
  background: #c9a84c;
  color: #00294c;
}
.btn-nav-login, .btn-login {
  padding: 8px 18px;
  background: #c9a84c;
  border: 2px solid #c9a84c;
  border-radius: 6px;
  color: #00294c;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  transition: opacity .2s;
  white-space: nowrap;
}
.btn-nav-login:hover, .btn-login:hover {
  opacity: .85;
}
@media (max-width: 900px) {
  .nav-auth { display: none !important; }
}
.article-date { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 8px; }

/* Checkbox fix */
.modal-box .checkbox-group {
  margin: 16px 0;
}
.modal-box .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: .88rem;
  cursor: pointer;
  line-height: 1.4;
}
.modal-box .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--gold, #c9a84c);
  cursor: pointer;
  margin: 0;
}
.subscribe-form .checkbox-group {
  text-align: left;
  margin: 12px 0;
}
.subscribe-form .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  cursor: pointer;
  color: rgba(255,255,255,.8);
}
.subscribe-form .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--gold, #c9a84c);
  cursor: pointer;
  margin: 0;
}

/* Hide reCAPTCHA v3 badge — attribution in Terms page per Google policy */
.grecaptcha-badge { visibility: hidden !important; }

