/* ============================================================
   The Grove app (prototype). One phone-width column; on a wide
   screen it stands in the middle of the forest.
   ============================================================ */
:root {
  --ink: #f4ecd8; --ink-soft: #d8cfb6; --ink-dim: #a69d85;
  --leaf: #6aa65c; --leaf-bright: #9bd486; --amber: #f0b45a; --pearl: #e4eef6;
  --floor: #0f1d16; --deep: #0b1510;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; color: var(--ink); font-family: var(--sans); font-size: 1.1rem; line-height: 1.55;
  background: url(../img/forest-mid.svg) center bottom / auto 300px repeat-x, linear-gradient(180deg, #0d1b24, #1a2e2a 40%, var(--floor));
  -webkit-tap-highlight-color: transparent; overflow-x: clip;
}
a { color: var(--amber); }
button { font: inherit; color: inherit; }
h1, h2 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.shell {
  max-width: 460px; margin: 0 auto; min-height: 100svh; position: relative;
  background: linear-gradient(180deg, #102019, var(--deep));
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .shell { min-height: calc(100svh - 48px); border-radius: 28px; border: 1px solid rgba(240, 180, 90, .25); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; }
}

/* top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 16px;
  background: rgba(10, 20, 15, .94); border-bottom: 1px solid rgba(240, 180, 90, .14); }
.bar-brand img { height: 22px; width: auto; display: block; }
.bar-stones { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--pearl);
  border: 1px solid rgba(228, 238, 246, .3); border-radius: 22px; }
.pebble { width: 16px; height: 12px; border-radius: 50%; background: radial-gradient(60% 55% at 38% 34%, #fff, #dbe8f3 40%, #8fa6ba); box-shadow: 0 0 8px rgba(200, 225, 255, .7); }

.screen { padding: 0 16px 20px; scroll-margin-top: 56px; }
.screen[hidden] { display: none; }
.hi { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; line-height: 1.15; margin: 18px 0 12px; }
.lede { color: var(--ink-soft); margin: 0 0 12px; }
.label { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.head { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 26px 0 10px; }

/* the little clearing at the top of home */
.scene { position: relative; height: 170px; margin: 0 -16px; overflow: hidden; }
.sc-sky { position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 95%, rgba(255, 196, 118, .55), transparent 70%), linear-gradient(180deg, #13242c, #3c4f4a 55%, #c69660); }
.sc-far, .sc-mid { position: absolute; left: 0; right: 0; background-repeat: repeat-x; background-size: auto 100%; }
.sc-far { bottom: 22px; height: 90px; background-image: url(../img/forest-far.svg); }
.sc-mid { bottom: 0; height: 100px; background-image: url(../img/forest-mid.svg); background-position: 40% bottom; }
.sc-hearth { position: absolute; left: 50%; bottom: 2px; width: 120px; transform: translateX(-50%); }
.sc-fire { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.4s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scale(1, .9); } to { transform: scale(.95, 1.08); } }

.moonstone { position: absolute; right: 22%; bottom: 14px; width: 28px; height: 20px; border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(60% 55% at 38% 34%, #fff, #dbe8f3 40%, #9fb5c9 75%, #6f8396); animation: glim 3s ease-in-out infinite alternate; }
.moonstone::after { content: ""; position: absolute; inset: -12px; }
.moonstone[hidden] { display: none; }
@keyframes glim { from { box-shadow: 0 0 6px rgba(200, 225, 255, .3); } to { box-shadow: 0 0 20px rgba(210, 232, 255, .95); } }

/* today's tree */
.tree-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 16px; border-radius: 4px 20px 4px 20px;
  background: linear-gradient(160deg, #1f2d22, #152018); border-left: 4px solid var(--leaf); }
.tc-ring { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #3a2414;
  background: repeating-radial-gradient(circle at 46% 52%, #d9b07a 0 3px, #c49460 3px 5px, #d4a874 5px 8px); box-shadow: 0 0 0 3px #4d3420; }
.tc-ring svg { width: 26px; height: 42px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.tc-name { font-family: var(--serif); font-size: 1.3rem; margin: 0; color: var(--leaf-bright); }
.tc-note { margin: 4px 0 6px; font-size: 1rem; color: var(--ink-soft); }
.tc-ask { margin: 0; font-style: italic; color: var(--amber); font-size: 1rem; }

/* your paths */
.mine { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; margin-bottom: 10px;
  border-radius: 16px; background: linear-gradient(90deg, color-mix(in srgb, var(--glow) 16%, #18231c), #18231c 70%); border: 1px solid color-mix(in srgb, var(--glow) 35%, transparent); }
.mine h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.mine p { margin: 0; font-size: .9rem; color: var(--ink-dim); }
.empty { padding: 16px; border: 1px dashed rgba(216, 207, 182, .3); border-radius: 16px; color: var(--ink-soft); }
.empty p { margin: 0 0 10px; }
.mark { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 35%, #0b1510), #0b1510 70%); box-shadow: 0 0 16px color-mix(in srgb, var(--glow) 40%, transparent); }
.mark svg { width: 30px; height: 30px; fill: none; stroke: var(--glow); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: 26px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; color: #1d1408; background: radial-gradient(120% 140% at 50% 0%, #ffd892, #f0b45a 55%, #d98a3c); }
.btn.quiet { background: transparent; color: var(--ink); border: 1px solid rgba(216, 207, 182, .4); }
.btn.small { min-height: 44px; padding: 8px 16px; }

/* gift */
.gift { border-radius: 16px; background: #18231c; border: 1px solid rgba(240, 180, 90, .25); }
.gift summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--amber); list-style: none; }
.gift summary::-webkit-details-marker { display: none; }
.g-box { width: 30px; height: 24px; border-radius: 4px; background: repeating-linear-gradient(90deg, #4e3520 0 6px, #563a23 6px 8px); border-top: 5px solid #7a5432; box-shadow: inset 12px 0 0 -9px var(--amber), inset -12px 0 0 -9px var(--amber); }
.g-in { padding: 0 16px 16px; }
.g-in h3 { font-family: var(--serif); margin: 4px 0 0; font-size: 1.25rem; }
.g-in .by { margin: 0 0 8px; color: var(--ink-dim); font-size: .95rem; }
.g-in .verse { font-family: var(--serif); font-style: italic; border-left: 2px solid rgba(240, 180, 90, .5); padding-left: 12px; }

/* the store */
.terms { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: 1rem; color: var(--ink-soft); }
.terms li { padding-left: 22px; position: relative; }
.terms li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 10px; height: 14px; border-radius: 0 100% 0 100%; background: var(--leaf); }
.store { display: grid; gap: 14px; }
.trailhead { display: grid; grid-template-columns: 60px 1fr; gap: 14px; padding: 16px; text-align: left; width: 100%; cursor: pointer;
  border-radius: 6px 26px 6px 26px; border: 1px solid color-mix(in srgb, var(--glow) 40%, transparent);
  background: radial-gradient(100% 120% at 0% 0%, color-mix(in srgb, var(--glow) 20%, transparent), transparent 60%), linear-gradient(160deg, #24302a, #172119); }
.trailhead .mark { width: 60px; height: 60px; }
.th-short { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--glow); }
.th-name { margin: 0; font-family: var(--serif); font-size: 1.3rem; }
.th-tell { margin: 4px 0; font-size: 1rem; color: var(--ink-soft); }
.th-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 6px; font-size: .9rem; color: var(--ink-dim); }
.th-state { color: var(--leaf-bright); font-weight: 700; }
.all-paths { margin-top: 18px; padding: 18px; border-radius: 26px 6px 26px 6px; background: radial-gradient(100% 100% at 100% 0%, rgba(240, 180, 90, .2), transparent 60%), #1b2219; border: 1px solid rgba(240, 180, 90, .4); }
.all-paths h2 { font-family: var(--serif); font-weight: 500; margin: 2px 0 4px; font-size: 1.35rem; }
.all-paths p:not(.label) { margin: 0 0 12px; color: var(--ink-soft); }
.bring { display: grid; gap: 4px; margin-top: 16px; padding: 16px; border-radius: 16px; text-decoration: none; color: var(--ink-soft); border: 1px dashed rgba(240, 180, 90, .35); }

/* moonstone trail */
.trail { display: block; width: 100%; max-width: 340px; margin: 0 auto; }
.t-path { fill: none; stroke: rgba(216, 207, 182, .25); stroke-width: 10; stroke-linecap: round; }
.t-lit { fill: none; stroke: rgba(228, 238, 246, .8); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1.2s ease; }
.t-stone { fill: #3c4a52; stroke: rgba(228, 238, 246, .3); }
.t-stone.on { fill: #e4eef6; stroke: none; filter: drop-shadow(0 0 5px rgba(200, 225, 255, .9)); }
.finds { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.finds li { padding: 12px 14px; border-radius: 14px; background: #18231c; border-left: 3px solid var(--pearl); font-size: 1rem; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center;
  background: rgba(10, 20, 15, .97); border-top: 1px solid rgba(240, 180, 90, .2); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; max-width: 153px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 8px; min-height: 64px; text-decoration: none; color: var(--ink-dim); font-size: .85rem; font-weight: 700; }
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--amber); }
@media (min-width: 520px) { .tabs { position: sticky; bottom: 0; margin-top: auto; } .shell { display: flex; flex-direction: column; padding-bottom: 0; } #screens { flex: 1; } }

/* the sheet (a path, close up) */
.sheet { width: min(460px, 100vw); max-width: 100vw; max-height: 92svh; margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; color: var(--ink);
  background: linear-gradient(180deg, #1c2a20, #101a14); border-top: 2px solid var(--glow, var(--amber)); }
.sheet::backdrop { background: rgba(3, 8, 6, .7); }
.sh-in { padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
.sh-top { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.sh-top .mark { width: 64px; height: 64px; }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 0; }
.sheet ul { padding-left: 20px; color: var(--ink-soft); }
.sh-choose { display: grid; gap: 10px; margin-top: 16px; }
.sh-note { font-size: .95rem; color: var(--ink-soft); padding: 12px 14px; border-radius: 12px; background: rgba(228, 238, 246, .06); border-left: 3px solid var(--pearl); }
.sh-close { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(216, 207, 182, .3); background: none; cursor: pointer; font-size: 1.3rem; }

.toast { position: fixed; left: 50%; bottom: 84px; z-index: 9; transform: translate(-50%, 20px); opacity: 0; margin: 0; max-width: calc(100vw - 32px); text-align: center;
  background: #1b2a33; border: 1px solid rgba(228, 238, 246, .5); color: var(--pearl); padding: 10px 16px; border-radius: 20px; transition: opacity .4s, transform .4s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
