/* ==========================================================================
   home.css: the home page (hello, trips, about). Uses base.css tokens.
   ========================================================================== */

.home .lid { padding-bottom: 30px; }
.home .topbar { max-width: 880px; margin-bottom: 0; }
.top-links { display: flex; gap: 6px; }
.top-links a { display: inline-flex; align-items: center; min-height: 40px; }

.home main { max-width: 880px; margin: 0 auto; padding: 0 18px 30px; overflow-x: clip; }
.home .sec { font-size: 32px; margin-top: 46px; }

/* ---------- Hello ---------- */
.hero { display: grid; gap: 28px; padding: 34px 0 10px; align-items: center; }
@media (min-width: 720px) { .hero { grid-template-columns: 1.1fr .9fr; } }
.hi { display: inline-block; font-family: Caveat, cursive; font-size: 30px; font-weight: 700; color: var(--accent); margin: 0 0 4px; transform: rotate(-2deg); }
.hero h1 { font-size: clamp(42px, 11vw, 64px); color: var(--title); }
.hero p { font-size: 18px; margin: 14px 0 20px; max-width: 34em; }
.board { position: relative; width: min(300px, 82vw); margin: 10px auto 0; }
.board .pola { padding: 12px 12px 0; transform: rotate(-4deg); box-shadow: 0 0 0 2px var(--ink), 0 8px 0 var(--shadow); }
.board .pola::before { top: -14px; width: 96px; height: 28px; margin-left: -48px; transform: rotate(3deg); }
.board .pola img { aspect-ratio: 4 / 5; }
.board figcaption { font-size: 25px; padding: 8px 0 10px; }
.board .stk { position: absolute; width: 58px; height: 58px; pointer-events: none; z-index: 2; }
@media (prefers-reduced-motion: no-preference) { .board .pola { animation: sway 6s ease-in-out infinite; } }
@keyframes sway { 50% { transform: rotate(-2deg); } }

/* ---------- Trips (boarding passes) ---------- */
.group-title { font-size: 22px; margin: 18px 0 12px; }
.passes { display: grid; gap: 16px; }
@media (min-width: 720px) { .passes { grid-template-columns: 1fr 1fr; } }
.pass { display: block; text-decoration: none; background: var(--card); border: 2px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.pass-head { background: var(--tint); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); }
.chip { background: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: 2px 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.up { background: var(--accent); color: #fff; border-color: var(--accent); }
.pass-body { padding: 16px 18px 18px; }
.pass h3 { font-size: 30px; color: var(--title); }
.codes { display: flex; align-items: center; gap: 10px; font-family: Fraunces, serif; font-weight: 700; font-size: 24px; margin: 2px 0; }
.codes i { flex: 1; border-top: 2px dashed var(--soft); position: relative; height: 0; }
.codes i::after { content: "✈"; position: absolute; left: 50%; top: -15px; transform: translateX(-50%); font-style: normal; font-size: 18px; color: var(--accent); }
.route-line { color: var(--soft); font-size: 15px; margin: 8px 0 12px; }
.meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.meta b { display: block; font-size: 13px; color: var(--soft); font-weight: 600; }
.go { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--accent); }
.pass.soon { border-style: dashed; box-shadow: none; background: transparent; }
.pass.soon .pass-head { background: transparent; }
.past { background: #fff; border: 2px dashed var(--soft); border-radius: 18px; padding: 18px; text-align: center; color: var(--soft); }
.stamps { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.stamps span { width: 56px; height: 56px; border-radius: 50%; border: 3px dashed var(--hairline); display: grid; place-items: center; font-family: Caveat, cursive; font-size: 20px; color: #c76b8a; transform: rotate(-8deg); }

/* ---------- About (sticky note) ---------- */
.note-card { position: relative; background: var(--butter); border: 2px solid var(--ink); border-radius: 4px; padding: 26px 20px 20px; box-shadow: 0 6px 0 var(--shadow); transform: rotate(1deg); max-width: 620px; margin: 20px auto 0; }
.note-card::before { content: ""; position: absolute; top: -13px; left: 24px; width: 90px; height: 26px; background: var(--tape); transform: rotate(-5deg); }
.note-card h2 { font-size: 30px; margin-bottom: 10px; }
.note-card p { margin: 0 0 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 0; }
.facts li { background: #fff; border: 2px solid var(--ink); border-radius: 99px; padding: 4px 12px; font-size: 15px; font-weight: 500; }

/* ---------- Per-trip ticket themes (match each trip page) ---------- */
.pass--china  { --ink: #3b0a0a; --soft: #7a2a1f; --tint: #ffe2bf; --accent: #e0263c; --title: #b3001b; }
.pass--tromso { --ink: #14204a; --soft: #4a5a8c; --tint: #dce9ff; --accent: #e0458f; --title: #2546b8; }
.pass--china .pass-head  { background: repeating-linear-gradient(90deg, rgba(200,16,46,.35) 0 12px, transparent 12px 24px), repeating-linear-gradient(0deg, rgba(200,16,46,.35) 0 12px, transparent 12px 24px), #ffd98a; }
.pass--tromso .pass-head { background: repeating-linear-gradient(90deg, rgba(80,130,230,.25) 0 12px, transparent 12px 24px), repeating-linear-gradient(0deg, rgba(80,130,230,.25) 0 12px, transparent 12px 24px), #dce9ff; }

/* Animated mini scene under each ticket head */
.pass-scene { display: block; width: 100%; height: 70px; border-bottom: 2px dashed var(--ink); }
.pass-scene .sway { transform-box: fill-box; transform-origin: 50% 0; animation: tk-sway 3s ease-in-out infinite; }
.pass-scene .sway.b { animation-delay: -1.5s; }
.pass-scene .fall { animation: tk-fall 5s linear infinite; }
.pass-scene .fall:nth-child(2n) { animation-duration: 6.5s; animation-delay: -2s; }
.pass-scene .fall:nth-child(3n) { animation-duration: 4.2s; animation-delay: -3.3s; }
.pass-scene .drift { animation: tk-drift 7s ease-in-out infinite alternate; }
.pass-scene .glow { animation: tk-glow 4s ease-in-out infinite alternate; }
@keyframes tk-sway { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes tk-fall { from { transform: translate(0, -20px); } to { transform: translate(24px, 90px); } }
@keyframes tk-drift { from { transform: translateX(-18px); } to { transform: translateX(18px); } }
@keyframes tk-glow { from { opacity: .55; } to { opacity: 1; } }
.pass.soon .pass-head { border-bottom-style: dashed; }

/* ---------- Been there (finished trips move here automatically) ---------- */
.pass.done { position: relative; }
.pass.done .stamp { position: absolute; right: 14px; top: 64px; width: 92px; height: 92px; border-radius: 50%; border: 4px double var(--accent); color: var(--accent); display: grid; place-items: center; text-align: center; font: 700 22px/1 Caveat, cursive; transform: rotate(-14deg); background: rgba(255, 255, 255, .85); pointer-events: none; }
#been-there:empty { display: none; }
#been-there:not(:empty) { margin-bottom: 4px; }

/* ---------- Places I've been (world map) ---------- */
.world-card { padding: 14px; }
.world { min-height: 160px; }
.world svg { width: 100%; height: auto; }
.world path { fill: #f3e4ea; stroke: #fff; stroke-width: .6; transition: fill .3s; }
.world path.been { fill: var(--accent); }
.world path.next { fill: #ffd3e4; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 2; }
@media (prefers-reduced-motion: no-preference) { .world path.been { animation: glow 2.4s ease-in-out infinite alternate; } }
@keyframes glow { from { fill: var(--accent); } to { fill: #ff5fa2; } }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 14px; color: var(--soft); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.legend .been { background: var(--accent); } .legend .next { background: #ffd3e4; border: 1.5px dashed var(--accent); }
.world-count { text-align: center; font: 700 26px Caveat, cursive; color: var(--accent); margin: 10px 0 6px; }
#world-list { justify-content: center; }
.world path.home { fill: var(--title); }
.world circle.tiny { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.legend .home { background: var(--title); }

/* ---------- 3D globe (assets/js/globe.js) ---------- */
.world { min-height: 200px; display: grid; place-items: center; }
.globe-wrap { position: relative; display: grid; place-items: center; width: 100%; }
.globe { touch-action: none; cursor: grab; border-radius: 50%; }
.globe:active { cursor: grabbing; }
.globe-btns { position: absolute; right: 0; bottom: 0; display: grid; gap: 6px; }
.globe-btns .ghost { min-height: 40px; width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.globe-tip { position: absolute; left: 50%; top: 6px; transform: translate(-50%, -6px); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 99px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.globe-tip.on { opacity: 1; transform: translate(-50%, 0); }
.globe-hint { text-align: center; margin: 6px 0 0; }
