/* World of Deusaster: the field guide. Builds on ../site.css (tokens, plates, frames, buttons, footer). */

:root {
  --sky-dawn: #e9926a;
  --sky-day: #8cc4e8;
  --sky-dusk: #d86a4a;
  --sky-night: #1d2740;
  --lane-village: #f4b43c;
  --lane-wild: #8fc27a;
}

/* ---------- hero ---------- */
.world-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(420px, 42vw, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.world-hero-art, .world-hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.world-hero-art img { object-fit: cover; object-position: 50% 90%; z-index: -2; }
.world-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(18, 22, 20, .55) 0%, rgba(18, 22, 20, 0) 22%),
    linear-gradient(to top, var(--night) 0%, rgba(18, 22, 20, .7) 30%, rgba(18, 22, 20, 0) 65%);
}
.world-hero-copy { padding-block: 0 clamp(1.5rem, 4vw, 3.5rem); }
.world-hero h1 {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem);
  color: var(--gold);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 30px rgba(0, 0, 0, .6);
}
.subtitle {
  margin-top: .5rem;
  max-width: 42ch;
  font-size: var(--step-1);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

/* ---------- intro ---------- */
.guide-intro { padding-block: clamp(2.5rem, 5vw, 4.5rem) var(--section); display: grid; gap: 1.2rem; }
.guide-intro .lead { max-width: 52ch; }
.note { color: var(--dust); max-width: 60ch; }
.contents { display: flex; flex-wrap: wrap; gap: .5rem .6rem; margin-top: .6rem; }
.contents a {
  padding: .35em .9em; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .92rem;
  color: var(--parchment); background: var(--stone); box-shadow: inset 0 0 0 1px rgba(244, 180, 60, .25);
}
.contents a:hover { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.copy > p + .points, .copy > .points + p, .copy > p + p { margin-top: .9rem; }
.aside { color: var(--dust); font-style: italic; }

/* ---------- the day clock ---------- */
.day { padding-block: 0 var(--section); display: grid; gap: 1.6rem; }
.day-head h2 { color: var(--gold); font-size: var(--step-2); text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.day-head p { margin-top: .4rem; color: var(--dust); }
.clock { display: grid; gap: 1.2rem; }
.sky { position: relative; padding-top: 6px; }
.sky-track {
  height: 56px; border-radius: 10px; overflow: hidden; position: relative;
  box-shadow: 0 0 0 2px #0a0c0b, 0 0 0 3px rgba(244, 180, 60, .25), 0 14px 26px rgba(0, 0, 0, .45);
  background: linear-gradient(to right,
    var(--sky-night) 0%, var(--sky-night) 20.8%, var(--sky-dawn) 25%, var(--sky-day) 29.2%,
    var(--sky-day) 75%, var(--sky-dusk) 79.2%, var(--sky-night) 83.3%, var(--sky-night) 100%);
}
.sky-band { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .85); left: 37.5%; box-shadow: 0 0 12px rgba(255, 255, 255, .8); }
.hour {
  position: absolute; left: 0; right: 0; top: 6px; width: 100%; height: 56px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: grab;
}
.hour:active { cursor: grabbing; }
.hour::-webkit-slider-runnable-track { height: 56px; background: transparent; }
.hour::-moz-range-track { height: 56px; background: transparent; }
.hour::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 46px; height: 46px; margin-top: 5px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff6c8, #f6c445 55%, #e08a1e);
  box-shadow: 0 0 0 3px #1a1209, 0 0 24px rgba(255, 210, 90, .8);
}
.hour::-moz-range-thumb {
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff6c8, #f6c445 55%, #e08a1e);
  box-shadow: 0 0 0 3px #1a1209, 0 0 24px rgba(255, 210, 90, .8);
}
.sky.is-night .hour::-webkit-slider-thumb { background: radial-gradient(circle at 40% 38%, #ffffff, #d9e0ee 60%, #9aa6c0); box-shadow: 0 0 0 3px #10141f, 0 0 22px rgba(200, 215, 255, .7); }
.sky.is-night .hour::-moz-range-thumb { background: radial-gradient(circle at 40% 38%, #ffffff, #d9e0ee 60%, #9aa6c0); box-shadow: 0 0 0 3px #10141f, 0 0 22px rgba(200, 215, 255, .7); }
.hour:focus-visible { outline: none; }
.hour:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ember), 0 0 24px rgba(255, 210, 90, .8); }
.hour:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--ember), 0 0 24px rgba(255, 210, 90, .8); }
.sky-hours {
  display: flex; justify-content: space-between; margin-top: .45rem; padding-inline: 2px;
  font-size: .78rem; font-weight: 800; color: var(--dust); font-variant-numeric: tabular-nums;
}
.clock-read { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; }
.clock-time { font-family: var(--display); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); color: var(--gold); font-variant-numeric: tabular-nums; }
.clock-phase { font-family: var(--body); font-size: 1rem; font-weight: 700; color: var(--parchment); margin-left: .4rem; }
.clock-play {
  font: 700 .95rem var(--body); color: var(--parchment); cursor: pointer;
  padding: .55em 1.2em; border-radius: 999px; border: 0;
  background: var(--stone); box-shadow: inset 0 0 0 1px rgba(244, 180, 60, .4);
}
.clock-play:hover, .clock-play[aria-pressed="true"] { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.lane {
  border: 22px solid transparent;
  border-image: url("../img/ui/stone.webp") 52 fill / 22px stretch;
  padding: .3rem .6rem;
}
.lane h3 { margin: 0 0 .8rem; font: 400 var(--step-1) var(--display); color: var(--gold); }
.lane-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.lane-rows li { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); gap: .2rem .8rem; align-items: start; opacity: .38; transition: opacity .25s ease; }
.lane-rows li.is-on { opacity: 1; }
.lane-rows .when { font-size: .8rem; font-weight: 800; color: var(--dust); font-variant-numeric: tabular-nums; padding-top: .2em; }
.lane-rows .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); position: relative; overflow: hidden; }
.lane-rows .bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--lane-village); }
[data-lane="wild"] .bar span { background: var(--lane-wild); }
.lane-rows .bar i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; left: 37.5%; }
.lane-rows li.is-on .what { font-weight: 700; }

.day-table summary { cursor: pointer; font-weight: 800; color: var(--gold); }
.table-wrap { overflow-x: auto; margin-top: .8rem; }
.day-table table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .95rem; }
.day-table th, .day-table td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid rgba(244, 180, 60, .15); vertical-align: top; }
.day-table th { color: var(--dust); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.day-table td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--dust); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.6rem); }
@media (max-width: 760px) { .trio { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the food web ---------- */
.wild { padding-block: 0 var(--section); display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.wild-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
.web { display: grid; gap: 1rem; }
.web-svg { width: 100%; height: auto; overflow: visible; }
.web-svg marker path { fill: var(--dust); }
.edge { fill: none; stroke: rgba(185, 173, 148, .35); stroke-width: 3; transition: stroke .2s ease, opacity .2s ease; }
.edge.charge { stroke-dasharray: 9 7; }
.web.is-focused .edge { opacity: .12; }
.web.is-focused .edge.is-on { opacity: 1; stroke: var(--gold); }
.web.is-focused .edge.is-on.charge { stroke: var(--ember); }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node .ring { fill: none; stroke: #0a0c0b; stroke-width: 6; }
.node .ring2 { fill: none; stroke: rgba(244, 180, 60, .45); stroke-width: 2.5; transition: stroke .2s ease, stroke-width .2s ease; }
.node .label { fill: var(--parchment); font: 400 22px var(--display); text-anchor: middle; paint-order: stroke; stroke: #0b0d0c; stroke-width: 5px; }
.node:hover .ring2, .node:focus-visible .ring2, .node.is-on .ring2 { stroke: var(--gold); stroke-width: 5; }
.node:focus-visible .ring2 { stroke: var(--ember); }
.web.is-focused .node:not(.is-on):not(.is-near) { opacity: .45; }
.web-read { padding: .2rem .4rem; min-height: 9rem; }
.web-name { font: 400 var(--step-1) var(--display); color: var(--gold); margin-bottom: .4rem; }
.web-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .95rem; }
.web-lines li { position: relative; padding-left: 1.2em; }
.web-lines li::before { content: ""; position: absolute; left: .1em; top: .6em; width: .42em; height: .42em; background: var(--gold); transform: rotate(45deg); }
.web-lines li.charge::before { background: var(--ember); }
.web-list { display: none; list-style: none; margin: 0; padding: 0; gap: 1rem; }
.web-list > li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .9rem; align-items: start; }
.web-list img { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 0 3px #0a0c0b, 0 0 0 5px rgba(244, 180, 60, .45); }
.web-list-name { font: 400 1.2rem var(--display); color: var(--gold); margin-bottom: .2rem; }
.web-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .95rem; }

/* ---------- closing buttons ---------- */
.world-cta { display: grid; justify-items: center; }

@media (max-width: 960px) {
  .lanes, .wild-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .lane { border-width: 16px; border-image-width: 16px; padding: .2rem .3rem; }
  .lane-rows li { grid-template-columns: minmax(0, 1fr); }
  .web-svg, .web-read { display: none; }
  .web-list { display: grid; }
  .contents a { font-size: .85rem; }
}
