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

:root {
  --paper: #FBF8F2;
  --ink: #2E2E2C;
  --ink-soft: #6B6963;
  --cyan: #B8DDE0;
  --cyan-deep: #6FA8AD;
  --rule: #E4DFD3;
}

body { background: var(--paper); color: var(--ink); font-family: 'Work Sans', sans-serif; }

nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  border-bottom: 1px solid var(--rule);
}
.mark { font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; }
.tabs { display: flex; gap: 28px; font-size: 13px; align-items: center; }
.tabs a { color: var(--ink-soft); text-decoration: none; transition: all 0.2s ease; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); font-weight: 600; }

.tabs a[href="/join"] {
  display: inline-block;
  background-color: var(--cyan);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: 600;
  margin-right: -10px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 82vh;
  align-items: center;
}

.rail {
  padding: 60px 40px 60px 48px;
  border-right: 1px solid var(--rule);
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
}

.rail-label {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600;
}
.rail-number {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 90px; color: var(--cyan-deep);
  line-height: 1; margin-top: 20px;
}
.rail-number span { font-size: 24px; display: block; color: var(--ink-soft); font-family: 'Work Sans', sans-serif; font-weight: 500; margin-top: 8px; }

.rail-foot { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }

.content {
  padding: 60px 64px 60px 56px;
}

.content h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.25;
  max-width: 460px;
  margin-bottom: 34px;
}

.content p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 420px;
  margin-bottom: 18px;
}

.content .lede {
  font-weight: 500;
  color: var(--ink);
}

.cta-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px;
  font-size: 14.5px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--ink);
}
.cta-link .arrow { transition: transform 0.2s; }
.cta-link:hover .arrow { transform: translateX(4px); }

.cta-solid {
  display: inline-block; margin-top: 20px;
  background: var(--cyan); color: var(--ink);
  padding: 14px 30px; border-radius: 3px;
  font-weight: 600; font-size: 14px; text-decoration: none;
}

.btn {
  display: inline-block; background: var(--cyan); color: var(--ink); padding: 14px 30px; border-radius: 3px; font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 40px;
}

footer { text-align: center; padding: 34px 20px 40px; border-top: 1px solid var(--rule); }
footer .line1 { font-size: 13px; color: #ABA69C; margin-bottom: 4px; }
footer .line2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 14px; color: var(--cyan-deep); }
footer .footer-links { margin-top: 24px; font-size: 12px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
footer .footer-links a { color: inherit; text-decoration: none; }
footer .footer-links a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .rail { border-right: none; border-bottom: 1px solid var(--rule); padding: 40px 48px; }
}

/* Forms */
.form-container { margin-top: 16px; }
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-size: 14.5px;
  padding: 10px 12px;
  border-radius: 3px;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--cyan-deep);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .error-msg { color: #d93025; font-size: 12px; margin-top: 4px; display: none; }
.form-group.has-error input, .form-group.has-error textarea { border-color: #d93025; }
.form-group.has-error .error-msg { display: block; }

.form-actions { margin-top: 20px; }
.form-actions button {
  display: inline-block; background: var(--cyan); color: var(--ink);
  padding: 12px 24px; border-radius: 3px; font-weight: 600; font-size: 13px;
  border: none; cursor: pointer; transition: opacity 0.2s;
  font-family: 'Work Sans', sans-serif; width: auto;
}
.form-actions button:hover:not(:disabled) { opacity: 0.9; }
.form-actions button:disabled { opacity: 0.6; cursor: not-allowed; }

.cf-turnstile-wrap { margin-bottom: 16px; min-height: 65px; }

.form-fallback { margin-top: 16px; font-size: 12.5px; color: var(--ink-soft); }
.form-fallback a { color: inherit; text-decoration: underline; }

.form-feedback { padding: 16px; border-radius: 3px; font-size: 14.5px; margin-bottom: 16px; display: none; line-height: 1.5; }
.form-feedback.success { background: #EAF5F6; border: 1px solid var(--cyan-deep); color: var(--ink); display: block; }
.form-feedback.error { background: #FCE8E6; border: 1px solid #d93025; color: var(--ink); display: block; }
.form-feedback:empty { display: none !important; }

/* Scroll-Bound Video Track */
.video-scroll-track {
  height: 500vh; /* Massive scrolling space to control playback */
  position: relative;
  width: 100%;
}

.video-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

#hero-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* keep children centered */
  mix-blend-mode: multiply; /* Blends white video bg seamlessly into paper */
  opacity: 0.85; /* Softens the stark black lines */
}

.video-overlays {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.overlay-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 20px));
  text-align: center;
  width: 90%;
  max-width: 800px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.overlay-text h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 6vw, 68px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  text-shadow: 0 4px 30px var(--paper), 0 2px 10px var(--paper); /* Ensures legibility over lines */
}

@media (max-width: 768px) {
  .video-scroll-track {
    height: 350vh; /* slightly less scrolling on mobile */
  }
}

/* --- Research Hub / Blog Component Styles --- */

.masthead { font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px; color: var(--cyan-deep); }
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--cyan-deep);
  text-transform: uppercase; margin: 2px 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--rule);
}

.standing-note {
  background: white;
  border-left: 4px solid var(--cyan-deep);
  padding: 18px 22px;
  margin: 0 0 40px;
  font-size: 15px;
  line-height: 1.65;
}
.standing-note b {
  display: block; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cyan-deep); margin-bottom: 6px;
}

/* Category filter tabs */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 36px; }
.tab {
  font-family: 'Work Sans', sans-serif;
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 3px;
  border: 1px solid var(--rule); background: white; color: var(--ink); white-space: nowrap;
  cursor: pointer;
}
.tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tab .count { color: var(--ink-soft); font-weight: 400; }
.tab[aria-pressed="true"] .count { color: var(--cyan); }

/* Featured post */
.featured {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-radius: 3px; padding: 30px;
  margin-bottom: 44px; background: white;
}
.featured-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 10px;
}
.featured h2 {
  font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600; margin: 0 0 8px; color: var(--ink);
}
.featured .sub {
  font-family: 'Fraunces', serif; font-size: 16px; color: var(--cyan-deep); margin: 0 0 14px;
}
.featured p.excerpt { font-size: 15px; color: var(--ink-soft); margin: 0 0 14px; max-width: 640px; }
.featured .meta { font-size: 12.5px; color: var(--ink-soft); }
.featured .meta span.cat { color: var(--cyan-deep); font-weight: 600; }

/* Section labels */
.section-label {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px; color: var(--ink);
  margin: 44px 0 4px;
}
.section-sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }

/* Post grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.post-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-radius: 3px; padding: 18px 20px; background: white;
}
.post-card h3 { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.post-card .meta { font-size: 12px; color: var(--ink-soft); }

.empty-state {
  border: 1px dashed var(--rule); border-radius: 3px; padding: 22px;
  font-size: 13.5px; color: var(--ink-soft); text-align: center;
}

@media (max-width: 600px) {
  nav { padding: 16px 20px; flex-wrap: nowrap; gap: 20px; }
  .mark { flex-shrink: 0; }
  .tabs { 
    flex-shrink: 1;
    overflow-x: auto; 
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch; 
    gap: 16px; 
    padding-bottom: 4px; 
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .rail { padding: 30px 20px; }
  .content { padding: 30px 20px; }
  footer { padding: 30px 20px; }
  .standing-note { padding: 16px; }
  .featured { padding: 20px; }
}
