/* The home page of hanginthere.app. Everything hangs from the branch across the top, like the game.
   Colours and type are the game's own: mint sky, deep green ink, coral buttons, wooden bars. */
@font-face { font-family: "Baloo 2"; src: url("fonts/baloo-2-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sky: #dff0ea; --sky2: #c9e6dc; --ink: #17332d; --soft: #4f6f67; --panel: #f7fcfa;
  --coral: #e2574c; --coral2: #c9453b; --gold: #d99a14; --good: #1f8a5b; --wood: #7a5236; --wood2: #5c3b25; --rope: #47635c;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif; --body: "Nunito", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 500 18px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral2); font-weight: 700; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(30px, 4.6vw, 46px); }
.sub { margin: 10px 0 0; color: var(--soft); max-width: 34em; }
html, body { overflow-x: clip; }
main > section { padding: 0 max(22px, calc((100vw - 1120px) / 2)); }

/* ---- top bar ---- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 34px max(22px, calc((100vw - 1120px) / 2)) 0; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 22px var(--display); color: var(--ink); text-decoration: none; }
.brand img { border-radius: 9px; }
.top nav { display: flex; gap: 22px; font-size: 16px; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

/* ---- hero: the branch, the pitch, and a scale you can play ---- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 128px !important; padding-bottom: 150px !important;
  background: url("img/bg-morning.webp") center bottom / cover no-repeat, linear-gradient(var(--sky2), var(--sky)); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, var(--sky)); pointer-events: none; }
.branch { position: absolute; left: -20px; right: -20px; top: 8px; height: 16px; border-radius: 99px; background: linear-gradient(var(--wood), var(--wood2)); transform: rotate(-0.4deg); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); }
.pitch { position: relative; z-index: 1; padding-top: 34px; }
h1 { font-size: clamp(44px, 6.4vw, 84px); max-width: 9.5em; text-wrap: balance; }
.lede { font-size: clamp(18px, 1.5vw, 21px); max-width: 30em; margin: 22px 0 0; }
.soon { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 30px 0 0; }
.pill { display: inline-block; padding: 14px 22px; border-radius: 18px; background: var(--ink); color: #fff; font: 800 19px var(--display); }
.for { color: var(--soft); font-weight: 700; }

.demo { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; user-select: none; -webkit-user-select: none; touch-action: none; }
.demo-say { position: relative; z-index: 2; margin: 0 0 6px; padding: 10px 18px; border-radius: 99px; background: var(--panel); font-weight: 700; font-size: 16px; text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08); }
.demo.won .demo-say { background: var(--good); color: #fff; }
.rig { position: relative; width: min(420px, 100%); height: 300px; }
.rope { position: absolute; left: 50%; top: -24px; width: 4px; height: 86px; margin-left: -2px; background: var(--rope); }
.beam { position: absolute; left: 12%; right: 12%; top: 58px; height: 14px; border-radius: 99px; background: linear-gradient(var(--wood), var(--wood2)); transform-origin: 50% 50%; transform: rotate(var(--tilt, 0deg)); transition: transform 0.7s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.3s; }
.beam::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: #d9a441; box-shadow: inset 0 0 0 4px var(--wood2); }
.demo.won .beam { background: linear-gradient(#e7b534, var(--gold)); }
.total { position: absolute; top: -40px; width: 34px; height: 34px; border-radius: 50%; background: var(--panel); font: 800 18px/34px var(--display); text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); transform: rotate(calc(var(--tilt, 0deg) * -1)); transition: background 0.3s, color 0.3s; }
.total.left { left: -6px; } .total.right { right: -6px; }
.total.heavy { background: var(--coral); color: #fff; } .demo.won .total { background: var(--good); color: #fff; }
.side { position: absolute; top: 7px; width: 0; height: 0; } .side.left { left: 4%; } .side.right { right: 4%; }
/* each side hangs straight down however far the beam tips */
.hang { position: absolute; left: 0; top: 0; transform: rotate(calc(var(--tilt, 0deg) * -1)); transform-origin: 0 0; transition: transform 0.7s cubic-bezier(0.3, 1.6, 0.5, 1); }
.hang::before { content: ""; position: absolute; left: -1.5px; top: 0; width: 3px; height: 44px; background: var(--rope); }
.perch { position: absolute; top: 44px; left: 0; transform: translateX(-50%); display: flex; gap: 10px; padding-top: 8px; border-top: 8px solid var(--wood); border-radius: 4px; }
.seat { width: 62px; height: 62px; border-radius: 50%; border: 3px dashed var(--soft); background: rgba(247, 252, 250, 0.55); padding: 0; cursor: pointer; position: relative; }
.seat.near { border-color: var(--coral); background: rgba(226, 87, 76, 0.2); }
.seat .kit { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); }
.seat:has(.kit) { border-color: transparent; background: none; }
.rail { display: flex; justify-content: center; gap: 18px; min-height: 150px; width: min(420px, 100%); padding-top: 8px; border-top: 9px solid var(--wood2); border-radius: 5px; }
.kit { position: relative; border: 0; background: none; padding: 0; cursor: grab; width: 64px; flex: none; touch-action: none; }
.kit img { width: 64px; pointer-events: none; }
.kit[data-w="2"] { width: 76px; } .kit[data-w="2"] img { width: 76px; }
.kit b { position: absolute; left: 50%; top: 47%; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); font: 800 15px/22px var(--display); color: var(--ink); }
.kit.picked { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 14px; }
.kit.dragging { position: fixed; z-index: 9; cursor: grabbing; pointer-events: none; transform: translate(-50%, -14px) scale(1.08); left: 0; top: 0; }
.again { margin-top: 14px; padding: 12px 22px; border: 0; border-radius: 16px; background: var(--coral); color: #fff; font: 800 18px var(--display); box-shadow: 0 5px 0 var(--coral2); cursor: pointer; }
.again:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--coral2); }

/* ---- screenshots ---- */
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; margin-top: -70px; position: relative; z-index: 2; }
.shots figure { margin: 0; }
.shots img { border-radius: 34px; border: 8px solid var(--ink); box-shadow: 0 18px 40px -18px rgba(23, 51, 45, 0.55); background: var(--panel); }
.shots figure:nth-child(even) { margin-top: 46px; }
.shots figcaption { margin: 14px 6px 0; font-size: 16px; line-height: 1.4; color: var(--soft); }

/* ---- friends: all hanging from one line ---- */
.friends { margin-top: 110px; }
.line { height: 12px; margin: 34px -40px 0; border-radius: 99px; background: linear-gradient(var(--wood), var(--wood2)); }
.friends ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.friends li { text-align: left; }
.friends li img { height: 190px; width: auto; margin: -6px auto 14px; }
.friends li img.small { height: 120px; margin-bottom: 84px; }
.friends h3 { font-size: 21px; }
.friends li p { margin: 6px 0 0; font-size: 16px; line-height: 1.4; color: var(--soft); }

/* ---- places ---- */
.places { margin-top: 110px; }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.strip figure { margin: 0; }
.strip img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center bottom; border-radius: 22px; }
.strip figcaption { margin-top: 8px; font: 800 17px var(--display); }

/* ---- ways to play: a plain two-column list ---- */
.ways { margin-top: 110px; }
.ways dl { margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 60px; }
.ways dl > div { padding: 20px 0; border-top: 3px solid var(--sky2); }
.ways dt { font: 800 23px var(--display); }
.ways dd { margin: 4px 0 0; max-width: 32em; }

/* ---- questions ---- */
.questions { margin-top: 110px; max-width: 860px; }
.questions details { border-top: 3px solid var(--sky2); }
.questions details:last-child { border-bottom: 3px solid var(--sky2); }
.questions summary { cursor: pointer; padding: 18px 40px 18px 0; font: 800 22px var(--display); list-style: none; position: relative; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 30px; color: var(--coral); transition: transform 0.2s; }
.questions details[open] summary::after { transform: rotate(45deg); }
.questions details p { margin: 0 0 20px; max-width: 36em; }

/* ---- footer ---- */
footer { margin-top: 120px; padding: 0 22px 46px; text-align: center; background: linear-gradient(transparent, var(--sky2)); }
footer > img { height: 170px; width: auto; margin: 0 auto; }
.foot-title { font: 800 30px var(--display); margin: 6px 0 12px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.small { font-size: 14px; color: var(--soft); margin: 22px 0 0; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px !important; padding-bottom: 120px !important; }
  .demo { margin-top: 20px; }
  .shots { grid-template-columns: repeat(4, 62vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px !important; margin-top: -50px; }
  .shots figure { scroll-snap-align: center; } .shots figure:nth-child(even) { margin-top: 0; }
  .friends ul { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0; }
  .friends li { padding-bottom: 30px; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ways dl { grid-template-columns: 1fr; }
  .friends, .places, .ways, .questions { margin-top: 80px; }
}
@media (max-width: 560px) {
  .top nav a:not(:last-child) { display: none; }
  .friends ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .friends li img { height: 150px; } .friends li img.small { height: 96px; margin-bottom: 62px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line { margin-inline: -22px; }
}
@media (prefers-reduced-motion: reduce) { .beam, .hang { transition: none; } html { scroll-behavior: auto; } }
