/* ==========================================================================
   [e]colodge — base stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500;1,600&display=swap');

:root {
  /* Brand colors */
  --color-black: #0E0E0E;
  --color-white: #FFFFFF;
  --color-green: #84E887;
  --color-pink: #AE6784;

  /* Semantic tokens (dark theme) */
  --color-bg: var(--color-black);
  --color-text: var(--color-white);
  --color-accent: var(--color-green);
  --color-accent-alt: var(--color-pink);
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-border: rgba(255, 255, 255, 0.15);

  /* Type
     Sans = headings + body copy
     Mono = logo wordmark + logo-adjacent elements (enter button, terminal) */
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Layout */
  --max-width: 1280px;
  --edge-padding: clamp(1.25rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: lowercase;
}

h1 {
  font-weight: 600; /* SemiBold */
}

h2 {
  font-weight: 500; /* Medium */
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}

h3, h4 {
  font-weight: 400; /* Regular */
}

p, li {
  font-weight: 300; /* Light body copy */
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--edge-padding);
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-md);
}

.brandmark {
  height: 56px;
  width: auto;
}

.brandmark img {
  height: 100%;
  width: auto;
  /* The logo SVG has ~18% empty space baked in before the "[" glyph starts.
     Shift left by that same fraction of its own width so the visible mark
     lines up with body text using the same container padding. */
  transform: translateX(-18.07%);
}

/* --------------------------------------------------------------------------
   Accent utility
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Splash screen
   -------------------------------------------------------------------------- */

body.no-scroll {
  overflow: hidden;
  height: 100%;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  padding: var(--edge-padding);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.exit {
  opacity: 0;
  visibility: hidden;
}

.splash-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.splash.terminal-active .splash-inner {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.splash-heading {
  font-size: clamp(1.485rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.splash-tagline {
  font-size: clamp(1.01rem, 2.4vw, 1.35rem);
  font-weight: 300;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.enter-btn {
  font-family: var(--font-mono);
  font-size: clamp(1.485rem, 2.6vw, 1.6rem);
  font-weight: 300; /* Mono Light, matches logo type */
  letter-spacing: 0.02em;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-xs);
  transition: color 0.25s ease;
}

.enter-btn .bracket {
  color: var(--color-accent);
}

.enter-btn:hover,
.enter-btn:focus-visible {
  color: var(--color-accent);
}

.enter-btn:disabled {
  cursor: default;
}

.enter-btn:focus-visible {
  outline: 1px dashed var(--color-accent);
  outline-offset: 6px;
}

.type-cursor {
  display: inline-block;
  width: 0.14em;
  height: 1em;
  margin-left: 1px;
  background-color: var(--color-accent);
  vertical-align: -0.15em;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Terminal
   -------------------------------------------------------------------------- */

.terminal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.splash.terminal-active .terminal {
  opacity: 1;
  pointer-events: auto;
}

.terminal-output {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--edge-padding);
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  font-weight: 400;
  color: var(--color-accent);
  text-align: left;
}

.terminal-line {
  white-space: pre;
  min-height: 1.5em;
}

.skip-terminal-btn {
  position: absolute;
  bottom: calc(var(--edge-padding) + 2rem);
  right: calc(var(--edge-padding) + 2rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.25s ease;
}

.splash.terminal-active .skip-terminal-btn {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Main content reveal
   -------------------------------------------------------------------------- */

.main-content {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.3s ease-out, transform 1.3s ease-out;
}

.main-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Intro (hero heading + story reveal)
   -------------------------------------------------------------------------- */

.intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-block: var(--space-lg) var(--space-md);
}

@media (max-width: 720px) {
  .intro {
    gap: var(--space-md);
    padding-block: var(--space-md) var(--space-sm);
  }
}

.intro-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

@media (max-width: 720px) {
  .intro-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

.intro-image {
  width: clamp(180px, 40vw, 220px);
  height: auto;
  flex-shrink: 0;
}

.hero-heading {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 20ch;
  /* font-weight inherited from h1 rule: 600 (SemiBold) */
}

.hero-heading:focus {
  /* Focused programmatically (see main.js) so screen readers announce it
     once the story loads. Some mobile browsers render a visible focus
     ring on any focused element even when it isn't interactive — suppress
     it here since there's no keyboard interaction happening on a heading. */
  outline: none;
}

.rotate-word {
  display: inline-block;
  color: var(--color-accent-alt);
  transition: opacity 0.26s ease, transform 0.26s ease;
  opacity: 1;
  transform: translateY(0);
}

.rotate-word.is-switching {
  opacity: 0;
  transform: translateY(6px);
}

/* --------------------------------------------------------------------------
   Story reveal
   -------------------------------------------------------------------------- */

.story-chunks {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 62ch;
}

.story-chunks:empty {
  display: none;
}

.story-body {
  font-size: clamp(0.95rem, 1.4vw, 1rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text);
}

.story-emphasis {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.3;
  color: var(--color-text);
}

.story-heading {
  /* h3 already gets font-family/weight/line-height from the global h1-h4
     rule (Sans, Regular). This is a narrative sentence, not a short label,
     so it's exempted from the global lowercase title transform. */
  text-transform: none;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.story-quote {
  font-style: italic;
  font-weight: 300;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.6;
  color: var(--color-text);
  max-width: 46ch;
  margin-inline: auto;
}

.story-citation {
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.98rem, 1.68vw, 1.12rem);
  color: var(--color-accent);
}

.story-link,
.story-citation a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.story-link:hover,
.story-citation a:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Section divider + Timeline
   Hidden until the story finishes, then fade in together as one reveal —
   no typing effect here, this is "the rest of the site" in standard format.
   -------------------------------------------------------------------------- */

.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-inline: var(--edge-padding);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.section-divider.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-divider--partial {
  width: 120px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Events + Subscribe
   Left column scrolls with the page; right column stays sticky in view.
   Both sit directly on the page background — no card/box styling — so only
   the content itself appears to move, not a visible container.
   -------------------------------------------------------------------------- */

.events {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.events.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.events-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 720px) {
  .events-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

.events-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.events-loading {
  color: var(--color-text-muted);
}

.event-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  width: 100px;
  margin-inline: auto;
}

.subscribe-column {
  position: sticky;
  top: var(--space-lg);
}

@media (max-width: 720px) {
  .subscribe-column {
    position: static;
  }
}

.event-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.event-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.event-title {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  /* Real event names are proper nouns, not short section labels —
     exempted from the global lowercase title transform, same reasoning
     as .story-heading. */
  text-transform: none;
}

.event-image-link {
  display: block;
}

.event-image-link:hover .event-image,
.event-image-link:focus-visible .event-image {
  opacity: 0.85;
}

.event-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.event-title-link:hover,
.event-title-link:focus-visible {
  color: var(--color-accent-alt);
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.event-meta .material-symbols-outlined {
  font-size: 1.1rem;
  color: var(--color-accent-alt);
}

.event-rsvp {
  align-self: flex-start;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  padding-block: 0.25rem;
}

.full-calendar-btn {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.full-calendar-btn:hover,
.full-calendar-btn:focus-visible {
  opacity: 0.85;
}

.subscribe-description {
  margin-top: var(--space-md);
  max-width: 60ch;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 220px;
}

.form-label {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.form-input {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.05);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.subscribe-form .text-btn {
  flex: 0 0 auto;
  padding-block: 0.6rem;
}

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

/* --------------------------------------------------------------------------
   What is [e]colodge?
   -------------------------------------------------------------------------- */

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 300,
    'GRAD' 0,
    'opsz' 40;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--color-accent-alt);
  display: inline-block;
}

.what {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.what.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (max-width: 720px) {
  .what-grid {
    grid-template-columns: 1fr;
  }
}

.what-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

/* --------------------------------------------------------------------------
   Core principles
   -------------------------------------------------------------------------- */

.principles {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.principles.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (max-width: 720px) {
  .principles-grid {
    grid-template-columns: 1fr;
  }
}

.principle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}

.principle-card .material-symbols-outlined {
  margin-bottom: var(--space-xs);
}

.principle-title {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  margin-bottom: var(--space-xs);
  /* family/weight/lowercase inherited from the global h3 rule */
}

/* --------------------------------------------------------------------------
   Coleads
   -------------------------------------------------------------------------- */

.coleads {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.coleads.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.coleads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (max-width: 720px) {
  .coleads-grid {
    grid-template-columns: 1fr;
  }
}

.colead-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}

.colead-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-xs);
}

.colead-name {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  /* family/weight/lowercase inherited from the global h3 rule */
}

.colead-pronouns {
  font-weight: 300;
  color: var(--color-text-muted);
}

.colead-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Supported by
   -------------------------------------------------------------------------- */

.supported {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.supported.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.supported-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-md);
  text-align: center;
}

@media (max-width: 720px) {
  .supported-links {
    grid-template-columns: 1fr;
  }
}

.supported-link {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--color-accent-alt);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.supported-link:hover,
.supported-link:focus-visible {
  color: var(--color-text);
  text-decoration-color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.icon-filled {
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 20;
}

.footer-heart {
  font-size: 1rem;
  vertical-align: -0.15em;
  color: var(--color-accent-alt);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.site-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-made,
.footer-copyright {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.timeline {
  padding-block: var(--space-md) var(--space-lg);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.timeline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 62ch;
  margin-top: var(--space-md);
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.story-actions.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.text-btn {
  font-family: var(--font-mono);
  font-weight: 300; /* Mono Light, matches logo type */
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  letter-spacing: 0.02em;
  color: var(--color-text);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.text-btn .bracket {
  color: var(--color-accent);
}

.text-btn:hover:not(:disabled),
.text-btn:focus-visible {
  color: var(--color-accent);
}

.text-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.text-btn:focus-visible {
  outline: 1px dashed var(--color-accent);
  outline-offset: 6px;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .splash,
  .splash-inner,
  .terminal,
  .skip-terminal-btn,
  .main-content,
  .enter-btn,
  .rotate-word,
  .story-actions,
  .text-btn,
  .section-divider,
  .timeline,
  .events,
  .what,
  .principles,
  .coleads,
  .supported,
  .site-footer {
    transition: none !important;
  }

  .type-cursor {
    animation: none !important;
    display: none !important;
  }
}
