:root {
  --green: #2f5d3a;
  --green-2: #5a9e44;
  --cream: #f6f3ea;
  --ink: #1f2a24;
  --muted: #5f6b62;
  --accent: #e8a33a;
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; font-family: var(--sans); color: var(--ink); background: var(--cream); line-height: 1.55; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header */
.top {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem); color: #fff;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.brand strong { display: block; font-family: var(--serif); font-size: 1.35rem; letter-spacing: .01em; }
.brand small { display: block; font-size: .78rem; opacity: .85; margin-top: -.15rem; }
.top nav { display: flex; align-items: center; gap: 1.2rem; font-size: .95rem; }
.top nav > a:not(.btn) { text-decoration: none; opacity: .9; }
.top nav > a:not(.btn):hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.top, .hero-text { text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.lang select {
  font: inherit; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px; padding: .3rem .7rem; backdrop-filter: blur(6px);
}
.lang option { color: var(--ink); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1.4rem; border-radius: 999px;
  background: var(--accent); color: #2a1d05; font-weight: 600; text-decoration: none; text-shadow: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.btn em { font-style: normal; font-size: .72rem; font-weight: 600; background: rgba(0,0,0,.12); padding: .15rem .5rem; border-radius: 999px; }
.btn.ghost { background: rgba(255,255,255,.16); color: inherit; border: 1px solid rgba(255,255,255,.55); backdrop-filter: blur(6px); box-shadow: none; }
.btn.small { padding: .4rem .9rem; font-size: .9rem; }
.btn[aria-disabled="true"] { cursor: default; }
button.link { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link::before { content: "📍 "; text-decoration: none; display: inline-block; }

/* ---------- hero */
.hero { position: relative; min-height: max(640px, 100svh); overflow: hidden; color: #fff; background: #1d2a22; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
.scene, .particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-layer { position: absolute; inset: 0; }
.scene-layer svg { width: 100%; height: 100%; display: block; }
.scene-layer.entering { animation: fadein 1.5s ease both; }
@keyframes fadein { from { opacity: 0; } }
.particles { pointer-events: none; }

/* photo background */
.scene-layer.photo { overflow: hidden; background: #1d2a22; }
.scene-layer.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-layer.photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.scene-layer.tint-night::after { background: linear-gradient(180deg, rgba(6,10,35,.82), rgba(8,14,40,.62)); }
.scene-layer.tint-dusk::after { background: linear-gradient(180deg, rgba(60,40,110,.35), rgba(255,130,70,.28) 60%, rgba(40,20,40,.35)); }
.photo-credit {
  position: absolute; z-index: 3; right: .8rem; bottom: .4rem; margin: 0; font-size: .72rem; color: #fff;
  opacity: .8; text-shadow: 0 1px 4px rgba(0,0,0,.6); max-width: 60vw; text-align: right;
}
.photo-credit:hover { opacity: 1; }
.photo-credit[hidden] { display: none; }
.hero::after { /* readability scrim */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(10,20,15,.72) 0%, rgba(10,20,15,.5) 38%, rgba(10,20,15,.08) 68%, rgba(10,20,15,0) 80%),
              linear-gradient(0deg, rgba(10,20,15,.45) 0%, rgba(10,20,15,0) 45%),
              linear-gradient(180deg, rgba(10,20,15,.35) 0%, rgba(10,20,15,0) 18%);
}
.hero.flash::before { content: ""; position: absolute; inset: 0; z-index: 2; background: #fff; pointer-events: none; animation: flash .6s ease-out; opacity: 0; }
@keyframes flash { 0% { opacity: .75; } 15% { opacity: .1; } 25% { opacity: .55; } 100% { opacity: 0; } }

.hero-text { position: relative; z-index: 3; max-width: 840px; padding: 8rem clamp(1rem, 5vw, 4rem) clamp(2rem, 7vh, 5rem); }
.weather-line { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .95rem; margin: 0 0 1rem; }
.weather-line #greeting { font-weight: 600; }
.weather-line #conditions { opacity: .9; }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.8rem); letter-spacing: -.01em; }
.lead { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 34em; opacity: .95; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.2rem; }
.geo { font-size: .9rem; display: grid; gap: .2rem; justify-items: start; }
.geo small { opacity: .8; font-size: .8rem; }

.tip-card {
  position: absolute; z-index: 3; right: clamp(1rem, 4vw, 3rem); top: 6.5rem; width: min(330px, 40vw);
  background: rgba(18,30,24,.5); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius);
  padding: 1rem 1.2rem; backdrop-filter: blur(10px) saturate(1.2); box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.tip-card h2 { font-size: 1.05rem; margin-bottom: .3rem; }
.tip-card p { margin: 0; font-size: .93rem; }

/* scene animations */
.drift { animation: drift linear infinite; }
.drift.slow { animation-duration: 160s; }
@keyframes drift { from { transform: translateX(-450px); } to { transform: translateX(1900px); } }
.twinkle { animation: twinkle ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.sway, .sway-soft { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite alternate; }
.sway-soft { animation-duration: 3.2s; }
@keyframes sway { from { transform: rotate(calc(var(--sway) * -1)); } to { transform: rotate(var(--sway)); } }
@media (prefers-reduced-motion: reduce) {
  .drift, .twinkle, .sway, .sway-soft, .scene-layer.entering{ animation: none; }
}

/* ---------- sections */
.how, .app { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem); max-width: 1200px; margin: 0 auto; }
.how h2, .app h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); color: var(--green); }
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; counter-reset: s; }
.steps li { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 0 #e6e0cf, 0 12px 30px rgba(47,93,58,.06); position: relative; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 1.2rem; right: 1.3rem; font-family: var(--serif); font-size: 2rem; color: #e6e0cf; }
.steps svg { width: 48px; height: 48px; color: var(--green); fill: currentColor; margin-bottom: .6rem; }
.steps h3 { font-size: 1.25rem; }
.steps p { margin: 0; color: var(--muted); }

.app { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.app p { color: var(--muted); font-size: 1.05rem; max-width: 34em; }
.app .btn.ghost { color: var(--green); border-color: var(--green); }
.phone { width: min(220px, 60vw); justify-self: center; filter: drop-shadow(0 20px 40px rgba(31,42,36,.25)); }

.bottom { background: var(--green); color: #e7efe4; padding: 2rem clamp(1rem, 5vw, 4rem); font-size: .88rem; }
.bottom p { max-width: 1200px; margin: .3rem auto; }

/* ---------- preview panel (?apercu) */
.preview {
  position: fixed; z-index: 20; left: 1rem; bottom: 1rem; display: grid; gap: .4rem; padding: 1rem;
  background: rgba(255,255,255,.95); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .85rem;
}
.preview[hidden] { display: none; }
.preview label { display: flex; justify-content: space-between; gap: .6rem; align-items: center; }

/* ---------- small screens */
@media (max-width: 820px) {
  .top nav > a:not(.btn) { display: none; }
  .top { padding: .8rem 1rem; }
  .top nav { gap: .5rem; }
  .brand small { display: none; }
  .lang select { padding: .25rem .4rem; }
  .tip-card { position: relative; top: auto; right: auto; width: auto; margin: 0 1rem 1.5rem; }
  .hero { align-content: end; }
  .hero::after { background: linear-gradient(0deg, rgba(10,20,15,.75) 0%, rgba(10,20,15,.5) 55%, rgba(10,20,15,.35) 100%); }
  .hero-text { padding-top: 7rem; }
  .app { grid-template-columns: 1fr; }
}

/* ---------- photo credits page */
.credit-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.credit-list li { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 0 #e6e0cf; }
.credit-list img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.credit-list div { padding: .6rem .8rem; font-size: .85rem; }
.credit-list p { margin: .2rem 0 0; color: var(--muted); }
