/* gigawattvalley.com: one stylesheet for every page (scripts/site_build.py lays the pages out) */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#070b14;--bg2:#0d1422;--bg3:#131c2e;--line:rgba(120,170,230,.16);
  --blue:#46aaff;--cyan:#3fe0d0;--green:#5ad27a;--amber:#ffb84a;--red:#ff6b5e;
  --text:#d3deee;--soft:#a3b3c9;--dim:#74859d;--white:#f2f7ff;
  --sans:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,'SF Mono',Menlo,Consolas,'Courier New',monospace;
  --title:'Michroma',var(--sans);
  --nav-h:68px;
}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--nav-h) + 16px)}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:17px;line-height:1.65;overflow-x:hidden}
a{color:var(--blue);text-decoration:none;transition:color .2s}
a:hover{color:var(--cyan)}
img,video{max-width:100%;display:block}
b,strong{color:var(--white)}

/* ---- page furniture */
.wrap{max-width:1160px;margin:0 auto;padding:0 1.2rem}
.page-head{padding:3.4rem 0 1.6rem}
.page-head .eyebrow{font:700 .8rem var(--mono);letter-spacing:.22em;text-transform:uppercase;color:var(--cyan)}
.page-head h1{font-family:var(--title);font-size:clamp(1.8rem,4.6vw,2.9rem);color:var(--white);line-height:1.2;margin:.5rem 0 .8rem}
.page-head p{color:var(--soft);font-size:1.1rem;max-width:760px}
section{padding:2.6rem 0}
h2{font-size:clamp(1.35rem,3vw,1.8rem);color:var(--white);line-height:1.25;margin-bottom:.9rem}
h2.rule{border-left:4px solid var(--blue);padding-left:.9rem}
h3{font-size:1.1rem;color:var(--white);margin-bottom:.4rem}
p{margin-bottom:.9rem}
.lead{color:var(--soft);font-size:1.08rem;max-width:780px}
.tag{display:inline-block;font:700 .72rem var(--mono);letter-spacing:.16em;text-transform:uppercase;padding:.22rem .6rem;border-radius:4px;border:1px solid var(--line);color:var(--cyan)}
.tag.amber{color:var(--amber)}.tag.green{color:var(--green)}.tag.blue{color:var(--blue)}.tag.red{color:var(--red)}
.btn{display:inline-block;padding:.85rem 1.6rem;border-radius:8px;font-weight:700;font-size:1.02rem;border:1px solid var(--blue);color:var(--blue);background:rgba(70,170,255,.06);transition:all .2s}
.btn:hover{background:var(--blue);color:#04101e}
.btn.solid{color:#04101e;background:linear-gradient(180deg,#6bbcff,#3a9bf2);border-color:transparent;box-shadow:0 0 24px rgba(70,170,255,.35)}
.btn.solid:hover{box-shadow:0 0 36px rgba(70,170,255,.65);transform:translateY(-2px)}
.btn.big{font-size:1.15rem;padding:1.05rem 2.2rem}
.card{background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:1.3rem 1.4rem;transition:border-color .2s,transform .2s}
a.card{display:block;color:var(--text)}
a.card:hover{border-color:var(--blue);transform:translateY(-3px);color:var(--text)}
.grid{display:grid;gap:1.1rem}
.g2{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}
.g3{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.g4{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.more{font-weight:700;white-space:nowrap}
.more::after{content:' →'}

/* ---- home */
.hero{position:relative;padding:3.2rem 0 3rem;overflow:hidden}
.hero::before{content:'';position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at 20% 0%,rgba(70,170,255,.18),transparent 55%),radial-gradient(ellipse at 90% 30%,rgba(63,224,208,.10),transparent 50%)}
.hero .cols{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:2.4rem;align-items:center}
.hero h1{font-family:var(--title);font-size:clamp(2.1rem,5.4vw,3.9rem);line-height:1.12;color:var(--white);text-shadow:0 0 34px rgba(70,170,255,.45)}
.hero .tagline{font:700 .95rem var(--mono);letter-spacing:.16em;text-transform:uppercase;color:var(--cyan);margin:1rem 0 1.1rem}
.hero .blurb{color:var(--soft);font-size:1.12rem;max-width:560px}
.hero .actions{display:flex;flex-wrap:wrap;gap:.8rem;margin-top:1.6rem}
.hero .fine{margin-top:1rem;color:var(--dim);font-size:.9rem}
.hero video,.hero img.art{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:12px;border:1px solid rgba(70,170,255,.35);box-shadow:0 0 50px rgba(70,170,255,.22),0 20px 70px rgba(0,0,0,.6);background:#000}
@media(max-width:900px){.hero .cols{grid-template-columns:1fr}}
.numbers{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:1rem;text-align:center}
.numbers div{background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:1.1rem .6rem}
.numbers b{display:block;font-family:var(--title);font-size:1.9rem;color:var(--blue);line-height:1.2}
.numbers span{color:var(--soft);font-size:.92rem}
.pillar img{border-radius:8px;margin-bottom:.9rem;aspect-ratio:16/9;object-fit:cover;width:100%}
.news{display:flex;flex-wrap:wrap;align-items:center;gap:.8rem 1.4rem;background:linear-gradient(90deg,rgba(63,224,208,.10),transparent);border:1px solid rgba(63,224,208,.3);border-radius:10px;padding:1rem 1.3rem}
.news time{font:700 .8rem var(--mono);letter-spacing:.14em;color:var(--amber)}
.cta{text-align:center;padding:3.6rem 1rem;margin-top:1rem;background:linear-gradient(180deg,transparent,rgba(70,170,255,.09))}
.cta h2{font-family:var(--title);font-size:clamp(1.4rem,3.4vw,2.1rem)}
.cta p{color:var(--soft);margin-bottom:1.5rem}

/* ---- gameplay: a contents list beside the chapters */
.with-toc{display:grid;grid-template-columns:230px minmax(0,1fr);gap:2.6rem;align-items:start}
.toc{position:sticky;top:calc(var(--nav-h) + 20px);font-size:.98rem;border-left:1px solid var(--line);padding-left:1rem}
.toc b{display:block;font:700 .75rem var(--mono);letter-spacing:.18em;text-transform:uppercase;color:var(--dim);margin-bottom:.5rem}
.toc a{display:block;color:var(--soft);padding:.28rem 0}
.toc a:hover{color:var(--white)}
@media(max-width:900px){.with-toc{grid-template-columns:1fr}.toc{position:static;display:flex;flex-wrap:wrap;gap:.2rem 1rem;border-left:none;padding-left:0}.toc b{width:100%}}
.chapter{padding:1.8rem 0 2.4rem;border-top:1px solid var(--line)}
.chapter:first-child{border-top:none;padding-top:0}
.chapter .fig{margin:1.2rem 0 .4rem}
.fig img{border-radius:10px;border:1px solid var(--line);width:100%}
.fig figcaption{color:var(--dim);font-size:.9rem;margin-top:.5rem}
ul.plain{list-style:none}
ul.ticks{list-style:none;margin:.4rem 0 1rem}
ul.ticks li{position:relative;padding-left:1.3rem;margin:.4rem 0;color:var(--soft)}
ul.ticks li::before{content:'';position:absolute;left:0;top:.62em;width:.5rem;height:.5rem;background:var(--blue);border-radius:2px}
table{width:100%;border-collapse:collapse;font-size:.96rem;margin:.6rem 0 1rem}
th{text-align:left;font:700 .74rem var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--dim);padding:.55rem .7rem;border-bottom:1px solid var(--line)}
td{padding:.7rem;border-bottom:1px solid rgba(255,255,255,.05);vertical-align:top;color:var(--soft)}
td:first-child{color:var(--white);font-weight:600;white-space:nowrap}
.scroll-x{overflow-x:auto}

/* ---- buildings */
.chips{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0 1.6rem;position:sticky;top:var(--nav-h);z-index:50;background:rgba(7,11,20,.94);backdrop-filter:blur(10px);padding:.7rem 0}
.chips button{font:600 .95rem var(--sans);color:var(--soft);background:var(--bg2);border:1px solid var(--line);border-radius:999px;padding:.45rem 1rem;cursor:pointer;transition:all .2s}
.chips button:hover{color:var(--white);border-color:var(--blue)}
.chips button.on{color:#04101e;background:var(--blue);border-color:var(--blue)}
.bgroup h2{margin-top:1.4rem}
.building{padding:0;overflow:hidden;display:flex;flex-direction:column}
.building .clip{position:relative;aspect-ratio:4/3;background:#96c4e6}
.building video,.building .clip img{width:100%;height:100%;object-fit:cover}
.building .body{padding:1.1rem 1.2rem 1.2rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.building h3{font-size:1.2rem;margin:0}
.building .price{font:700 1rem var(--mono);color:var(--green)}
.building p{color:var(--soft);font-size:.97rem;margin:0}
.stats{display:flex;flex-wrap:wrap;gap:.4rem}
.stats span{font:600 .8rem var(--mono);color:var(--text);background:var(--bg3);border-radius:5px;padding:.2rem .5rem}
.stats span.out{color:var(--green)}.stats span.in{color:var(--amber)}
.building .foot{margin-top:auto;padding-top:.5rem;color:var(--dim);font-size:.88rem}

/* ---- modes */
.tier{display:grid;grid-template-columns:3rem 1fr;gap:1rem;align-items:start}
.tier .n{font-family:var(--title);font-size:1.6rem;color:var(--blue);line-height:1.3}
.scenario .days{float:right;font:700 .78rem var(--mono);color:var(--amber)}
.scenario .goal{color:var(--white);font-weight:600}
.scenario .stars{color:var(--dim);font-size:.88rem;margin:0}

/* ---- gallery */
.shots{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:1rem}
.shots figure{background:var(--bg2);border:1px solid var(--line);border-radius:10px;overflow:hidden;cursor:zoom-in;transition:border-color .2s,transform .2s}
.shots figure:hover{border-color:var(--blue);transform:translateY(-3px)}
.shots img{width:100%;aspect-ratio:16/9;object-fit:cover}
.shots figcaption{padding:.7rem .9rem;font-size:.92rem;color:var(--soft)}
.film video{width:100%;border-radius:12px;border:1px solid var(--line);background:#000}
#lightbox{position:fixed;inset:0;z-index:400;background:rgba(3,6,12,.94);display:none;align-items:center;justify-content:center;flex-direction:column;gap:.8rem;padding:1.5rem;cursor:zoom-out}
#lightbox.on{display:flex}
#lightbox img{max-width:100%;max-height:86vh;border-radius:8px}
#lightbox p{color:var(--soft);margin:0;text-align:center}

/* ---- guide */
.steps{counter-reset:step;list-style:none}
.steps li{position:relative;padding:0 0 1.2rem 3.2rem;counter-increment:step}
.steps li::before{content:counter(step);position:absolute;left:0;top:0;width:2.2rem;height:2.2rem;border-radius:50%;background:var(--bg3);border:1px solid var(--blue);color:var(--blue);font:700 1rem var(--mono);display:flex;align-items:center;justify-content:center}
.keys td:last-child{text-align:right}
kbd{font:600 .85rem var(--mono);background:var(--bg3);border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:.12rem .5rem;color:var(--cyan);white-space:nowrap}
details{background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:.9rem 1.2rem;margin-bottom:.7rem}
summary{cursor:pointer;font-weight:700;color:var(--white)}
details p{margin:.7rem 0 0;color:var(--soft)}

/* ---- changelog */
.rel{display:grid;grid-template-columns:8.5rem 1fr;gap:0 1.4rem;padding:1.6rem 0;border-top:1px solid var(--line)}
.rel time{color:var(--amber);font:700 .85rem var(--mono);letter-spacing:.08em;padding-top:.3rem;white-space:nowrap}
.rel h2{font-size:1.2rem;margin-bottom:.7rem}
.rel:first-of-type h2{color:var(--cyan)}
.rel ul{list-style:none}
.rel li{position:relative;padding-left:1.2rem;margin:.55rem 0;color:var(--soft)}
.rel li::before{content:'';position:absolute;left:0;top:.62em;width:.45rem;height:.45rem;background:var(--blue);border-radius:2px;opacity:.8}
code{font-family:var(--mono);color:var(--green);font-size:.92em}
@media(max-width:640px){.rel{grid-template-columns:1fr}}

/* ---- play: the game fills what the bar leaves */
body.play{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
body.play #nav{position:relative;flex:none}
.game-wrap{flex:1;min-height:0;background:#0c1220}
.game-wrap iframe{border:none;width:100%;height:100%;display:block}

footer{margin-top:3rem;border-top:1px solid var(--line);padding:2.4rem 1.2rem 3rem;color:var(--dim);font-size:.95rem}
footer .cols{max-width:1160px;margin:0 auto;display:grid;grid-template-columns:1.4fr repeat(3,1fr);gap:1.6rem}
footer b{display:block;font:700 .75rem var(--mono);letter-spacing:.18em;text-transform:uppercase;color:var(--soft);margin-bottom:.6rem}
footer a{display:block;color:var(--dim);padding:.15rem 0}
footer a:hover{color:var(--white)}
footer .brand{font-family:var(--title);color:var(--white);font-size:1rem;margin-bottom:.5rem}
@media(max-width:760px){footer .cols{grid-template-columns:1fr 1fr}}
