/* ============================================================
   A Damn Fine Trip — styles
   Paleta: verde-floresta, creme de papel, vermelho cereja.
   ============================================================ */

:root {
  --forest: #1d2d24;
  --forest-deep: #121b16;
  --paper: #f4ead7;
  --paper-2: #ebdfc6;
  --ink: #2b211b;
  --muted: #6b5d50;
  --cherry: #b3262b;
  --cherry-dark: #8f1d22;
  --gold: #d9a441;
  --radius: 10px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Work Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cherry); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1 em, h2 em { color: var(--cherry); font-style: italic; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: 1.6rem; margin-top: 2.2rem; }
h4 { font-size: 1.25rem; }

/* --- Top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .8rem clamp(1rem, 4vw, 3rem);
  background: rgba(18, 27, 22, .94);
  backdrop-filter: blur(6px);
  color: var(--paper);
}
.brand { font-family: var(--serif); font-size: 1.3rem; color: var(--paper); text-decoration: none; }
.nav { display: flex; gap: 1.2rem; margin-left: auto; }
.nav a { color: var(--paper); opacity: .8; text-decoration: none; font-size: .95rem; }
.nav a:hover { opacity: 1; color: var(--gold); }
.lang {
  font: inherit; font-size: .85rem; cursor: pointer;
  color: var(--paper); background: transparent;
  border: 1px solid rgba(244, 234, 215, .4); border-radius: 99px; padding: .3rem .9rem;
}
.lang:hover { border-color: var(--gold); color: var(--gold); }

/* --- Buttons --- */
.btn {
  display: inline-block; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
  padding: .85rem 1.6rem; border-radius: 99px; border: 2px solid transparent;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-red { background: var(--cherry); color: #fff; }
.btn-red:hover { background: var(--cherry-dark); }
.btn-ghost { color: var(--paper); border-color: rgba(244, 234, 215, .5); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-cream { background: var(--paper); color: var(--forest); }
.btn-small { padding: .45rem 1rem; font-size: .9rem; }
.btn-wide { display: block; text-align: center; margin-top: 1.2rem; }

/* --- Hero --- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.2rem, 6vw, 6rem);
  background: radial-gradient(ellipse at 70% 40%, #2a4033 0%, var(--forest) 55%, var(--forest-deep) 100%);
  color: var(--paper);
}
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; color: var(--gold); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.hero h1 em { color: #e2504f; }
.lead { font-size: 1.15rem; max-width: 34em; opacity: .92; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-art img {
  width: 100%; max-width: 440px; margin-inline: auto;
  border-radius: 4px; transform: rotate(2.5deg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}

/* --- Forest: treeline dividers, mist and the fir icon --- */
/* Each .treeline is painted with the color of the section above (background)
   and the trees with the color of the section below (--below), so the forest
   "grows" out of the next section. */
.treeline {
  position: relative; height: clamp(64px, 8vw, 120px);
  background: var(--above, var(--paper));
}
.treeline::after {
  content: ""; position: absolute; inset: 0; background: var(--below);
  -webkit-mask: url(../img/treeline.svg) left bottom / auto 100% repeat-x;
          mask: url(../img/treeline.svg) left bottom / auto 100% repeat-x;
}
.treeline--to-dark { --above: var(--paper); --below: var(--forest-deep); }
.treeline--to-forest { --above: var(--paper-2); --below: var(--forest); }

/* Hero: soft mist and a far, faded treeline along the bottom */
.hero { position: relative; overflow: hidden; padding-bottom: clamp(5rem, 10vw, 8rem); }
.hero > * { position: relative; z-index: 1; }
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to top, rgba(244, 234, 215, .10), rgba(244, 234, 215, 0));
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(50px, 7vw, 95px);
  background: var(--forest-deep); opacity: .85;
  -webkit-mask: url(../img/treeline-far.svg) left bottom / auto 100% repeat-x;
          mask: url(../img/treeline-far.svg) left bottom / auto 100% repeat-x;
  pointer-events: none;
}

.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand-fir { width: 16px; height: 24px; fill: var(--gold); flex: none; }

/* --- Sections --- */
.section { padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 5vw, 3rem); }
.paper { background: var(--paper); }
.dark { background: var(--forest-deep); color: var(--paper); }
.forest { background: var(--forest); color: var(--paper); }
.narrow { max-width: 680px; margin-inline: auto; }
.wide { max-width: 1100px; margin-inline: auto; }
.section-lead { color: var(--muted); max-width: 40em; }
.sign { font-family: var(--serif); font-size: 1.4rem; font-style: italic; color: var(--cherry); }

.story-photos, .map-examples {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  max-width: 1000px; margin: 2.5rem auto 0;
}
.story-photos .art-thumb { width: min(340px, 44vw); }
.map-examples .art-thumb { width: 180px; }
.map-examples { margin: 1.5rem 0; justify-content: flex-start; }

/* --- Progress --- */
.raised { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.2rem); margin: .2rem 0 1rem; }
.raised span:last-child { font-family: var(--sans); font-size: 1rem; opacity: .7; }
.bar { position: relative; height: 18px; background: rgba(244, 234, 215, .12); border-radius: 99px; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--cherry), #e2504f); transition: width 1s ease; }
.bar-mark { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--gold); border-radius: 2px; }
.goals { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .95rem; }
.goals strong { color: var(--gold); font-weight: 600; }
.note { opacity: .85; margin-top: 1.5rem; }
.updated { font-size: .85rem; opacity: .55; }

/* --- Art grid --- */
.handmade {
  display: grid; grid-template-columns: 380px 1fr; gap: 1.8rem; align-items: center;
  margin: 2rem 0 1rem; padding: 1.4rem; border-radius: var(--radius);
  background: #fffaf0; box-shadow: 0 6px 20px rgba(43, 33, 27, .08); max-width: 960px;
}
.handmade h3 { margin: 0 0 .4rem; color: var(--cherry); }
.handmade p { margin: 0; }
.handmade-photo img { border-radius: 8px; }
.handmade-photos { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: center; }
@media (max-width: 720px) { .handmade { grid-template-columns: 1fr; } }
.collections { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid { gap: .9rem; } .art-info { padding: .8rem; } .art-buy { flex-direction: column; align-items: stretch; text-align: center; } }
.art-card { background: #fffaf0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(43, 33, 27, .1); display: flex; flex-direction: column; }
.art-thumb { all: unset; cursor: zoom-in; display: block; }
.art-thumb img { width: 100%; height: auto; transition: transform .3s; }
.art-thumb:hover img { transform: scale(1.03); }
.art-thumb:focus-visible { outline: 3px solid var(--cherry); outline-offset: 2px; }
.art-info { padding: 1rem 1.2rem 1.2rem; margin-top: auto; }
.art-info h4 { margin-bottom: .2rem; }
.card-note { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.art-buy { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .6rem; }
.price { font-weight: 600; }
.small-note { font-size: .85rem; color: var(--muted); font-style: italic; }
.bundle {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 3rem; padding: 1.6rem 2rem; border-radius: var(--radius);
  background: var(--paper-2); border: 2px dashed rgba(179, 38, 43, .35);
}
.bundle p { margin: 0; color: var(--muted); }

/* --- Map commission --- */
.badge { display: inline-block; margin: 0 0 1rem; padding: .25rem .8rem; border-radius: 99px; background: var(--gold); color: var(--forest-deep); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.disclaimer { font-size: .92rem; opacity: .8; border-left: 3px solid var(--gold); padding-left: 1rem; margin: 1.5rem 0; }
.closed { font-style: italic; opacity: .8; }

/* --- Donations --- */
.donations { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-top: 1.5rem; }
.don {
  display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink);
  padding: 1rem; border-radius: var(--radius); background: #fffaf0; border: 2px solid var(--paper-2);
  transition: border-color .15s, transform .15s;
}
.don:hover { border-color: var(--cherry); transform: translateY(-2px); }
.don-name { font-size: .92rem; }
.don-amount { font-family: var(--serif); font-size: 1.5rem; color: var(--cherry); }
.pix { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--paper-2); }
.pix h3 { margin-top: 0; }
.pix img { width: 200px; margin-bottom: 1rem; }
.pix-key { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.pix-key code { background: #fffaf0; padding: .5rem .8rem; border-radius: 6px; font-size: .95rem; word-break: break-all; }
.pix-key .btn { background: var(--forest); color: var(--paper); }

/* --- Transparency --- */
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.card { background: rgba(244, 234, 215, .06); border: 1px solid rgba(244, 234, 215, .14); border-radius: var(--radius); padding: 1.4rem; }
.card h4 { color: var(--gold); }
.card p { margin: 0; opacity: .88; }

/* --- Footer --- */
.footer { background: var(--forest-deep); color: var(--paper); text-align: center; padding: 2.5rem 1.5rem 3rem; border-top: 1px solid rgba(244, 234, 215, .1); }
.footer a { color: var(--gold); }
.fine { font-size: .8rem; opacity: .55; max-width: 46em; margin: .6rem auto 0; }

/* --- Viewer --- */
dialog#viewer { border: none; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
dialog#viewer::backdrop { background: rgba(10, 14, 12, .88); }
#viewerImg { max-width: 94vw; max-height: 90vh; width: auto; border-radius: 4px; }
.viewer-close {
  position: fixed; top: 1rem; right: 1.2rem; width: 44px; height: 44px; border-radius: 50%;
  border: none; background: var(--paper); color: var(--ink); font-size: 1.6rem; cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art img { max-width: 300px; }
  .nav { display: none; }
  .lang { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .art-thumb img, .bar-fill, .don { transition: none; }
}

/* --- Format tags (poster / wallpaper) --- */
.fmts { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .35rem 0 .55rem; }
.fmt {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem .18rem .45rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em; line-height: 1.3;
  border: 1px solid currentColor; cursor: help;
}
.fmt svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.fmt-poster { color: var(--cherry); background: rgba(179, 38, 43, .06); }
.fmt-wallpaper { color: var(--forest); background: rgba(29, 45, 36, .06); }

/* --- Phones: one card per row, image beside the text --- */
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .art-card { flex-direction: row; }
  .art-card .art-thumb { width: 42%; flex: none; align-self: flex-start; }
  .art-info { margin-top: 0; display: flex; flex-direction: column; }
  .art-buy { margin-top: auto; padding-top: .6rem; }
}

/* --- Support sits right after the art: slightly darker paper to separate them --- */
.paper-alt { background: var(--paper-2); }
.paper-alt .don { background: #fffaf0; border-color: #fffaf0; }
.paper-alt .don:hover { border-color: var(--cherry); }
.paper-alt .pix { border-top-color: rgba(43, 33, 27, .12); }

/* --- Bundle deal tag --- */
.deal {
  display: inline-block; margin: 0 0 .5rem !important; padding: .2rem .7rem; border-radius: 99px;
  background: var(--cherry); color: #fff !important; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}


/* --- Short intro under a collection title --- */
.collection-note { color: var(--muted); font-size: .95rem; max-width: 46em; margin: -.2rem 0 1.2rem; }

.story-ask { font-size: 1.1rem; }
.story-ask strong { color: var(--cherry); font-weight: 600; }
.pix-hint { color: var(--muted); font-size: .92rem; margin: -.2rem 0 1rem; }
.pix img { border-radius: 8px; background: #fff; }
