/* ==========================================================================
   Deep Time Lab — Main Stylesheet
   Design language: thegreatcircle.earth
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --bg: #08080D;
  --bg-card: #12121E;
  --bg-card-hover: #1A1A2E;
  --text: #E8E6E1;
  --text-muted: #8A8A9A;
  --accent: #C9A84C;
  --accent-light: #E2C76A;
  --accent-dim: rgba(201, 168, 76, .15);
  --accent-teal: #14B8A6;
  --border: #252538;
  --border-accent: rgba(201, 168, 76, .25);
  --font-heading: 'Cinzel', 'Georgia', 'Times New Roman', serif;
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Space Mono', 'Consolas', monospace;
  --glow: 0 0 30px rgba(201, 168, 76, .08);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-light); }
ul, ol { list-style: none; }

::selection {
  background: var(--accent-dim);
  color: var(--accent-light);
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .03em;
  color: var(--text);
}

h1 { font-size: 3rem;    margin-bottom: 1rem; }
h2 { font-size: 2rem;    margin-bottom: .75rem; }
h3 { font-size: 1.35rem; margin-bottom: .5rem; }
h4 { font-size: 1.1rem;  margin-bottom: .4rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }
p.lead { font-size: 1.15rem; line-height: 1.8; }

small, .small { font-size: .85rem; }
code, .mono { font-family: var(--mono); }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(8, 8, 13, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.nav-logo:hover { color: var(--accent-light); }

.nav-links {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform .25s, opacity .25s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 76, .06) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 1rem auto 2.5rem;
  line-height: 1.8;
}

.scroll-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--font);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .2s, border-color .2s;
}

.scroll-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* --------------------------------------------------------------------------
   7. Research Program Cards
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: 2rem;
  transition: background .25s, border-color .25s, box-shadow .25s, transform .25s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.card h3 {
  color: var(--text);
}

.card p {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.card .stat {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
}

.card .card-link::after {
  content: '\2192';
  transition: transform .2s;
}

.card:hover .card-link::after {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   8. Papers Table / List
   -------------------------------------------------------------------------- */

.papers-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.paper-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color .2s;
}

.paper-row:hover {
  border-color: var(--border-accent);
}

.paper-title {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .25rem;
}

.paper-meta {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.paper-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: 2px;
  white-space: nowrap;
}

.paper-badge.published       { background: rgba(20, 184, 166, .15); color: var(--accent-teal); }
.paper-badge.under-review    { background: var(--accent-dim);       color: var(--accent); }
.paper-badge.preprint        { background: rgba(138, 138, 154, .12); color: var(--text-muted); }
.paper-badge.in-preparation  { background: rgba(138, 138, 154, .06); color: #5A5A6A; }

.paper-links {
  display: flex;
  gap: .5rem;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .9rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: .78rem;
  letter-spacing: .03em;
  transition: color .2s, border-color .2s, background .2s;
}

.paper-links a:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: rgba(201, 168, 76, 0.08);
}

/* --------------------------------------------------------------------------
   9. About Section
   -------------------------------------------------------------------------- */

.mission-block {
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
  background: var(--bg-card);
}

.mission-block p {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.8;
}

.principles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.principles-list li {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
}

.principles-list li strong {
  color: var(--text);
  display: block;
  margin-bottom: .15rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  transition: border-color .2s;
}

.team-card:hover {
  border-color: var(--border-accent);
}

.team-card h4 { color: var(--text); margin-bottom: .2rem; }
.team-card .role { font-size: .85rem; color: var(--accent); margin-bottom: .5rem; }
.team-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   10. Blog Cards
   -------------------------------------------------------------------------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.75rem;
  transition: background .25s, border-color .25s, transform .25s;
}

.blog-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.blog-card .date {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.blog-card h3 { font-size: 1.15rem; }

.blog-card p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .read-more {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.blog-card .read-more::after {
  content: '\2192';
  transition: transform .2s;
}

.blog-card:hover .read-more::after {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   11. Contact Section
   -------------------------------------------------------------------------- */

.contact {
  text-align: center;
  padding: 5rem 0;
}

.contact h2 {
  margin-bottom: 1rem;
}

.contact p {
  max-width: 520px;
  margin: 0 auto 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-links a {
  font-size: .9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1rem;
}

.footer-links a {
  font-size: .8rem;
  color: var(--text-muted);
  transition: color .2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-email {
  margin-bottom: .5rem;
}

.footer-email a {
  font-size: .85rem;
  color: var(--text-muted);
  transition: color .2s;
}

.footer-email a:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: .75rem;
  color: #5A5A6A;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   13. Utility Classes
   -------------------------------------------------------------------------- */

.accent      { color: var(--accent) !important; }
.teal        { color: var(--accent-teal) !important; }
.muted       { color: var(--text-muted) !important; }
.mono        { font-family: var(--mono) !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }

/* --------------------------------------------------------------------------
   14. Institute Banner (for thegreatcircle.earth integration)
   -------------------------------------------------------------------------- */

.institute-banner {
  background: var(--accent-teal);
  text-align: center;
  padding: .45rem 1rem;
  font-family: var(--font);
  font-size: .78rem;
  letter-spacing: .03em;
  color: #08080D;
}

.institute-banner a {
  color: #08080D;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.institute-banner a:hover {
  color: #12121E;
}

/* --------------------------------------------------------------------------
   15. Responsive — 1024px
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .card-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  h1 { font-size: 2.5rem; }
  .hero h1 { font-size: 2.8rem; }
}

/* --------------------------------------------------------------------------
   16. Responsive — 768px
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(8, 8, 13, .95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 { font-size: 2.2rem; }
  .hero .subtitle { font-size: 1rem; }

  section { padding: 3.5rem 0; }

  .card-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

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

  .paper-row {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .paper-links {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   17. Responsive — 480px
   -------------------------------------------------------------------------- */

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

  .container { padding: 0 1.25rem; }

  .hero { padding: 5rem 1.25rem 3rem; }
  .hero h1 { font-size: 1.8rem; }

  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.15rem; }

  nav .container { height: 56px; }
  .nav-logo { font-size: .85rem; }

  .card { padding: 1.5rem; }
  .blog-card { padding: 1.25rem; }
  .mission-block { padding: 1rem 1.25rem; }

  .contact-links { flex-direction: column; align-items: center; }
  .footer-links { flex-direction: column; align-items: center; gap: .75rem; }
  .footer-subscribe form { flex-direction: column; align-items: center; }
  .footer-subscribe input[type="email"] { max-width: 100%; }
  .sub-popup form { flex-direction: column; }
  .sub-popup input[type="email"] { width: 100%; }
  .sub-popup { padding: 2rem 1.5rem; }
}

/* --------------------------------------------------------------------------
   18. Memory Path Feature
   -------------------------------------------------------------------------- */

.memory-path-feature {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 5rem 0;
}

.memory-path-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #05050a 0%, #0a0a18 40%, #0d0d1f 100%);
  z-index: 0;
}

.memory-path-arc {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 80%;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-top-color: rgba(201, 168, 76, .2);
  border-radius: 50%;
  box-shadow:
    0 -20px 60px -10px rgba(201, 168, 76, .08),
    0 -40px 120px -20px rgba(201, 168, 76, .04);
  animation: arc-glow 6s ease-in-out infinite alternate;
}

@keyframes arc-glow {
  0% {
    border-top-color: rgba(201, 168, 76, .15);
    box-shadow:
      0 -20px 60px -10px rgba(201, 168, 76, .06),
      0 -40px 120px -20px rgba(201, 168, 76, .03);
  }
  100% {
    border-top-color: rgba(201, 168, 76, .3);
    box-shadow:
      0 -20px 60px -10px rgba(201, 168, 76, .12),
      0 -40px 120px -20px rgba(201, 168, 76, .06);
  }
}

.memory-path-feature .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 1rem;
}

.memory-path-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: .75rem;
}

.memory-path-sub {
  font-size: 1.15rem;
  color: var(--text);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.memory-path-desc {
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.memory-path-cta {
  display: inline-block;
  padding: .85rem 2.25rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: background .2s, transform .2s;
}

.memory-path-cta:hover {
  background: var(--accent-light);
  color: var(--bg);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .memory-path-feature { min-height: 400px; padding: 3.5rem 0; }
  .memory-path-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .memory-path-feature { min-height: 360px; }
  .memory-path-title { font-size: 1.5rem; }
  .memory-path-sub { font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   18b. Observability Gradient Feature (Homepage)
   -------------------------------------------------------------------------- */

.gradient-feature {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 5rem 0;
}

.gradient-feature-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #05050a 0%, #060a14 40%, #0a1018 100%);
  z-index: 0;
}

.gradient-feature-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, .08) 0%, transparent 70%);
  animation: gradient-pulse 5s ease-in-out infinite alternate;
}

@keyframes gradient-pulse {
  0% { opacity: .5; transform: translate(-50%, -50%) scale(.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.gradient-feature .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.gradient-feature-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--accent-teal);
  margin-bottom: .75rem;
}

.gradient-feature-sub {
  font-size: 1.15rem;
  color: var(--text);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.gradient-feature-desc {
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.gradient-feature-cta {
  display: inline-block;
  padding: .85rem 2.25rem;
  background: var(--accent-teal);
  color: var(--bg);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: background .2s, transform .2s;
}

.gradient-feature-cta:hover {
  background: #2dd4bf;
  color: var(--bg);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .gradient-feature { min-height: 400px; padding: 3.5rem 0; }
  .gradient-feature-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .gradient-feature { min-height: 360px; }
  .gradient-feature-title { font-size: 1.5rem; }
  .gradient-feature-sub { font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   19. Footer Subscribe Box
   -------------------------------------------------------------------------- */

.footer-subscribe {
  max-width: 420px;
  margin: 1.5rem auto;
  text-align: center;
}

.footer-subscribe p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.footer-subscribe form {
  display: flex;
  gap: .5rem;
  justify-content: center;
}

.footer-subscribe input[type="email"] {
  flex: 1;
  max-width: 260px;
  padding: .55rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
}

.footer-subscribe input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.footer-subscribe button {
  padding: .55rem 1.2rem;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s;
}

.footer-subscribe button:hover {
  background: var(--accent-light);
}

/* --------------------------------------------------------------------------
   19. Substack Popup
   -------------------------------------------------------------------------- */

.sub-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.sub-popup-overlay.show {
  display: flex;
}

.sub-popup {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 2.5rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  position: relative;
}

.sub-popup h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: .75rem;
}

.sub-popup p {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.sub-popup form {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.sub-popup input[type="email"] {
  flex: 1;
  padding: .65rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font);
  font-size: .9rem;
}

.sub-popup input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.sub-popup button[type="submit"] {
  padding: .65rem 1.4rem;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.sub-popup button[type="submit"]:hover {
  background: var(--accent-light);
}

.sub-popup .dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sub-popup .dismiss:hover {
  color: var(--text);
}

.sub-popup .close-x {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.sub-popup .close-x:hover {
  color: var(--text);
}
