:root {
  --ink: #14181f;
  --paper: #f7f4ee;
  --surface: #ffffff;
  --accent: #C8A24A;
  --muted: #6b7178;
  --line: #e3ddd1;
  --header-bg: #14181f;
  --header-fg: #ffffff;
  --header-muted: #d8d2c6;
  --hero-overlay: brightness(1);
  --body-bg: var(--paper);
  --body-fg: var(--ink);
}

/* Dark theme overrides (driven by <html data-theme="dark">) */
html[data-theme="dark"] {
  --ink: #f3efe6;
  --paper: #16191f;
  --surface: #1f242c;
  --accent: #e0b62e;
  --muted: #9aa1ab;
  --line: #2c323b;
  --header-bg: #0d0f13;
  --header-fg: #f3efe6;
  --header-muted: #b9b3a6;
  --hero-overlay: brightness(1);
  --body-bg: #12151a;
  --body-fg: #e8e4da;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--body-bg);
  color: var(--body-fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---- Top nav ---- */
.site-header {
  background: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 3px solid var(--accent);
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-brand img {
  display: block;
  height: 38px;
  width: auto;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.site-nav a {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.site-nav a:hover { color: var(--accent); }

/* Everything in the header except the logo, pinned to the far right */
.site-nav-right {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
}
.nav-signup {
  color: var(--header-fg);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-signup:hover {
  background: var(--accent);
  color: #14181f;
}

.about-cta { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.theme-toggle {
  background: transparent;
  color: var(--header-muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem; }

/* ---- Hero ---- */
/* The image is shown at full brightness and uses object-fit:cover so it
   scales to the screen geometry WITHOUT stretching or distorting. A separate
   gradient layer (.hero-scrim) sits behind the text for readability so the
   photo itself is never dimmed. */
.hero {
  position: relative;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.hero-img {
  display: block;
  width: 100%;
  height: clamp(360px, 62vh, 760px);
  object-fit: cover;
  object-position: center;
  filter: none;
}
/* Readability scrim behind the hero text (does not touch the image). */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 14, 0.45) 0%,
    rgba(8, 10, 14, 0.20) 45%,
    rgba(8, 10, 14, 0.55) 100%
  );
  pointer-events: none;
}
.hero-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 0 1.2rem;
  z-index: 1;
}
.hero .kicker {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}
.hero-sub {
  font-size: 1.15rem;
  margin: 0.4rem 0 1.4rem;
  color: #f0e9da;
}

.btn {
  display: inline-block;
  margin: 0.3rem;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 2px;
}
.btn.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
}

/* ---- Intro + featured ---- */
.intro {
  padding: 3rem 0 1rem;
  font-size: 1.2rem;
}
.intro .wrap { max-width: 760px; }

.section-title {
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  margin: 2.5rem 0 1.2rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.3rem;
}

.featured { padding-bottom: 3rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.card h3 { margin-top: 0; color: var(--body-fg); }
.card p { color: var(--muted); margin-bottom: 0; }
.card-icon { margin-bottom: 0.8rem; line-height: 0; }

/* Hero text (works for home, about, and /portal pages via shared .hero) */
.hero-inner h1 { font-family: Georgia, serif; color: #fff; letter-spacing: 1px; margin: 0 0 10px; font-size: 46px; }
.hero-inner h2 { font-family: Georgia, serif; color: #fff; letter-spacing: 1px; margin: 0 0 10px; font-size: 38px; }
.hero-inner .sub { color: #f0e9da; font-size: 18px; max-width: 640px; margin: 0 auto 26px; }
.hero-inner .about-title { color: #fff; font-size: 2.6rem; letter-spacing: 0.04em; margin: 0 0 0.5rem; }
.hero-inner .lead { color: #f0e9da; font-size: 1.2rem; }

/* ---- About ---- */
.about { padding: 2.5rem 0 4rem; }
.about-head h1 {
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.about .lead { font-size: 1.2rem; color: var(--body-fg); }
.about-body { max-width: 760px; font-size: 1.05rem; }
.about-body p { margin: 0 0 1.1rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  padding: 1.4rem;
  font-size: 0.85rem;
  border-top: 3px solid var(--accent);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* =========================================================================
   /pub (creator portal) component styles — share the same theme variables
   as the main site so the look is coordinated page-to-page.
   ========================================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: 1.2rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.card h3 { margin-top: 0; color: var(--body-fg); }
.card h3 a { color: var(--body-fg); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--muted); margin-bottom: 0; }

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

.section-title {
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  margin: 2.5rem 0 1.2rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.3rem;
}

.alert {
  padding: 12px 16px; border-radius: 9px; margin: 14px 0; font-size: 14px;
}
.alert.ok { background: rgba(95,191,122,.12); border: 1px solid rgba(95,191,122,.4); color: #2f8f4f; }
.alert.err { background: rgba(217,105,74,.12); border: 1px solid rgba(217,105,74,.4); color: #b4472c; }

.badge {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.approved { color: #3fa85f; border-color: rgba(95,191,122,.4); }
.badge.pending { color: var(--accent); border-color: rgba(200,162,74,.4); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

audio { width: 100%; margin-top: 8px; }

form .field { margin: 14px 0; }
form label { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--body-fg); font-size: 15px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
textarea { min-height: 110px; }

.embed {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 12px; margin-top: 10px;
}
.embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.7); }
.btn.ghost:hover { color: #fff; letter-spacing: 1px; }
