/* ==========================================================================
   Night Owls — Stephen Gay
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #000;
  --bg-footer: #0b0b0b;
  --surface: #111;
  --border: #1d1d1d;
  --text: #fff;
  --text-body: #f1f1f1;
  --text-muted: #cfcfcf;
  --text-faint: #8a8a8a;
  --accent-text: #f4a842;
  --error: #ff7a7a;
  --input-border: #ccc;
  --cover-shadow: rgba(0,0,0,.6);
  --owl-filter: none;
  --btn-shadow: rgba(0,0,0,.25);
  --orange: #f4a842;
  --orange-hover: #ffb65a;
  --blue: #3f88b5;
  --blue-hover: #4d9bcb;
  --link: #4ba3d9;
  --radius: 8px;
  --header-h: 60px;
  --container: 1180px;
  --font: "Open Sans", Arial, Helvetica, sans-serif;
}

/* Light theme: set by data-theme, or by the device setting when JS is off */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5f1;
  --bg-footer: #ebe8e2;
  --surface: #e9e6e0;
  --border: #dcd8d0;
  --text: #141414;
  --text-body: #222;
  --text-muted: #4a4a4a;
  --text-faint: #6b6b6b;
  --accent-text: #a65f00;
  --error: #b3261e;
  --input-border: #bdb8ae;
  --cover-shadow: rgba(0,0,0,.28);
  --owl-filter: invert(1);
  --btn-shadow: rgba(0,0,0,.12);
  --link: #1f6f9f;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f7f5f1;
    --bg-footer: #ebe8e2;
    --surface: #e9e6e0;
    --border: #dcd8d0;
    --text: #141414;
    --text-body: #222;
    --text-muted: #4a4a4a;
    --text-faint: #6b6b6b;
    --accent-text: #a65f00;
    --error: #b3261e;
    --input-border: #bdb8ae;
    --cover-shadow: rgba(0,0,0,.28);
    --owl-filter: invert(1);
    --btn-shadow: rgba(0,0,0,.12);
    --link: #1f6f9f;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

img, video { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; font-weight: 400; }
h3, h4 { font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--orange); color: #000; padding: 10px 16px;
}
.skip-link:focus { left: 10px; top: 10px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: #000;
  transition: background-color .3s, box-shadow .3s;
}
.site-header .container {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  max-width: 1440px; padding: 0 clamp(20px, 6vw, 64px);
}
.logo img { height: 30px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 14px; position: relative; z-index: 210; }

.theme-toggle, .admin-link {
  background: none; border: 0; padding: 8px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  transition: color .2s, background-color .2s;
}
.theme-toggle:hover, .admin-link:hover { color: var(--orange); background: rgba(255,255,255,.08); }
.theme-toggle svg, .admin-link svg { width: 22px; height: 22px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 999px; color: #fff;
  font: 600 14px/1 var(--font); letter-spacing: .05em;
  transition: color .2s, background-color .2s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { color: var(--orange); background: rgba(255,255,255,.08); }
.lang-switch summary svg { width: 18px; height: 18px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 170px;
  margin: 0; padding: 6px; list-style: none;
  background: #111; border: 1px solid #262626; border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.lang-menu a { display: block; padding: 9px 14px; border-radius: 6px; color: #fff; font-size: 15px; }
.lang-menu a:hover { background: rgba(255,255,255,.08); color: var(--orange); text-decoration: none; }
.lang-menu a[aria-current] { color: var(--orange); font-weight: 600; }

.lang-banner {
  position: fixed; left: 50%; bottom: 20px; z-index: 300;
  width: min(580px, calc(100% - 24px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 12px 10px 12px 20px;
  background: #111; color: #fff; border: 1px solid #2a2a2a; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: 15px; line-height: 1.4;
  animation: banner-in .45s cubic-bezier(.2,.7,.2,1) both;
}
.lang-banner p { margin: 0; flex: 1; }
.lang-banner .btn { width: auto; min-width: 0; padding: 10px 18px; font-size: 15px; white-space: nowrap; box-shadow: none; }
.lang-banner-close {
  background: none; border: 0; color: #aaa; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1;
}
.lang-banner-close:hover { color: #fff; background: rgba(255,255,255,.08); }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, 24px); } }

.menu-toggle {
  background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 210;
}
.menu-toggle span {
  display: block; width: 28px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .35s, opacity .25s;
}
.menu-toggle span:nth-child(2) { width: 22px; align-self: flex-end; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Slide-out menu ---------- */

.menu-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.6); opacity: 0; visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.menu-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
  width: min(440px, 100%);
  background: #0d0d0d;
  padding: calc(var(--header-h) + 40px) 48px 40px;
  transform: translateX(100%);
  transition: transform .5s cubic-bezier(.77,0,.18,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.menu-open .site-header { z-index: 250; background: transparent; }
.menu-open .menu-overlay { opacity: 1; visibility: visible; }
.menu-open .menu-panel { transform: none; }
.menu-open { overflow: hidden; }

.menu-panel nav ul { list-style: none; margin: 0; padding: 0; }
.menu-panel nav a {
  display: block; color: #fff; font-size: clamp(26px, 6vw, 34px); line-height: 1.6;
  transition: color .2s, transform .2s;
}
.menu-panel nav a:hover, .menu-panel nav a[aria-current="page"] {
  color: var(--orange); text-decoration: none; transform: translateX(6px);
}
.menu-panel .menu-social { margin-top: auto; padding-top: 40px; display: flex; align-items: center; gap: 22px; }
.menu-panel .menu-social a {
  color: #fff; opacity: .85;
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
}
.menu-panel .menu-social a:hover { opacity: 1; color: var(--orange); }
.menu-panel .menu-social svg { width: 22px; height: 22px; display: block; }
.menu-panel .menu-social .admin-link { margin-left: auto; background: none; }
.menu-panel .menu-social .admin-link:hover { background: none; }

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

.btn-row { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }
.btn-row.center { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 178px; padding: 18px 44px;
  background: var(--orange); color: #fff;
  font: 600 17px/1.2 var(--font);
  border: 0; border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 4px 14px var(--btn-shadow);
  transition: background-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--orange-hover); text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px var(--btn-shadow); }

.btn-social { background: var(--blue); min-width: 162px; justify-content: space-between; padding: 18px 26px 18px 34px; }
.btn-social:hover { background: var(--blue-hover); }
.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.hero {
  position: relative; color: #fff; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--header-h) + 40px) 24px 140px;
  overflow: hidden; text-align: center;
}
.hero-media, .hero-media video, .hero-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.15) 50%, rgba(0,0,0,.45) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero h1 {
  font-size: clamp(42px, 8.2vw, 88px); line-height: 1.2; font-weight: 400;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
  margin: 0;
}
/* German and French run longer, with long compound words */
.hero:not(:lang(en)) { padding-bottom: 190px; }
.hero-content:not(:lang(en)) { max-width: 780px; }
.hero h1:not(:lang(en)) { font-size: clamp(36px, 6.2vw, 72px); overflow-wrap: break-word; }
.hero .btn-row { justify-content: center; margin-top: 56px; max-width: 460px; margin-inline: auto; }
.hero-content > * { opacity: 0; transform: translateY(24px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-content > *:nth-child(2) { animation-delay: .25s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-down {
  position: absolute; left: 50%; bottom: -36px; z-index: 1;
  width: 200px; height: 200px; transform: translateX(-50%);
  color: #fff;
}
.scroll-down svg { width: 100%; height: 100%; animation: spin 14s linear infinite; }
.scroll-down text { font: 500 14px var(--font); fill: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */

.section { padding: 50px 0; }
.section-lg { padding: 80px 0; }

.tagline h1, .tagline h2 { font-size: clamp(26px, 3.6vw, 38px); text-align: center; font-weight: 400; margin: 0; }

.signup h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin-bottom: 4px; }
.signup p { color: var(--text-muted); font-size: 17px; }
.signup-form { display: flex; gap: 13px; max-width: 768px; margin: 26px auto 0; }
.signup-form input[type="email"] {
  flex: 1; min-width: 0; padding: 14px 16px;
  font: 17px var(--font); color: #222; background: #fff;
  border: 1px solid var(--input-border); border-radius: 4px;
}
.signup-form input[type="email"]:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.signup-form .btn { min-width: 230px; padding: 16px 30px; }
.signup-note { font-size: 13px !important; color: var(--text-faint) !important; margin-top: 12px; }
.signup-msg { margin: 14px 0 0; font-weight: 600; }
.signup-msg:empty { display: none; }
.signup { padding-bottom: 10px; }
.signup-msg.ok { color: var(--accent-text); }
.signup-msg.err { color: var(--error); }

.social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px; }

/* ---------- Book feature (cover + copy) ---------- */

.book {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(30px, 6vw, 80px); align-items: center;
  padding: 50px 0;
}
.book:first-of-type { padding-top: 10px; }
.book.reverse .book-cover { order: 2; }
.book-cover { display: flex; justify-content: center; }
.book-cover img { width: 100%; max-width: 360px; height: auto; filter: drop-shadow(0 20px 40px var(--cover-shadow)); transition: transform .4s; }
.book-cover a:hover img { transform: translateY(-6px) scale(1.02); }
.book-cover.box img { max-width: 300px; }
.book-cover.flat img { max-width: 300px; border-radius: 4px; filter: none; box-shadow: 0 20px 40px var(--cover-shadow); }
.book .edition-note {
  display: inline-block; margin: 0 0 1em; padding: 3px 11px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px;
}
.page-intro { color: var(--text-muted); margin-bottom: 30px; }
.answer p, p.answer { font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }

.book h1, .book h2 { font-size: clamp(28px, 3.4vw, 38px); }
.book h3, .book .lead { font-size: clamp(19px, 2vw, 24px); font-weight: 700; margin-bottom: .5em; }
.book p { color: var(--text-body); }
.book .btn-row { margin-top: 30px; }
.book blockquote { margin: 1.2em 0; padding: 0; font-size: 19px; }
.book blockquote strong { font-weight: 700; }

.series-divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- Video / social embeds ---------- */

.video-embed { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 900px; margin: 40px auto; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.socials-embeds {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px; align-items: start; justify-items: center;
}
.embed-slot { width: 100%; max-width: 540px; min-height: 600px; display: flex; justify-content: center; }
.embed-slot > * { margin: 0 auto !important; }

.tt-embed { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tt-card, .tt-embed iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16;
  border: 0; border-radius: var(--radius); overflow: hidden; background: #000; color: #fff;
}
.tt-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tt-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 25%, transparent 55%, rgba(0,0,0,.8) 100%);
}
.tt-card:hover { text-decoration: none; }
.tt-card:hover img { transform: scale(1.03); }
.tt-logo { position: absolute; top: 14px; right: 14px; z-index: 1; }
.tt-logo svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.tt-play {
  position: absolute; top: 50%; left: 50%; z-index: 1; width: 76px; height: 76px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background-color .2s;
}
.tt-play svg { width: 34px; height: 34px; margin-left: 4px; }
.tt-card:hover .tt-play { transform: translate(-50%, -50%) scale(1.08); background: var(--orange); border-color: var(--orange); }
.tt-caption { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1; font-size: 15px; line-height: 1.45; text-align: left; }
.tt-caption strong { display: block; margin-bottom: 4px; }
.tt-open { font-weight: 600; font-size: 15px; color: var(--accent-text); }
.embed-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 600px; border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); text-align: center; padding: 24px;
}
.embed-placeholder svg { width: 40px; height: 40px; color: var(--text); }

/* ---------- Owl graphic + footer ---------- */

.owl-mark { padding: 40px 0 60px; }
.owl-mark img { width: min(640px, 80%); margin: 0 auto; height: auto; filter: var(--owl-filter); }

.site-footer { background: var(--bg-footer); padding: 70px 0 34px; font-size: 16px; color: var(--text-muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; max-width: 1440px; padding: 0 clamp(20px, 6vw, 64px); }
.footer-social { display: flex; gap: 18px; }
.footer-social a { color: var(--text); opacity: .7; }
.footer-social a:hover { opacity: 1; color: var(--accent-text); }
.footer-social svg { width: 20px; height: 20px; }

/* ---------- About / Awards ---------- */

.page-top { padding-top: calc(var(--header-h) + 60px); }

.about-intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(30px, 6vw, 70px); align-items: start; }
.about-intro > img { border-radius: var(--radius); width: 100%; height: auto; }
.about-intro h1 { font-size: clamp(26px, 3vw, 34px); margin-bottom: .8em; }
.member { display: flex; align-items: center; justify-content: flex-start; gap: 18px; margin-top: 24px; font-weight: 700; }
.member img { width: 70px; height: auto; margin: 0; border-radius: 0; flex: 0 0 auto; }

.connect h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; margin-bottom: 28px; }

.review { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 36px; padding: 50px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review-badge img { width: 150px; height: auto; border-radius: var(--radius); }
.review h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.45; font-style: italic; }
.review h3 { font-size: 22px; }
.review .source { font-weight: 700; color: var(--text); }
.review p { color: var(--text-body); }
.review-body.clamped { max-height: 340px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.read-more { background: none; border: 0; color: var(--accent-text); font: 600 16px var(--font); cursor: pointer; padding: 6px 0; }
.read-more:hover { text-decoration: underline; }

/* ---------- Coming soon / 404 ---------- */

.simple-page { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; padding: calc(var(--header-h) + 40px) 24px 60px; }
.simple-page img { width: min(360px, 70%); margin: 0 auto 30px; height: auto; filter: var(--owl-filter); }
.simple-page h1 { font-size: clamp(36px, 6vw, 64px); }
.simple-page p { color: var(--text-muted); max-width: 560px; margin-inline: auto; }

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

@media (max-width: 999px) {
  .book, .about-intro { grid-template-columns: 1fr; text-align: left; }
  .book.reverse .book-cover { order: 0; }
  .book-cover img { max-width: 280px; }
  .book-cover.box img { max-width: 260px; }
  .book-cover.flat img { max-width: 240px; }
  .socials-embeds { grid-template-columns: 1fr; }
  .about-intro > img { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 690px) {
  body { font-size: 17px; }
  .hero { padding-bottom: 120px; }
  .hero .btn-row { flex-direction: column; align-items: center; max-width: none; gap: 12px; margin-top: 40px; }
  .btn { width: 260px; max-width: 100%; min-width: 0; padding: 16px 28px; }
  .btn-row { flex-direction: column; align-items: flex-start; }
  .scroll-down { width: 150px; height: 150px; bottom: -28px; }
  .signup-form { flex-direction: column; align-items: flex-start; }
  .social-row { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-social { width: 100%; min-width: 0; padding: 16px 20px; }
  .review { grid-template-columns: 1fr; gap: 20px; }
  .review-badge img { width: 110px; }
  .embed-slot, .embed-placeholder { min-height: 520px; }
  .site-footer .container { flex-direction: column-reverse; text-align: center; }
  .header-actions { gap: 4px; }
  .lang-banner { bottom: 12px; flex-wrap: wrap; padding: 14px 10px 14px 18px; }
  .lang-banner p { flex-basis: calc(100% - 50px); }
  .lang-banner .btn { order: 3; flex: 0 0 auto; width: auto; min-width: 0; }
}
