/* Landing page. Tokens, atmosphere and tooltips come from base.css.
   The page reads like notes left in the cellar (old print), with the
   machine's own pixel voice wherever the machine speaks. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body.landing {
  margin: 0;
  background:
    radial-gradient(ellipse 60% 40% at 72% 4%, #2c1c10 0%, transparent 70%),
    linear-gradient(#100b08, var(--earth) 30%, #080605);
  color: var(--bone);
  font-family: var(--f-tell);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
}
html[lang="ko"] body.landing { font-size: 16.5px; line-height: 1.8; word-break: keep-all; }
.landing a { color: inherit; }
.landing h1, .landing h2, .landing h3 { margin: 0; font-weight: normal; color: var(--bone); }
html[lang="ko"] .landing h1, html[lang="ko"] .landing h2 { font-weight: 800; }
html[lang="ko"] .landing h3 { font-weight: 700; }
.landing p { margin: 0; }
.landing .atmo .vignette { background: radial-gradient(ellipse 90% 85% at 50% 45%, transparent 55%, #0402018c 100%); }
:focus-visible { outline: 2px solid var(--tallow); outline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: linear-gradient(#0d0907f2, #0d0907b0);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #ffffff0a;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 21px; color: var(--tallow-hi); white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); font-size: 16px; }
.topbar nav a { text-decoration: none; color: var(--bone-dim); }
.topbar nav a:hover { color: var(--bone); }
.topbar nav .nav-play {
  color: #1f1206; background: var(--tallow); border-radius: 3px; padding: 4px 14px;
  font-family: var(--f-machine); font-size: 20px; line-height: 1.2;
}
.topbar nav .nav-play:hover { background: var(--tallow-hi); color: #1f1206; }
.langs { display: flex; gap: 2px; }
.langs button {
  background: none; border: 1px solid transparent; color: var(--bone-faint); border-radius: 3px;
  font: inherit; font-size: 14px; padding: 2px 7px; cursor: pointer;
}
.langs button[aria-pressed="true"] { color: var(--bone); border-color: #4d3a28; }
@media (max-width: 760px) { .topbar nav a:not(.nav-play) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-family: var(--f-machine); font-size: 23px; line-height: 1;
  padding: 12px 22px 11px; border-radius: 3px;
  color: var(--bone); background: #1a130e; border: 1px solid #4d3a28;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--tallow); }
.btn.primary { background: var(--blood); border-color: #b2352a; color: #f6e6dc; box-shadow: 0 0 30px #8e1b1444; }
.btn.primary:hover { background: #a6231a; }

/* ---------- hero: the room, the bulb, the machine ---------- */
.hero {
  position: relative;
  min-height: min(100vh, 900px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); align-items: center; gap: clamp(24px, 5vw, 70px);
  max-width: 1180px; margin: 0 auto;
  padding: 110px clamp(16px, 4vw, 40px) 60px;
  overflow: hidden; overflow: clip; /* the swinging light cone must not widen the page */
}
.hero-text { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(54px, 8.4vw, 112px); line-height: .95; letter-spacing: -0.01em;
  color: var(--bone);
  text-shadow: 0 0 40px #f3c77a1a;
}
html[lang="ko"] .hero h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: 1.12; letter-spacing: -0.03em; }
.hero h1 .fall { display: inline-block; transform-origin: 20% 0; }
.hero.dark h1 .fall { animation: drop 1.2s cubic-bezier(.6,0,.9,.5); }
@keyframes drop { 0% { transform: none; } 40% { transform: translateY(6px) rotate(2deg); opacity: .6; } 100% { transform: none; } }
.hero .lead { margin-top: 26px; max-width: 34em; font-size: 21px; line-height: 1.55; color: #cbbfa9; }
html[lang="ko"] .hero .lead { font-size: 17.5px; line-height: 1.85; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero .fine { margin-top: 22px; font-size: 16px; color: var(--bone-faint); }
.hero .fallen { margin-top: 18px; font-family: var(--f-machine); font-size: 21px; color: var(--phosphor); text-shadow: 0 0 8px #5dd88a44; min-height: 1.2em; }

.stage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 150px; }
/* the bulb on its cord, swinging; its light swings with it */
.rig {
  position: absolute; top: -110px; left: 50%; width: 0; height: 260px;
  transform-origin: 50% 0; animation: sway 8s ease-in-out infinite;
  z-index: 3;
}
@keyframes sway { 0%, 100% { transform: rotate(3.2deg); } 50% { transform: rotate(-3.2deg); } }
.rig .cord { position: absolute; left: -1px; top: 0; width: 2px; height: 200px; background: linear-gradient(#1b1410, #3a2c22); }
.rig .socket { position: absolute; left: -9px; top: 196px; width: 18px; height: 20px; border-radius: 3px 3px 2px 2px; background: linear-gradient(90deg, #1c1714, #4a3f36, #1c1714); }
.rig .bulb {
  position: absolute; left: -15px; top: 212px; width: 30px; height: 38px; border-radius: 45% 45% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 50% 60%, #fff4d6 0%, #ffd27a 35%, #e0953a 75%, #8a4a14 100%);
  box-shadow: 0 0 30px 8px #ffc46a99, 0 0 90px 30px #f3a64a3a;
  animation: filament 9s infinite;
}
.rig .cone {
  position: absolute; left: -340px; top: 230px; width: 680px; height: 640px; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, #f8c77a2e 0%, #f8c77a12 45%, transparent 75%);
  mix-blend-mode: screen;
  animation: filament 9s infinite;
}
@keyframes filament {
  0%, 100%, 40%, 47% { opacity: 1; }
  41% { opacity: .3; } 42% { opacity: .95; } 44% { opacity: .15; } 45% { opacity: .9; }
  80% { opacity: .9; } 81% { opacity: .55; } 82% { opacity: 1; }
}
.hero.dark .rig .bulb { animation: none; background: radial-gradient(circle at 50% 60%, #4a3a2a, #1a120c); box-shadow: none; }
.hero.dark .rig .cone { animation: none; opacity: 0; }

/* the demo machine, a smaller cousin of the one in the game */
.demo {
  position: relative; z-index: 2; width: min(100%, 470px);
  background: linear-gradient(180deg, #5a2219, #3b1611 14%, #3b1611 86%, #1c0805);
  border: 2px solid #120403; border-radius: 16px 16px 8px 8px; padding: 14px 16px 16px;
  box-shadow: 0 30px 70px #000e, inset 0 2px 0 #8a3a2a44;
  transition: filter .3s;
}
.hero.dark .demo { filter: brightness(.35) saturate(.6); }
.demo-sign {
  text-align: center; font-family: var(--f-tell); color: var(--tallow-hi); font-size: 26px; letter-spacing: 3px;
  text-shadow: 0 0 12px #f3b45a77; background: #1a0805; border-radius: 6px; padding: 4px 0 2px; margin-bottom: 8px;
}
html[lang="ko"] .demo-sign { font-weight: 800; letter-spacing: 1px; }
.demo-sign .dead { animation: neon 6.5s infinite; }
@keyframes neon { 0%, 60%, 100% { opacity: 1; } 61% { opacity: .15; } 62% { opacity: 1; } 63% { opacity: .1; } 66% { opacity: .2; } 67% { opacity: 1; } }
.demo-top {
  display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-machine); font-size: 19px;
  background: #030101; border-radius: 4px; padding: 3px 10px; margin-bottom: 8px; color: var(--ember);
}
.demo-top #demoCurse { color: #c26ae0; }
.demo-screen { background: #050a07; border: 3px solid #6b5228; border-radius: 7px; padding: 8px; position: relative; overflow: hidden; }
.demo-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #0000 0 2px, #0005 2px 3px); box-shadow: inset 0 0 40px #000; }
.demo-screen.flash::before { content: ''; position: absolute; inset: 0; background: #5a0f4a; mix-blend-mode: screen; animation: flash 1s; z-index: 3; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }
.demo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.demo-grid span {
  aspect-ratio: 1; display: grid; place-items: center; position: relative;
  font-size: clamp(22px, 4.6vw, 40px); border-radius: 5px;
  background: radial-gradient(circle at 50% 40%, #142219, #070e0a); border: 1px solid #16281d;
  transition: opacity .15s, box-shadow .15s, transform .15s;
}
.demo-grid span img.sym { width: 74%; height: 74%; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #000a); }
.demo-grid span.spin { filter: blur(1.5px) saturate(.5); opacity: .7; }
.demo-grid span.dim { opacity: .3; }
.demo-grid span.hit { box-shadow: 0 0 0 2px var(--tallow-hi), 0 0 16px #e8c98a77; transform: scale(1.05); z-index: 1; opacity: 1; }
.demo-grid span.cursed { box-shadow: 0 0 0 2px var(--bruise), 0 0 20px #8a63c4; background: radial-gradient(circle, #3a0c34, #0c020a); opacity: 1; }
.demo-grid span i {
  position: absolute; top: 2px; left: 4px; font-style: normal; font-size: 15px; font-family: var(--f-machine);
  text-shadow: 0 0 4px #000, 0 0 8px currentColor;
}
.demo-read {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; min-height: 44px;
  background: #030805; border: 1px solid #16281d; border-radius: 4px; padding: 4px 12px;
  font-family: var(--f-machine); color: var(--phosphor); font-size: 20px; line-height: 1.1;
}
.demo-read b { font-weight: normal; color: var(--tallow-hi); font-size: 32px; white-space: nowrap; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 96px; }
  .stage { order: -1; padding-top: 120px; }
  .rig { top: -96px; height: 210px; }
  .rig .cord { height: 150px; }
  .rig .socket { top: 146px; } .rig .bulb { top: 162px; } .rig .cone { top: 180px; }
}

/* ---------- sections ---------- */
main { position: relative; z-index: 1; }
.block { max-width: 1180px; margin: 0 auto; padding: 90px clamp(16px, 4vw, 40px) 20px; }
.head { max-width: 40em; margin-bottom: 36px; }
.head h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; color: var(--bone); }
html[lang="ko"] .head h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.25; }
.head p { margin-top: 12px; color: var(--bone-dim); font-size: 20px; }
html[lang="ko"] .head p { font-size: 16.5px; }
.block h3 { font-size: 26px; color: var(--tallow-hi); margin-bottom: 14px; }
html[lang="ko"] .block h3 { font-size: 20px; }

/* one night: a real sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.steps li { padding: 0 24px 0 0; border-left: 1px solid #3a2c22; padding-left: 20px; }
.steps li:first-child { border-left: 0; padding-left: 0; }
.steps .n { display: block; font-size: 44px; line-height: 1; color: var(--blood-hi); margin-bottom: 10px; font-family: 'IM Fell English', serif; }
.steps h4 { margin: 0 0 6px; font-size: 22px; font-weight: normal; color: var(--bone); }
html[lang="ko"] .steps h4 { font-size: 18px; font-weight: 700; }
.steps p { color: #b8ab95; font-size: 17.5px; line-height: 1.5; }
html[lang="ko"] .steps p { font-size: 15.5px; line-height: 1.8; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 30px; }
  .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { border-left: 0; padding-left: 0; }
}

/* the quota, growing past the edge of the page */
.quota { margin-top: 64px; }
.quota h3 { font-size: 22px; color: var(--bone-dim); }
.quota-strip {
  list-style: none; margin: 0; padding: 4px 0 14px; display: flex; align-items: baseline; gap: 26px;
  overflow-x: auto; scrollbar-width: thin; scrollbar-color: #3a2c22 transparent;
  mask-image: linear-gradient(90deg, #000 70%, transparent);
}
.quota-strip li { flex: none; font-family: var(--f-machine); color: var(--bone-dim); line-height: 1; }
.quota-strip li small { display: block; font-size: 15px; color: var(--bone-faint); margin-bottom: 4px; }
.quota-strip li b { font-weight: normal; color: var(--tallow-hi); }
.quota-strip li.red b { color: var(--blood-hi); }

/* payout formula */
.formula {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  font-family: var(--f-machine); font-size: 24px; color: var(--bone-dim);
  padding: 22px 24px; margin-bottom: 50px;
  background: #050a07; border: 1px solid #16281d; border-radius: 4px; box-shadow: inset 0 0 40px #000;
}
.formula .f {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px 7px;
  border: 1px dashed #2f5a3e; border-radius: 4px; color: var(--phosphor); min-width: 92px;
}
.formula .f:hover, .formula .f:focus-visible { border-style: solid; border-color: var(--phosphor); }
.formula .f b { font-weight: normal; font-size: 32px; line-height: 1; color: var(--bone); }
.formula .f small { font-size: 16px; color: var(--phosphor-dim); }
.formula .op { color: var(--bone-faint); }
.formula .f.total b { color: var(--tallow-hi); }
.formula .mini { margin-right: 6px; }
@media (max-width: 600px) {
  .formula { font-size: 18px; gap: 8px; padding: 14px; }
  .formula .mini { display: none; }
  .formula .f { min-width: 0; padding: 4px 8px 5px; }
  .formula .f b { font-size: 24px; }
  .formula .f small { font-size: 14px; }
}

.pays-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 50px; }
@media (max-width: 860px) { .pays-grid { grid-template-columns: 1fr; gap: 30px; } }
.sym-list, .mod-list, .pat-list { list-style: none; margin: 0 0 30px; padding: 0; }
.sym-list li { display: flex; align-items: center; gap: 14px; padding: 6px 2px; border-bottom: 1px dashed #2c2119; }
.sym-list .e { font-size: 30px; width: 40px; text-align: center; }
.sym-list .nm { flex: 1; }
.sym-list .v { font-family: var(--f-machine); font-size: 22px; color: var(--tallow-hi); width: 70px; text-align: right; }
.sym-list .c { font-family: var(--f-machine); font-size: 18px; color: var(--bone-faint); width: 70px; text-align: right; }
.mod-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-list li { font-family: var(--f-machine); font-size: 19px; padding: 3px 10px; border: 1px solid #33261d; border-radius: 3px; background: #0d0806; }
.mod-list li span { font-size: 22px; margin-right: 6px; }
.pat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pat-list li { padding: 10px; border: 1px solid #2c2119; border-radius: 3px; background: #0d0806; }
.pat-list li:hover, .pat-list li:focus-visible { border-color: #6b5228; }
.pat-list .nm { display: block; font-size: 17px; color: var(--bone); margin-top: 6px; }
.pat-list .v { font-family: var(--f-machine); font-size: 20px; color: var(--tallow-hi); }
.mini { display: inline-grid; grid-template-columns: repeat(5, 11px); gap: 2px; vertical-align: middle; }
.mini i { width: 11px; height: 11px; background: #261c15; border-radius: 1px; }
.mini i.on { background: var(--tallow-hi); box-shadow: 0 0 4px #e8c98a88; }

/* totems on a shelf */
.filters, .periods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.filters button, .periods button {
  background: none; border: 1px solid #3a2c22; color: var(--bone-dim); border-radius: 3px; cursor: pointer;
  font-family: var(--f-machine); font-size: 19px; padding: 3px 12px;
}
.filters button[aria-pressed="true"], .periods button[aria-pressed="true"] { color: var(--tallow-hi); border-color: #6b5228; background: #2a1d10; }
.shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px;
  padding: 14px; background: linear-gradient(#2c1a10, #1a0f08); border: 1px solid #0d0603; border-radius: 4px;
  box-shadow: inset 0 -4px 0 #0007, 0 20px 40px #0008;
}
.shelf span {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 28px; border-radius: 5px;
  background: radial-gradient(circle at 50% 35%, #3a2819, #140c07); border: 2px solid #6f6352;
  transition: transform .12s, opacity .2s;
}
.shelf span:hover, .shelf span:focus-visible { transform: translateY(-3px); }
.shelf span.r2 { border-color: var(--cold); } .shelf span.r3 { border-color: var(--bruise); }
.shelf span.r4 { border-color: var(--ember); box-shadow: 0 0 12px #d47a3455; }
.shelf span.off { display: none; }
.landing .shelf-note { margin-top: 12px; color: var(--bone-faint); font-size: 16px; }

/* curse and radio: two notes pinned to the wall */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }
.note { padding: 26px 28px 28px; border: 1px solid #33261d; border-radius: 3px; background: #120d0a; }
.note.curse { border-color: #3a2350; background: linear-gradient(#170f1c, #0e0a10); }
.note .omen { font-size: 34px; letter-spacing: 4px; margin-bottom: 10px; }
.note.curse .omen { filter: drop-shadow(0 0 10px #8a63c4); }
.note.curse h3 { color: #b596e6; }
.note p { color: #bdb09a; max-width: 36em; }

/* the ledger */
.ledger { width: 100%; border-collapse: collapse; font-size: 18px; }
.ledger th { font-family: var(--f-machine); font-size: 18px; font-weight: normal; color: var(--bone-faint); text-align: left; padding: 6px 8px; border-bottom: 1px solid #4d3a28; }
.ledger td { padding: 8px; border-bottom: 1px dashed #2c2119; }
.ledger .n { text-align: right; font-family: var(--f-machine); font-size: 22px; white-space: nowrap; }
.ledger td.nm { font-size: 20px; overflow-wrap: anywhere; }
.ledger td.tt { font-size: 17px; letter-spacing: 1px; }
.ledger tr.top1 td { color: var(--tallow-hi); }
.ledger tr.me td.nm::after { content: attr(data-you); margin-left: 8px; font-family: var(--f-machine); font-size: 16px; color: var(--phosphor); }
.landing .ledger-status { margin-top: 14px; color: var(--bone-dim); }
@media (max-width: 600px) { .ledger .hide-s { display: none; } }

.final { text-align: center; padding: 130px 16px 110px; }
.final h2 { font-size: clamp(36px, 5vw, 64px); margin-bottom: 30px; }
html[lang="ko"] .final h2 { font-size: clamp(28px, 4vw, 46px); }

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid #ffffff0d; color: var(--bone-faint); font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rig, .rig .bulb, .rig .cone, .demo-sign .dead { animation: none; }
}

/* pixel-art symbols inside text (src/art.js) */
img.art { height: 1.05em; width: auto; vertical-align: -0.18em; image-rendering: pixelated; }
.sym-list .e img.art { height: 30px; vertical-align: middle; }
.note .omen img.art { height: 38px; margin-right: 2px; }
.note.curse .omen { filter: drop-shadow(0 0 10px #8a63c4); }
