:root {
  --wine: #1c0e12;
  --wine-mid: #3a1820;
  --wine-hot: #6b2d38;
  --rug: #4a1f28;
  --cream: #f4e6c8;
  --cream-soft: #efe0c4;
  --parchment: #f7efe4;
  --tan: #c4925a;
  --caramel: #d4a574;
  --fur: #e8c48a;
  --ink: #1a1410;
  --mute: #c9b59a;
  --shadow: rgba(12, 6, 8, 0.55);
  --display: "Chewy", "Trebuchet MS", cursive;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --body: "Quicksand", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--body);
  background: var(--wine);
  overflow-x: hidden;
}

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

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

.den {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(244, 230, 200, 0.22), transparent 58%),
    radial-gradient(circle at 12% 80%, rgba(107, 45, 56, 0.4), transparent 42%),
    radial-gradient(circle at 88% 70%, rgba(196, 146, 90, 0.12), transparent 38%),
    linear-gradient(180deg, #14090c 0%, #1c0e12 40%, #241016 100%);
}

.lampcone {
  position: absolute;
  left: 50%;
  top: -8%;
  width: 70vw;
  height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at top, rgba(245, 217, 168, 0.28), transparent 68%);
  filter: blur(8px);
  animation: lamp-breathe 7s ease-in-out infinite;
}

.kilim {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(196, 146, 90, 0.18) 18px 20px),
    repeating-linear-gradient(-45deg, transparent 0 28px, rgba(107, 45, 56, 0.35) 28px 30px),
    radial-gradient(circle at 25% 30%, rgba(232, 196, 138, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 60%, rgba(232, 196, 138, 0.1) 0 2px, transparent 3px);
  background-size: auto, auto, 90px 90px, 120px 120px;
  animation: kilim-drift 40s linear infinite;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

.motes,
.huh-field {
  position: absolute;
  inset: 0;
}

.huh-bubble {
  position: absolute;
  font-family: var(--hand);
  color: rgba(243, 226, 196, 0.22);
  white-space: nowrap;
  animation: rise-huh linear infinite;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 180px 40px rgba(10, 4, 6, 0.72);
}

.grain {
  position: absolute;
  inset: -20%;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.4s steps(2) infinite;
}

.topbar,
main,
.floor {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(28, 14, 18, 0.72);
  border-bottom: 1px solid rgba(232, 196, 138, 0.14);
  backdrop-filter: blur(16px);
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}

.mark img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--fur);
  box-shadow: 0 0 0 3px rgba(74, 31, 40, 0.7);
}

.links {
  display: flex;
  gap: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.links a {
  position: relative;
  color: var(--mute);
  transition: color 0.25s ease;
}

.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--tan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

.links a:hover,
.links a:focus-visible {
  color: var(--cream);
}

.links a:hover::after,
.links a:focus-visible::after {
  transform: scaleX(1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(243, 226, 196, 0.22);
  background: rgba(58, 24, 32, 0.7);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glyph img {
  width: 16px;
  height: 16px;
}

.glyph:hover {
  transform: translateY(-2px) rotate(-6deg);
  box-shadow: 0 8px 20px rgba(196, 146, 90, 0.25);
}

.bone {
  font-family: var(--display);
  font-size: 1rem;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, #f0d2a0, #c4925a);
  box-shadow: 0 8px 0 #5c2a22, 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bone:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #5c2a22, 0 16px 28px rgba(0, 0, 0, 0.4);
}

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  margin: 6px 8px;
  background: var(--cream);
}

.hearth {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 20px 80px;
  position: relative;
}

.thought-ring {
  position: absolute;
  width: min(720px, 92vw);
  height: min(720px, 92vw);
  border-radius: 50%;
  animation: spin-slow 36s linear infinite;
  pointer-events: none;
}

.thought-ring span {
  position: absolute;
  left: 50%;
  top: 50%;
  font-family: var(--hand);
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  color: rgba(243, 226, 196, 0.28);
  transform-origin: 0 0;
}

.thought-ring span:nth-child(1) { transform: rotate(0deg) translate(250px) rotate(0deg); }
.thought-ring span:nth-child(2) { transform: rotate(60deg) translate(250px) rotate(-60deg); }
.thought-ring span:nth-child(3) { transform: rotate(120deg) translate(250px) rotate(-120deg); }
.thought-ring span:nth-child(4) { transform: rotate(180deg) translate(250px) rotate(-180deg); }
.thought-ring span:nth-child(5) { transform: rotate(240deg) translate(250px) rotate(-240deg); }
.thought-ring span:nth-child(6) { transform: rotate(300deg) translate(250px) rotate(-300deg); }

.sitspot {
  position: relative;
  width: min(340px, 72vw);
  margin-bottom: 28px;
}

.rug-halo {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(232, 196, 138, 0.28), transparent 62%),
    repeating-conic-gradient(from 0deg, rgba(107, 45, 56, 0.35) 0 12deg, transparent 12deg 24deg);
  animation: halo-spin 22s linear infinite, halo-pulse 4.5s ease-in-out infinite;
  filter: blur(0.2px);
}

.portrait {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  aspect-ratio: 1;
  border: 6px solid #f3e2c4;
  box-shadow:
    0 0 0 10px rgba(74, 31, 40, 0.8),
    0 24px 50px rgba(0, 0, 0, 0.45);
  animation: sit-tilt 6s ease-in-out infinite;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: scale(1.08);
}

.speech {
  position: absolute;
  right: -8%;
  top: 6%;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--ink);
  background: var(--cream);
  padding: 8px 16px 10px;
  border-radius: 22px 22px 22px 6px;
  box-shadow: 6px 8px 0 #5c2a22;
  animation: huh-pop 3.4s ease-in-out infinite;
}

.chain-tag,
.eyebrow {
  font-family: var(--hand);
  color: var(--fur);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.hearth h1,
.section-head h2 {
  font-family: var(--display);
  line-height: 0.92;
  letter-spacing: 0.03em;
}

.hearth h1 {
  font-size: clamp(4.2rem, 13vw, 8.4rem);
  margin: 8px 0 4px;
  text-shadow: 0 8px 0 rgba(74, 31, 40, 0.85), 0 18px 40px rgba(0, 0, 0, 0.35);
  animation: title-wobble 5s ease-in-out infinite;
}

.ticker {
  display: inline-block;
  margin: 6px 0 14px;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
  background: var(--fur);
  animation: chip-bob 3s ease-in-out infinite;
}

.lede {
  max-width: 620px;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--cream-soft);
  margin-bottom: 22px;
}

.ca-plate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(620px, 92vw);
  padding: 10px 14px;
  border: 1px solid rgba(243, 226, 196, 0.2);
  border-radius: 14px;
  background: rgba(28, 14, 18, 0.55);
  color: var(--cream);
  cursor: pointer;
  font: inherit;
  margin-bottom: 26px;
}

.ca-plate span {
  font-family: var(--display);
  color: var(--tan);
}

.ca-plate code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.leash,
.pack-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 18px;
  border-radius: 16px;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.cta img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.cta.tan {
  color: var(--ink);
  background: linear-gradient(180deg, #f0d2a0, #c4925a);
  box-shadow: 0 7px 0 #5c2a22;
}

.cta.cream {
  color: var(--cream);
  background: rgba(58, 24, 32, 0.78);
  border: 1px solid rgba(243, 226, 196, 0.22);
}

.cta:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.cta.wide {
  min-width: 240px;
  justify-content: center;
}

.settle,
.trail,
.windowpane,
.pack {
  padding: 88px 22px;
  max-width: 1120px;
  margin: 0 auto;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 42px;
}

.section-head h2 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 8px 0 14px;
}

.sub {
  color: var(--mute);
  font-size: 1.05rem;
}

.story-grid,
.paw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.story-card,
.step,
.huh-quote,
.chart-frame,
.billfold {
  background:
    linear-gradient(180deg, rgba(247, 239, 228, 0.08), rgba(58, 24, 32, 0.55)),
    rgba(36, 16, 22, 0.72);
  border: 1px solid rgba(243, 226, 196, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.story-card,
.step {
  padding: 24px 22px 26px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.story-card.show,
.step.show,
.huh-quote.show,
.chart-frame.show,
.billfold.show {
  opacity: 1;
  transform: none;
}

.story-card h3,
.step h3 {
  font-family: var(--display);
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.story-card p,
.step p {
  color: var(--mute);
  line-height: 1.6;
}

.huh-quote {
  margin-top: 22px;
  padding: 32px 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.huh-quote p {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  animation: title-wobble 4s ease-in-out infinite;
}

.huh-quote cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: var(--hand);
  color: var(--fur);
}

.paw-steps {
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  position: relative;
}

.paw-steps::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 8%;
  right: 8%;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--tan) 0 14px, transparent 14px 26px);
  opacity: 0.45;
}

.step {
  position: relative;
  text-align: center;
}

.step-num {
  display: inline-block;
  font-family: var(--display);
  color: var(--tan);
  margin-bottom: 10px;
}

.step img {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  animation: icon-nudge 3.6s ease-in-out infinite;
}

.step a {
  display: inline-block;
  margin-top: 14px;
  color: var(--fur);
  font-weight: 700;
  border-bottom: 1px dashed rgba(232, 196, 138, 0.45);
}

.chart-frame {
  overflow: hidden;
  min-height: 620px;
  padding: 10px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.chart-frame iframe {
  width: 100%;
  height: 600px;
  border: 0;
  border-radius: 16px;
  background: #0b0e11;
}

.billfold {
  aspect-ratio: 3 / 1;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.billfold img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: banner-drift 18s ease-in-out infinite;
}

.pack-row {
  margin-top: 26px;
}

.floor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px 56px;
  text-align: center;
  color: var(--mute);
  border-top: 1px solid rgba(243, 226, 196, 0.1);
}

.floor img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  border: 2px solid var(--fur);
}

.fine {
  font-size: 0.85rem;
  opacity: 0.75;
}

@keyframes lamp-breathe {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@keyframes kilim-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 120px 80px, -80px 120px, 40px 40px, -40px 60px; }
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2%, 2%); }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes halo-spin {
  to { transform: rotate(360deg); }
}

@keyframes halo-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes sit-tilt {
  0%, 100% { transform: rotate(-2.2deg) translateY(0); }
  50% { transform: rotate(2.2deg) translateY(-8px); }
}

@keyframes huh-pop {
  0%, 100% { transform: rotate(8deg) scale(1); }
  50% { transform: rotate(-4deg) scale(1.08); }
}

@keyframes title-wobble {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

@keyframes chip-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes icon-nudge {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-6deg); }
}

@keyframes banner-drift {
  0%, 100% { transform: scale(1.04) translateY(0); }
  50% { transform: scale(1.1) translateY(-2%); }
}

@keyframes rise-huh {
  0% { transform: translateY(20vh); opacity: 0; }
  15% { opacity: 0.7; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

@media (max-width: 980px) {
  .story-grid,
  .paw-steps {
    grid-template-columns: 1fr 1fr;
  }

  .paw-steps::before {
    display: none;
  }

  .thought-ring {
    opacity: 0.45;
  }
}

@media (max-width: 760px) {
  .links {
    display: none;
    position: absolute;
    top: 70px;
    left: 12px;
    right: 12px;
    padding: 16px;
    flex-direction: column;
    background: rgba(28, 14, 18, 0.96);
    border: 1px solid rgba(243, 226, 196, 0.16);
    border-radius: 16px;
  }

  .topbar.open .links {
    display: flex;
  }

  .burger {
    display: block;
  }

  .story-grid,
  .paw-steps {
    grid-template-columns: 1fr;
  }

  .chart-frame,
  .chart-frame iframe {
    min-height: 460px;
    height: 460px;
  }

  .speech {
    right: -2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
