:root {
  --umber: #2c2416;
  --walnut: #3d3222;
  --bronze: #564a38;
  --ivory: #f0e6d3;
  --amber: #e8a832;
  --cyan: #4ecdc4;
  --coral: #e85d44;
  --bubble: #8fd6ca;
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Bebas Neue", Impact, sans-serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #2c2416 0%, #3d3222 40%, #2c2416 100%);
  overflow-x: hidden;
}

body.intro-complete .opening { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.intro-complete .timeline { opacity: 1; transform: translateY(0); }
body.intro-complete .site-header { transform: translateY(0); }

.texture-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(240,230,211,0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 70%, rgba(232,168,50,0.8) 0 1px, transparent 1.7px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.6) 0 0.8px, transparent 1.4px);
  background-size: 80px 80px, 120px 120px, 44px 44px;
}

.bubble-field { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(143, 214, 202, 0.25), rgba(78, 205, 196, 0.08), transparent 70%);
  box-shadow: inset 0 -4px 12px rgba(255,255,255,0.1), 0 0 20px rgba(78,205,196,0.08);
  backdrop-filter: blur(2px);
  will-change: transform;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  z-index: 5;
  padding: 0 clamp(24px, 4vw, 80px);
  background: rgba(44, 36, 22, 0.88);
  border-bottom: 1px solid rgba(232, 168, 50, 0.18);
  backdrop-filter: blur(10px);
  transform: translateY(-100%);
  transition: transform 700ms ease-out;
}

.header-title {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  color: var(--ivory);
}

.header-line { height: 1px; background: linear-gradient(90deg, #e8a832, transparent); }

.header-era {
  font-family: var(--mono);
  color: rgba(240,230,211,0.65);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

.opening {
  position: fixed;
  inset: 0;
  z-index: 4;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #2c2416;
  transition: transform 900ms cubic-bezier(.19,1,.22,1), opacity 900ms ease-out;
}

.opening-panel { text-align: center; padding: 32px; position: relative; z-index: 1; }

.opening-label {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8fd6ca;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; margin: 0; line-height: 0.95; }

h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  letter-spacing: 0.08em;
  color: #f0e6d3;
  text-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.tagline {
  margin: 24px 0 28px;
  font-style: italic;
  color: rgba(240,230,211,0.86);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.bauhaus-shapes, .divider-shapes { display: inline-flex; gap: 16px; align-items: center; }
.shape, .divider-shapes span { display: block; width: 24px; height: 24px; opacity: 0; animation: shape-in 600ms ease-out forwards; }
.shape:nth-child(2), .divider-shapes span:nth-child(2) { animation-delay: 200ms; }
.shape:nth-child(3), .divider-shapes span:nth-child(3) { animation-delay: 400ms; }
.circle, .divider-shapes span:nth-child(1) { border-radius: 50%; background: #e8a832; }
.square, .divider-shapes span:nth-child(2) { background: #e85d44; }
.triangle, .divider-shapes span:nth-child(3) { width: 0; height: 0; background: transparent; border-left: 13px solid transparent; border-right: 13px solid transparent; border-bottom: 24px solid #4ecdc4; }

@keyframes shape-in { from { opacity: 0; transform: translateY(12px) rotate(-8deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }

.opening-geometry { position: absolute; opacity: 0.28; }
.opening-geometry-one { width: 34vmin; height: 34vmin; border: 2px solid #e8a832; left: 7vw; top: 12vh; }
.opening-geometry-two { width: 28vmin; height: 28vmin; border-radius: 50%; border: 2px solid #4ecdc4; right: 8vw; bottom: 10vh; }

.timeline {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 110px clamp(24px, 4vw, 80px) 90px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms ease-out 180ms, transform 900ms ease-out 180ms;
}

.era-heading { margin: 0 0 30px; border-left: 4px solid #e8a832; padding-left: 22px; }
.era-kicker, .date, .related {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.era-kicker { color: #4ecdc4; }
.era-heading h2 { font-size: clamp(2.5rem, 6vw, 5rem); letter-spacing: 0.08em; margin: 8px 0 20px; }

.masonry-grid { column-count: 3; column-gap: 20px; }

.history-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 20px;
  padding: 24px;
  z-index: 1;
  background: #3d3222;
  border: 1px solid rgba(232, 168, 50, 0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  break-inside: avoid;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms ease-out, transform 200ms ease-out, background 200ms ease-out, box-shadow 400ms ease-out;
}

.history-card.visible { opacity: 1; transform: translateY(0); }
.history-card.hidden-card { display: none; }
.history-card.released { display: inline-block; }
.history-card:hover { transform: scale(1.01); background: #564a38; box-shadow: 0 8px 28px rgba(0,0,0,0.22); }
.history-card.depth-shadow { box-shadow: 0 8px 34px rgba(0,0,0,0.25); }

.history-card.short { min-height: 200px; }
.history-card.medium { min-height: 300px; }
.history-card.tall { min-height: 430px; }
.history-card.large { min-height: 520px; }

.corner { position: absolute; width: 34px; height: 34px; opacity: 0.45; transition: opacity 200ms ease-out; }
.corner.top { top: 10px; left: 10px; border-top: 2px solid #e8a832; border-left: 2px solid #e8a832; }
.corner.bottom { right: 10px; bottom: 10px; border-right: 2px solid #e8a832; border-bottom: 2px solid #e8a832; }
.history-card:hover .corner, .history-card.expanded-card .corner { opacity: 1; }

.date { margin: 0 0 16px; color: #e85d44; }
.history-card h3 { font-size: clamp(2.1rem, 4vw, 3.4rem); letter-spacing: 0.06em; color: #f0e6d3; margin-bottom: 16px; }
.excerpt { margin: 0; color: rgba(240,230,211,0.7); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 500ms ease-out, opacity 350ms ease-out;
  opacity: 0;
}

.expanded p:first-child { margin-top: 22px; }
.expanded a { color: #e8a832; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.related { color: #4ecdc4; line-height: 1.5; }
.history-card.expanded-card .expanded { max-height: 620px; opacity: 1; }
.history-card.expanded-card .excerpt { color: rgba(240,230,211,0.88); }

.progress-wrap { position: fixed; left: 0; right: 0; bottom: 0; height: 3px; z-index: 6; background: rgba(44,36,22,0.65); }
.progress-bar { width: 0%; height: 100%; background: #e8a832; box-shadow: 0 0 16px rgba(232,168,50,0.55); }

@media (max-width: 900px) {
  .masonry-grid { column-count: 2; }
  .header-era { display: none; }
  .site-header { grid-template-columns: auto 1fr; }
}

@media (max-width: 620px) {
  .masonry-grid { column-count: 1; }
  .timeline { padding-top: 88px; }
  .opening-panel { padding: 22px; }
  .history-card.large, .history-card.tall { min-height: 360px; }
}
