/* ============================================================
   HEWN NORTH — Canadian Log Cabins
   Palette: spruce ink #1B2A22 · snowfield #EDEFE9 · timber #B07C3F
            aurora #7FD6A4 · birch #D8D2C2 · lamplight #F4C87A
   Type:    Fraunces (display) · Karla (body) · Space Mono (specs)
   ============================================================ */

:root {
  --spruce: #1B2A22;
  --spruce-deep: #121F19;
  --snow: #EDEFE9;
  --snow-bright: #F7F8F5;
  --timber: #B07C3F;
  --timber-deep: #8A6236;
  --aurora: #7FD6A4;
  --birch: #E4DFD2;
  --lamplight: #F4C87A;
  --ink-on-snow: #23312A;
  --muted: #5C6B62;
  --maxw: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Karla", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-on-snow);
  background: var(--snow);
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

a { color: inherit; }

::selection { background: var(--timber); color: var(--snow-bright); }

/* ---------- top bar ---------- */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  color: var(--snow-bright);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: 1.25rem;
  text-decoration: none;
}

.wordmark-icon { width: 26px; height: 26px; color: var(--timber); }

.topnav { display: flex; gap: 1.75rem; }

.topnav a {
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: opacity 0.2s, border-color 0.2s;
}

.topnav a:hover, .topnav a:focus-visible { opacity: 1; border-color: var(--aurora); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 70% -10%, #24463A 0%, transparent 60%),
    linear-gradient(180deg, #0B1512 0%, #14231C 55%, #1B2A22 100%);
  color: var(--snow-bright);
}

/* aurora sweep — soft-edged gradients, no blur filter (perf) */
.aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 75%;
  pointer-events: none;
  background:
    radial-gradient(50% 65% at 30% 30%, rgba(127, 214, 164, 0.22) 0%, rgba(127, 214, 164, 0.10) 45%, transparent 72%),
    radial-gradient(45% 60% at 60% 20%, rgba(110, 190, 200, 0.16) 0%, rgba(110, 190, 200, 0.07) 45%, transparent 72%),
    radial-gradient(40% 55% at 82% 35%, rgba(127, 214, 164, 0.13) 0%, rgba(127, 214, 164, 0.06) 45%, transparent 72%);
  will-change: transform;
  animation: aurora-drift 16s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  from { transform: translateX(-3%) skewX(-3deg); }
  to   { transform: translateX(3%) skewX(3deg); }
}

/* wind-driven snowfall — performance notes:
   - transform-only animation (GPU compositor; no repaints)
   - no blur filters
   - two layers, each translating exactly one tile per loop (seamless)
   - layers oversized top/right so the diagonal drift never shows an edge */
.snow {
  position: absolute;
  top: -440px; right: -440px; bottom: 0; left: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 8%,    rgba(255,255,255,0.9) 50%, transparent 51%),
    radial-gradient(2px 2px at 30% 34%,   rgba(255,255,255,0.7) 50%, transparent 51%),
    radial-gradient(2px 2px at 47% 15%,   rgba(255,255,255,0.8) 50%, transparent 51%),
    radial-gradient(2px 2px at 63% 46%,   rgba(255,255,255,0.65) 50%, transparent 51%),
    radial-gradient(2px 2px at 81% 24%,   rgba(255,255,255,0.85) 50%, transparent 51%),
    radial-gradient(2px 2px at 8% 60%,    rgba(255,255,255,0.7) 50%, transparent 51%),
    radial-gradient(2px 2px at 25% 86%,   rgba(255,255,255,0.75) 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 68%,   rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 60% 92%,   rgba(255,255,255,0.8) 50%, transparent 51%),
    radial-gradient(2px 2px at 77% 72%,   rgba(255,255,255,0.65) 50%, transparent 51%),
    radial-gradient(2px 2px at 93% 54%,   rgba(255,255,255,0.75) 50%, transparent 51%),
    radial-gradient(2px 2px at 95% 88%,   rgba(255,255,255,0.7) 50%, transparent 51%);
  background-size: 420px 420px;
  background-repeat: repeat;
  will-change: transform;
  animation: snow-wind 10s linear infinite;
}

/* nearer, bigger flakes: faster fall, stronger sideways drift */
.snow-near {
  top: -680px; right: -680px;
  background-size: 660px 660px;
  opacity: 0.9;
  animation: snow-wind-near 7s linear infinite;
}

/* each loop moves exactly one background tile down and one across,
   so the pattern lines up perfectly when the animation restarts */
@keyframes snow-wind {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-420px, 420px, 0); }
}

@keyframes snow-wind-near {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-660px, 660px, 0); }
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: clamp(5rem, 11vh, 6.5rem) clamp(1.25rem, 4vw, 3rem) 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
}

.hero-sub {
  max-width: 34rem;
  margin-top: 1.1rem;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: #C7D2C9;
}

.hero-cta { display: flex; gap: 0.9rem; margin-top: 1.7rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background: var(--timber);
  color: var(--snow-bright);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s;
}

.btn:hover, .btn:focus-visible { background: #C68E4C; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border: 2px solid rgba(247, 248, 245, 0.4);
}

.btn-ghost:hover, .btn-ghost:focus-visible { background: rgba(247,248,245,0.1); }

.hero-scene {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin-top: auto;
  /* cap the scene on desktop so the cabin sits above the fold;
     preserveAspectRatio="xMidYMax slice" crops sky from the top */
  max-height: 46vh;
}

@media (max-width: 640px) {
  .hero-scene { max-height: none; }
}

/* ---------- eyebrows / type furniture ---------- */

/* ---------- eyebrows / type furniture ---------- */
.eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--timber);
  margin-bottom: 1rem;
}

.eyebrow-light { color: var(--aurora); }

/* ---------- log-end divider ---------- */
.log-divider svg { display: block; width: 100%; height: 56px; }

/* ---------- sections ---------- */
.section {
  padding: clamp(2.75rem, 5.5vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
}

.section-head {
  max-width: var(--maxw);
  margin: 0 auto clamp(1.75rem, 4vw, 2.75rem);
}

.section h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 900;
}

.lede {
  max-width: 42rem;
  margin-top: 0.9rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.section-dark {
  background: var(--spruce);
  color: var(--snow-bright);
}

.section-dark h2 { color: var(--snow-bright); }

.lede-light { color: #A9B8AE; }

.section-birch { background: var(--birch); }

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: clamp(88px, 12vw, 130px);
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--timber), var(--birch));
}

.timeline li {
  display: grid;
  grid-template-columns: clamp(72px, 11vw, 110px) 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: 1rem 0;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: clamp(82px, 12vw, 124px);
  top: 1.55rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--snow);
  border: 4px solid var(--timber);
}

.tl-date {
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--timber-deep);
  text-align: right;
  padding-top: 0.45rem;
  white-space: nowrap;
}

.tl-body h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.55rem; }

.tl-body p { max-width: 40rem; color: var(--muted); }

.tl-body strong { color: var(--ink-on-snow); }

/* ---------- anatomy cards ---------- */
.cards {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.card {
  background: rgba(247, 248, 245, 0.05);
  border: 1px solid rgba(247, 248, 245, 0.12);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s;
}

.card:hover { transform: translateY(-4px); border-color: rgba(176, 124, 63, 0.6); }

.card-icon { width: 52px; height: 52px; margin-bottom: 1.2rem; }

.card h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.6rem; }

.card p { color: #B9C6BD; font-size: 0.98rem; }

/* ---------- build steps ---------- */
.steps {
  list-style: none;
  max-width: var(--maxw);
  margin: 0 auto;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  padding: 1.4rem 0;
  border-top: 1px solid #D5DAD2;
}

.step:last-child { border-bottom: 1px solid #D5DAD2; }

.step-no {
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--timber);
  padding-top: 0.2rem;
  min-width: 2ch;
}

.step h3 { font-size: 1.45rem; font-weight: 600; margin-bottom: 0.5rem; }

.step p { max-width: 42rem; color: var(--muted); }

.spec {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--timber-deep);
  margin-top: 0.9rem;
}

.spec-light { color: var(--aurora); }

/* ---------- the Tremblay cabin ---------- */
.section-last { padding-bottom: clamp(5rem, 10vw, 8rem); }

.tremblay {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 5fr) minmax(300px, 6fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.tremblay-photo {
  position: sticky;
  top: 2rem;
  margin: 0;
  transform: rotate(-0.6deg);
}

.tremblay-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #182720;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.tremblay-photo figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: #A9B8AE;
}

.tremblay-copy h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.tremblay-copy p {
  color: #B9C6BD;
  margin-bottom: 1.1rem;
  max-width: 40rem;
}

.fact-list {
  list-style: none;
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem 1.5rem;
}

.fact-list li {
  border-top: 2px solid rgba(176, 124, 63, 0.55);
  padding-top: 0.55rem;
  font-weight: 500;
  color: var(--snow-bright);
}

.fact-list span {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aurora);
  margin-bottom: 0.2rem;
}

/* ---------- responsive ---------- */
/* ---------- footer ---------- */
.site-footer {
  background: var(--spruce-deep);
  color: #A9B8AE;
}

.footer-forest {
  display: block;
  width: 100%;
  height: clamp(90px, 13vw, 150px);
}

.site-footer .footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 4vw, 3rem) 3.5rem;
}

.site-footer p { max-width: 44rem; }

@media (max-width: 900px) {
  .tremblay { grid-template-columns: 1fr; }
  .tremblay-photo { position: static; transform: none; }
}

@media (max-width: 640px) {
  .topnav { display: none; }

  .timeline::before, .timeline li::before { display: none; }

  .timeline li { grid-template-columns: 1fr; gap: 0.3rem; }

  .tl-date { text-align: left; }

  .step { grid-template-columns: 1fr; gap: 0.6rem; }
}

/* ---------- accessibility ---------- */
:focus-visible { outline: 3px solid var(--aurora); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora, .snow, .snow-near { animation: none; }
  .snow, .snow-near { opacity: 0.35; }
  .btn, .card { transition: none; }
}
