/* ==========================================================
   Lafitte's Blacksmith Shop Bar — staging build
   Palette drawn from the building itself:
   soot, tallow candlelight, brick, the slate roof, limewash
   ========================================================== */

:root {
  --pitch:      #0A0908;
  --soot:       #12100C;
  --brick:      #8A4630;
  --brick-dim:  #5C2F20;
  --slate:      #59696F;
  --tallow:     #E9AB53;
  --flame:      #FFD489;
  --limewash:   #E6DCC7;
  --muted:      #9C8B72;

  --display: 'IM Fell English', Georgia, serif;
  --body:    'EB Garamond', Georgia, serif;

  --measure: 63ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  /* how far the candle has burned down — driven by scroll */
  --burn: 0%;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pitch);
  color: var(--limewash);
  font-family: var(--body);
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.24rem);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--tallow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--tallow); outline-offset: 3px; }

.wrap { width: min(100% - (var(--gutter) * 2), 74rem); margin-inline: auto; }

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--gutter);
  background: rgba(10, 9, 8, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(138, 70, 48, 0.35);
}

.masthead__mark {
  font-family: var(--display);
  font-size: 1.18rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--limewash);
  text-decoration: none;
  white-space: nowrap;
}

.masthead__nav { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2.4vw, 2rem); }

.masthead__nav a {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
}

.masthead__nav a:hover,
.masthead__nav a[aria-current="page"] { color: var(--tallow); border-bottom-color: var(--brick); }

/* ---------- hero: the building at night ---------- */

.hero {
  position: relative;
  min-height: min(96svh, 52rem);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter) clamp(4rem, 14vh, 9rem);
  overflow: hidden;
  text-align: center;
  background-color: var(--pitch);
  background-image: url('building.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

/* darkness poured over the top so the type has somewhere to sit */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10, 9, 8, 0.97) 0%,
      rgba(10, 9, 8, 0.92) 26%,
      rgba(10, 9, 8, 0.66) 44%,
      rgba(10, 9, 8, 0.24) 62%,
      rgba(10, 9, 8, 0.05) 80%,
      rgba(10, 9, 8, 0.45) 100%),
    radial-gradient(58% 42% at 50% 22%, rgba(233, 171, 83, 0.16) 0%, transparent 72%);
  pointer-events: none;
}

/* keep the edges dark so the engraving never ends on a hard line */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 70%, transparent 42%, rgba(10, 9, 8, 0.85) 100%);
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 2; max-width: 52rem; }

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.7rem, 1.5rem + 6vw, 6.2rem);
  line-height: 0.94;
  margin: 0 0 1.3rem;
  color: var(--limewash);
  text-shadow: 0 0 50px rgba(10, 9, 8, 0.95), 0 0 22px rgba(10, 9, 8, 0.9);
}

.hero h1 em {
  display: block;
  font-style: italic;
  font-size: 0.46em;
  letter-spacing: 0.06em;
  color: var(--tallow);
  margin-bottom: 0.32em;
}

.hero__claim {
  font-size: clamp(1.08rem, 1rem + 0.5vw, 1.38rem);
  margin: 0 auto 0.55rem;
  max-width: 34ch;
  text-shadow: 0 0 26px rgba(10, 9, 8, 0.95);
}

.hero__sub {
  color: var(--muted);
  font-style: italic;
  margin: 0 auto 2.3rem;
  max-width: 40ch;
  text-shadow: 0 0 24px rgba(10, 9, 8, 0.95);
}

.rule-flame {
  width: 1px;
  height: 3rem;
  margin: 0 auto 3.4rem;
  background: linear-gradient(to bottom, transparent, var(--brick) 40%, var(--tallow));
}

.btn {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--flame);
  text-decoration: none;
  padding: 1rem 2.2rem;
  border: 1px solid var(--brick);
  background: #0A0908;
  box-shadow: 0 0 40px 18px rgba(10, 9, 8, 0.9);
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease;
}

.btn:hover { background: #1A120C; border-color: var(--tallow); color: var(--limewash); }

/* ---------- generic sections ---------- */

.band { padding: clamp(4rem, 11vh, 7.5rem) 0; }
.band--soot { background: var(--soot); }
.band--edge { border-top: 1px solid rgba(138, 70, 48, 0.3); }

.band h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem);
  line-height: 1.06;
  margin: 0 0 1.6rem;
  color: var(--limewash);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.25rem; }
.prose p:last-child { margin-bottom: 0; }

.split { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 4.5rem); }

@media (min-width: 56rem) {
  .split { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

/* ---------- Lafitte, beside his own account ---------- */

.portrait { margin: 0; }

.portrait img {
  width: min(100%, 22rem);
  margin-inline: auto;
  /* he dissolves into the dark rather than ending on an edge */
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 40%, #000 52%, rgba(0,0,0,0.55) 74%, transparent 92%);
  mask-image: radial-gradient(ellipse 60% 56% at 50% 40%, #000 52%, rgba(0,0,0,0.55) 74%, transparent 92%);
}

.portrait figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
  max-width: 24rem;
  margin-inline: auto;
}

/* ---------- pull quote — their own line ---------- */

.gumbo {
  padding: clamp(4rem, 10vh, 7rem) 0;
  background:
    radial-gradient(70% 100% at 50% 50%, rgba(138, 70, 48, 0.18), transparent 72%),
    var(--pitch);
  text-align: center;
}

.gumbo blockquote {
  margin: 0 auto;
  max-width: 46rem;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 1.05rem + 1.6vw, 2.35rem);
  line-height: 1.34;
  color: var(--limewash);
}

.gumbo cite {
  display: block;
  margin-top: 1.8rem;
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- merchandise ---------- */

.goods {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(230, 220, 199, 0.14);
  max-width: 34rem;
}

.goods li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(230, 220, 199, 0.14);
}

.goods__price { font-family: var(--display); font-size: 1.15rem; color: var(--tallow); white-space: nowrap; }

.note { margin-top: 1.6rem; color: var(--muted); }

/* ---------- visit ---------- */

.facts { margin: 0; padding: 0; display: grid; gap: 1.6rem; }

@media (min-width: 44rem) {
  .facts { grid-template-columns: repeat(3, 1fr); gap: 2.4rem; }
}

.facts__label {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.facts__value {
  font-family: var(--display);
  font-size: 1.24rem;
  line-height: 1.4;
  color: var(--limewash);
  margin: 0;
}

/* ---------- the taper: history timeline ---------- */

.taper-intro { padding: clamp(4.5rem, 13vh, 8.5rem) 0 clamp(2.5rem, 6vh, 4rem); text-align: center; }

.taper-intro h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.5rem + 4.2vw, 4.6rem);
  line-height: 1.0;
  margin: 0 0 1.3rem;
  color: var(--limewash);
}

.taper-intro p { max-width: 44ch; margin: 0 auto; color: var(--muted); font-style: italic; }

.timeline { position: relative; padding-bottom: clamp(4rem, 12vh, 8rem); }

.timeline__grid {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: clamp(1.4rem, 4vw, 3.5rem);
  align-items: start;
}

@media (min-width: 60rem) {
  .timeline__grid { grid-template-columns: 64px 1fr; }
}

/* ---- the candle ---- */

.taper { position: relative; height: 100%; width: 100%; justify-self: center; }

/* the wax exists only below the flame — everything above it has burned away.
   clipping instead of covering means no black rectangle sits inside the glow. */
.taper__stick {
  position: absolute;
  inset: 0;
  width: 22px;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  clip-path: inset(var(--burn) 0 0 0 round 0 0 4px 4px);
  background:
    linear-gradient(90deg,
      rgba(92, 83, 68, 0.30) 0%,
      rgba(150, 138, 116, 0.60) 8%,
      rgba(214, 201, 172, 0.88) 22%,
      rgba(248, 240, 221, 0.98) 38%,
      rgba(255, 252, 243, 1)    47%,
      rgba(240, 230, 206, 0.95) 58%,
      rgba(196, 182, 154, 0.80) 74%,
      rgba(126, 115, 95, 0.55)  88%,
      rgba(72, 65, 53, 0.35)   100%);
}

@media (min-width: 60rem) { .taper__stick { width: 28px; } }

/* wax that has run down the side and set */
.taper__stick::before,
.taper__stick::after {
  content: "";
  position: absolute;
  border-radius: 50% 50% 46% 46% / 14% 14% 86% 86%;
  background: linear-gradient(90deg,
    rgba(160, 148, 124, 0.35),
    rgba(250, 243, 226, 0.75) 45%,
    rgba(190, 176, 148, 0.30));
  filter: blur(0.4px);
  pointer-events: none;
}

.taper__stick::before { left: -3px; top: 30%; width: 7px; height: 74px; }
.taper__stick::after  { right: -2px; top: 58%; width: 6px; height: 52px; }

/* the molten lip, and the light the flame throws down the wax below it */
.taper__lip {
  position: absolute;
  top: var(--burn);
  left: 50%;
  translate: -50% 0;
  width: 40px;
  height: 110px;
  z-index: 3;
  pointer-events: none;
}

.taper__lip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  translate: -50% 0;
  width: 32px;
  height: 14px;
  border-radius: 50% 50% 44% 44% / 58% 58% 42% 42%;
  background:
    radial-gradient(64% 92% at 50% 22%, rgba(255, 219, 158, 0.75), transparent 72%),
    linear-gradient(90deg,
      rgba(168, 154, 128, 0.55),
      rgba(255, 252, 243, 1) 46%,
      rgba(186, 172, 144, 0.6));
  box-shadow: 0 3px 18px rgba(233, 171, 83, 0.45);
}

/* the wax glows where the flame is closest to it */
.taper__lip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  translate: -50% 0;
  width: 22px;
  height: 108px;
  background: linear-gradient(to bottom,
    rgba(255, 205, 130, 0.55) 0%,
    rgba(255, 205, 130, 0.22) 34%,
    rgba(255, 205, 130, 0) 100%);
}

@media (min-width: 60rem) {
  .taper__lip::before { width: 40px; height: 16px; }
  .taper__lip::after  { width: 28px; }
}

/* the wick and the flame, locked to the same burn line */
.taper__flame {
  position: absolute;
  top: var(--burn);
  left: 50%;
  translate: -50% 0;
  width: 34px;
  height: 4px;
  z-index: 4;
  pointer-events: none;
}

/* wick */
.taper__flame::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  translate: -50% 0;
  width: 2.5px;
  height: 12px;
  border-radius: 1px;
  background: linear-gradient(to bottom, #4A3524, #241A12);
}

/* flame body, sitting on the wick */
.taper__flame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  width: 17px;
  height: 36px;
  transform-origin: 50% 100%;
  border-radius: 50% 50% 46% 46% / 68% 68% 32% 32%;
  background:
    radial-gradient(circle at 50% 78%, #FFFDF4 0%, #FFF0CB 18%, var(--flame) 40%, var(--tallow) 66%, rgba(196, 110, 46, 0.5) 84%, rgba(138, 70, 48, 0) 100%);
  filter: blur(0.5px);
  animation: flicker 3.1s ease-in-out infinite;
}

@media (min-width: 60rem) {
  .taper__flame::after { width: 21px; height: 44px; }
  .taper__flame::before { height: 13px; width: 3px; }
}

/* the pool of light the flame throws */
.taper__glow {
  position: absolute;
  top: var(--burn);
  left: 50%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(233, 171, 83, 0.30) 0%,
    rgba(233, 171, 83, 0.13) 30%,
    rgba(138, 70, 48, 0.06) 52%,
    transparent 72%);
  animation: breathe 5.4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1) skewX(0deg); opacity: 1; }
  12%      { transform: scaleY(1.10) scaleX(0.95) skewX(-3deg); opacity: 0.95; }
  27%      { transform: scaleY(0.92) scaleX(1.05) skewX(2.5deg); opacity: 1; }
  41%      { transform: scaleY(1.16) scaleX(0.92) skewX(-1.5deg); opacity: 0.88; }
  58%      { transform: scaleY(0.97) scaleX(1.03) skewX(3deg); opacity: 1; }
  73%      { transform: scaleY(1.06) scaleX(0.97) skewX(-2deg); opacity: 0.93; }
  87%      { transform: scaleY(0.95) scaleX(1.02) skewX(1deg); opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.78; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

/* ---- era entries ---- */

.eras { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(4rem, 13vh, 9rem); }

.era {
  opacity: 0.24;
  filter: saturate(0.3);
  transform: translateY(14px);
  transition: opacity 700ms ease, filter 700ms ease, transform 700ms ease;
}

.era.is-lit { opacity: 1; filter: saturate(1); transform: translateY(0); }

.era__year {
  font-family: var(--display);
  font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3.4rem);
  line-height: 1;
  color: var(--tallow);
  margin: 0 0 0.15rem;
}

.era__title {
  font-size: 0.76rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.3rem;
}

.era__body { max-width: var(--measure); margin: 0; }
.era__body p { margin: 0 0 1.1rem; }
.era__body p:last-child { margin-bottom: 0; }

.era__aside {
  margin-top: 1.5rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--brick-dim);
  color: var(--muted);
  font-style: italic;
  max-width: 52ch;
}

.era--slate .era__year { color: var(--slate); }
.era--slate .era__aside { border-left-color: var(--slate); }

/* the Barataria chart */
.chart { margin: 2.6rem 0 0; }

.chart img {
  width: 100%;
  filter: brightness(1.28) contrast(1.06);
  -webkit-mask-image: radial-gradient(140% 155% at 50% 50%, #000 70%, rgba(0,0,0,0.6) 90%, transparent 100%);
  mask-image: radial-gradient(140% 155% at 50% 50%, #000 70%, rgba(0,0,0,0.6) 90%, transparent 100%);
}

@media (min-width: 68rem) {
  /* let the chart run wider than the text it sits beside */
  .chart { width: calc(100% + 8rem); max-width: none; }
}

.chart figcaption {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
  max-width: 54ch;
}

/* ---------- footer ---------- */

.foot {
  padding: clamp(3rem, 8vh, 5rem) 0 3.5rem;
  border-top: 1px solid rgba(138, 70, 48, 0.3);
  background: var(--pitch);
  color: var(--muted);
  font-size: 0.9rem;
}

.foot__grid { display: grid; gap: 2rem; }

@media (min-width: 48rem) {
  .foot__grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 3rem; }
}

.foot__mark {
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--limewash);
  margin: 0 0 0.6rem;
}

.foot h3 {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.5rem; }
.foot a { color: var(--limewash); text-decoration: none; }
.foot a:hover { color: var(--tallow); }

.foot__fine {
  margin-top: 2.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(230, 220, 199, 0.1);
  font-size: 0.78rem;
  color: #6E624F;
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .taper__flame::after,
  .taper__glow { animation: none; }
  .era { opacity: 1; filter: none; transform: none; transition: none; }
}
