/* ============================== Base Layout ============================== */

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #f5f5f5;
}

/* Headings & footer text switch to Nunito Sans for contrast */
h1,
h2,
.site-footer {
  font-family: 'Nunito Sans', 'Inter', 'Segoe UI', sans-serif;
}

body {
  background: #000;
}

#heroCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  object-fit: cover;
  z-index: -1;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ============================= Hero Background Modes ============================= */

body.static-hero {
  background: #000;
}

body.static-hero::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  background-image: url("img/dam-sunset-sm.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  pointer-events: none;
}

body.static-hero #heroCanvas,
#heroCanvas.is-hidden {
  display: none;
}

body.static-hero {
  position: relative;
}

body.hero-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  background: #000 url("frames/frame_0001.webp") center/cover no-repeat;
  z-index: -2;
  pointer-events: none;
}

/* ============================= Header & Footer ============================= */

.site-header,
.site-footer {
  position: fixed;
  left: 0;
  width: 100%;
  z-index: 10;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  
}

.site-header {
  top: 0;
  border-bottom: solid 1px #444;
  padding: 1rem 1.5rem;
}

.site-footer {
  bottom: 0;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.6rem;
  text-align: center;
  color: #333;
}

.header-inner {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 300;
  font-size: 1.25rem;
  letter-spacing: 0.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  text-transform: uppercase;
  flex-shrink: 1;
  flex-grow: 0;
  min-width: 0;

  /* Brushed-metal text effect */
  background: linear-gradient(145deg, #e0d1a8, #c5a96d, #a7894b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0px 1px 2px rgba(0,0,0,0.6);
}

.brand::before,
.brand::after {
  content: '★';
  font-size: 0.4em;
}

body.static-hero .brand::before,
body.static-hero .brand::after {
  content: none;
}

.brand-location {
  letter-spacing: 0.14em;
  font-size: 0.9em;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

/* ============================= Main Content Wrapper ============================= */

main {
  min-height: 320vh;
  padding: 120px clamp(1.5rem, 6vw, 6rem) 120px;
  box-sizing: border-box;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ======================== Timeline Layout ======================== */

.timeline-rail {
  --spine-left: clamp(0.45rem, 2vw, 1rem);
  --connector-width: clamp(1rem, 3.5vw, 1.9rem);
  --card-offset: clamp(0.5rem, 1.5vw, 0.85rem);
  max-width: 100%;
  margin: 0 auto clamp(4rem, 8vw, 6rem);
  padding-left: calc(var(--spine-left) + var(--connector-width) + var(--card-offset));
  box-sizing: border-box;
}

/* Intro section shares the same horizontal rail alignment */
.timeline-intro {
  margin-top: clamp(1rem, 3vw, 2rem);
  display: block;
}

.intro-card {
  /* Introductory stats card shares timeline glassmorphism treatment */
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  padding: clamp(1.75rem, 4vw, 3rem);
  max-width: 720px;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intro-eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.intro-card h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.intro-card p {
  margin: 0;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Timeline sequence aligned to the vertical spine */
.timeline {
  --connector-y: clamp(1.2rem, 3vw, 1.9rem);
  position: relative;
  display: grid;
  gap: clamp(4rem, 6vw, 8rem);
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--spine-left);
  top: var(--connector-y);
  bottom: 0; /* Stretch to full height */
  width: 3px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.2)
  );
}

.timeline-item {
  position: relative;
  display: block;
}

body.static-hero .intro-card,
body.static-hero .timeline-content {
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 24px 36px rgba(0, 0, 0, 0.5);
}

.timeline-item::before {
  content: "";
  position: absolute;
  /* Position dot back onto the main spine */
  left: calc(-1 * (var(--connector-width) + var(--card-offset)) - 2px);
  top: calc(var(--connector-y) - 2px); /* Center the dot on the connector */
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
  z-index: 5;
}

/* Hide the timeline dot for the intro card, which isn't part of the timeline. */
.timeline-intro .timeline-item::before {
  content: none;
}

/* Card styling shared by timeline entries and intro stats */
.timeline-content {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px; /* keep previous column-1 visual width */
}

/* Horizontal connector linking each card back to the spine */
.timeline-content::before {
  content: "";
  position: absolute;
  left: calc(-1 * (var(--connector-width) + var(--card-offset))); /* Extend from card to spine */
  top: var(--connector-y);
  width: calc(var(--connector-width) + var(--card-offset));
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  z-index: -1;
}

.timeline-content h1,
.timeline-content h2 {
  margin: 0;
  font-size: clamp(1rem, 3vw, 2rem);
}

/* Reserve space for top-right date on h2 headings */
.timeline-content h2 {
  padding-right: clamp(4rem, 12vw, 8rem);
}

/* Subtle date badge in top-right of each card */
.timeline-date {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.1rem);
  right: clamp(0.75rem, 2vw, 1.1rem);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.timeline-content .subtitle {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.75);
}

.timeline-content p {
  margin: 0;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Marked for review (unused): timeline-media */
/*
.timeline-media {
  margin: 0;
  padding: 0;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  min-height: 180px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}
*/

/* Marked for review (unused): demo-box layout */
/*
.demo-box {
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem);
}

.demo-box h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
}
*/

/* Metrics list displayed inside the intro card */
.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.data-list li {
  line-height: 1.6;
}

/* ======================== Tablet Breakpoint (≤820px) ======================== */
@media (max-width: 820px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
  }

  .brand {
    width: 100%;
    text-align: center;
    letter-spacing: 0.22em;
  }

  /* Let timeline content span available width on tablets */
  .timeline-content {
    max-width: 100%;
  }

}

/* ======================== Small-Screen Breakpoint (≤600px) ======================== */
@media (max-width: 600px) {
  .site-header,
  .site-footer {
    padding: 0.75rem 1rem;
  }

  .brand {
    font-size: 1.05rem;
    letter-spacing: 0.18em;
  }

  .brand::before,
  .brand::after {
    content: none;
  }

  .brand-location {
    display: none;
  }

  main {
    padding-top: 140px;
    padding-bottom: 140px;
  }

  .timeline-rail {
    --spine-left: 1.5rem;
    --card-offset: 0.6rem;
    --connector-width: 1.2rem;
    padding-left: calc(var(--spine-left) + var(--connector-width) + var(--card-offset));
    gap: 2rem;
  }

  .timeline-intro {
    margin-top: 0;
  }

  /* Keep connector alignment consistent on small screens */
  .timeline { --connector-y: 1.2rem; }

  /* Marked for review (unused): intro-media responsive adjustments */
  /*
  .timeline-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .intro-media {
    height: auto;
    min-height: 140px;
  }

  .timeline-media {
    min-height: 140px;
  }
  */
}
