/* =========================================================
   aesthetic hermit — design tokens
   ========================================================= */
:root{
  /* --- color: night hermitage --- */
  --bg:        #10131a;
  --bg-deep:   #0a0c11;
  --bg-alt:    #171b24;
  --ink:       #ece6d8;   /* parchment */
  --muted:     #8a90a3;   /* dusk blue-grey */
  --amber:     #e8a857;   /* lamp light — primary accent */
  --amber-dim: #a97a43;
  --ember:     #c15b3b;   /* secondary accent, links */
  --moss:      #5e6e52;
  --treeline:  #191d17;
  --roof:      #2a2016;
  --wall:      #3a3126;
  --wall-line: #201a12;
  --door:      #201a12;
  --window-on: #ffd28a;
  --window-off:#3c3220;

  /* --- type --- */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- layout --- */
  --edge: clamp(1.5rem, 5vw, 5rem);
  --note-w: min(560px, 88vw);
}

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

html{
  scroll-behavior: smooth;
  background: var(--bg);
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* film grain, very quiet */
.grain{
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--amber);
  color: var(--bg-deep);
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.skip-link:focus{ left: var(--edge); top: var(--edge); }

:focus-visible{
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* =========================================================
   corner mark
   ========================================================= */
.mark{
  position: fixed;
  top: 1.5rem;
  left: var(--edge);
  z-index: 60;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mark__dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px 1px var(--amber);
}

/* =========================================================
   hero
   ========================================================= */
.hero{
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #171c28 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

#sky{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene{
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: min(38vh, 300px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.treeline{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55%;
}

.firefly-field{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.firefly{
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px 2px rgba(232,168,87,0.8), 0 0 14px 6px rgba(232,168,87,0.25);
  will-change: transform, opacity;
}

.cabin{
  position: relative;
  z-index: 5;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transform: translateY(6%);
  width: clamp(140px, 18vw, 220px);
}
.cabin svg{ width: 100%; height: auto; display: block; }

.cabin .glow{
  position: absolute;
  left: 50%;
  top: 55%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,210,138,0.55) 0%, rgba(255,210,138,0.12) 40%, transparent 70%);
  pointer-events: none;
  opacity: 1;
  animation: flicker 5.5s infinite ease-in-out;
}
.cabin.is-off .glow{ opacity: 0; }
.cabin.is-off #window{ fill: var(--window-off) !important; }

#window{ transition: fill 0.4s ease; fill: var(--window-on); }

@keyframes flicker{
  0%, 100%{ opacity: 1; }
  4%{ opacity: 0.85; }
  8%{ opacity: 1; }
  22%{ opacity: 0.92; }
  30%{ opacity: 1; }
  46%{ opacity: 0.8; }
  52%{ opacity: 1; }
  71%{ opacity: 0.9; }
  80%{ opacity: 1; }
  90%{ opacity: 0.88; }
}

.smoke{
  position: absolute;
  left: 71%;
  top: 4%;
  width: 4px;
  pointer-events: none;
}
.smoke i{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(140,145,155,0.35);
  animation: rise 6s infinite ease-in;
}
.smoke i:nth-child(2){ animation-delay: 2s; left: 2px; }
.smoke i:nth-child(3){ animation-delay: 4s; left: -2px; }
.cabin.is-off .smoke{ display: none; }

@keyframes rise{
  0%{ transform: translate(0,0) scale(1); opacity: 0.5; }
  100%{ transform: translate(10px,-60px) scale(3); opacity: 0; }
}

.hero__copy{
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 2.2rem var(--edge) 0.4rem;
}

.eyebrow{
  margin: 0 0 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.wordmark{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  letter-spacing: -0.02em;
  line-height: 0.98;
  color: var(--ink);
}

.tagline{
  margin: 1rem auto 0;
  max-width: 30rem;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.4vw, 1.02rem);
  color: var(--muted);
  line-height: 1.6;
}

.hint{
  position: relative;
  z-index: 5;
  margin: 1.4rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--moss);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hint.is-visible{ opacity: 0.85; }

.scrollcue{
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1.6rem 0 2.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.scrollcue__line{
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--amber-dim), transparent);
  animation: drip 2.2s infinite ease-in-out;
}
@keyframes drip{
  0%{ transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50%{ transform: scaleY(1); transform-origin: top; opacity: 1; }
  100%{ transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
}

/* =========================================================
   field notes
   ========================================================= */
.notes{
  position: relative;
  background: var(--bg);
  padding: clamp(4rem, 10vw, 8rem) var(--edge);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vw, 6rem);
}

.note{
  width: var(--note-w);
  background: var(--bg-alt);
  border: 1px solid #232838;
  border-left: 3px solid var(--amber-dim);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  position: relative;
  transform: rotate(-0.4deg);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.6);
}
.note--right{
  align-self: flex-end;
  transform: rotate(0.5deg);
  border-left: none;
  border-right: 3px solid var(--ember);
}

.note__eyebrow{
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-dim);
}
.note--right .note__eyebrow{ color: var(--ember); }

.note__title{
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.note__body{
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--muted);
}

/* =========================================================
   trail / links
   ========================================================= */
.trail{
  padding: clamp(3rem, 8vw, 6rem) var(--edge) clamp(4rem, 10vw, 7rem);
  background: linear-gradient(var(--bg), var(--bg-deep));
  border-top: 1px solid #1c2130;
}

.trail__eyebrow{
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  color: var(--ink);
}

.trail__list{
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}

.trail__list li + li{ margin-top: 0.4rem; }

.trail__list a{
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0.4rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid #1c2130;
  transition: padding-left 0.25s ease, border-color 0.25s ease;
}
.trail__list a:hover,
.trail__list a:focus-visible{
  padding-left: 1rem;
  border-color: var(--amber-dim);
}
.trail__marker{
  color: var(--amber);
  font-family: var(--font-mono);
}
.trail__label{
  font-size: 1.02rem;
  min-width: 6rem;
}
.trail__note{
  color: var(--muted);
  font-size: 0.82rem;
}

/* =========================================================
   reveal-on-scroll
   ========================================================= */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: none;
}

/* =========================================================
   footer
   ========================================================= */
.footer{
  padding: 2rem var(--edge) 2.6rem;
  background: var(--bg-deep);
  color: var(--moss);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.footer__firefly{
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px 1px var(--amber);
  animation: pulse 2.6s infinite ease-in-out;
}
@keyframes pulse{
  0%, 100%{ opacity: 0.4; }
  50%{ opacity: 1; }
}

/* =========================================================
   responsive
   ========================================================= */
@media (max-width: 640px){
  .mark{ font-size: 0.68rem; top: 1rem; }
  .note{ width: 100%; transform: none; }
  .note--right{ align-self: stretch; }
  .trail__list a{ flex-wrap: wrap; }
  .trail__label{ min-width: auto; }
}
