/*
  LowRoll Games shared site styles
  Load order on every page: tokens.css, site.css, then any page-specific CSS.
*/

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd {
  margin: 0;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Base ---------- */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  /* A soft lantern glow from the top keeps the navy from feeling flat */
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgb(247 163 43 / 0.08), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 120%, rgb(0 0 0 / 0.45), transparent 60%);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: 0.02em;
  text-wrap: balance;
  color: var(--parchment);
}

h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p,
li {
  max-width: var(--measure);
  text-wrap: pretty;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms ease;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--gold);
  color: var(--leather-deep);
}

strong { font-weight: 700; }

/* Lists: bullets are die pips */
.prose ul {
  list-style: none;
  padding: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 1.5em;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.62em;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--pip);
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.35), 0 0 0 2px rgb(252 228 182 / 0.12);
}

.prose > * + * { margin-top: var(--space-s); }
.prose > * + h2 { margin-top: var(--space-l); }
.prose > * + h3 { margin-top: var(--space-m); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100px;
  z-index: 100;
  padding: var(--space-xs) var(--space-s);
  background: var(--parchment);
  color: var(--leather-deep);
  font-weight: 700;
  border-radius: var(--radius-ribbon);
}

.skip-link:focus { top: var(--space-s); }

.wrap {
  width: min(100% - 2 * var(--space-m), var(--content-width));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--night-line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-l);
  padding-block: var(--space-s);
}

.site-header__logo {
  display: block;
  width: 136px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  list-style: none;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding-block: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  color: var(--parchment);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--bronze);
}

.site-nav a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

@media (max-width: 30rem) {
  .site-nav ul { gap: 0 var(--space-s); }
  .site-nav a { font-size: 1rem; letter-spacing: 0.02em; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-l);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  border-top: 1px solid var(--night-line);
  padding-top: var(--space-m);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-m);
  list-style: none;
  padding: 0;
}

/* Single-line centered footer for standalone pages (coming soon, 404) */
.site-footer--centered .site-footer__inner {
  justify-content: center;
  border-top: 0;
}

.site-footer a { color: var(--parchment-dim); }
.site-footer a:hover { color: var(--gold-light); }

/* ---------- Buttons ---------- */
/* Primary: gold ribbon. Secondary: outlined ribbon. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 48px;
  padding: 0.55em 1.4em;
  border: 2px solid var(--leather-deep);
  border-radius: var(--radius-ribbon);
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 55%, #e08d1c 100%);
  box-shadow: 0 3px 0 var(--bronze), 0 3px 0 2px var(--leather-deep);
  color: var(--leather-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms ease;
}

.button:hover {
  color: var(--leather-deep);
  filter: brightness(1.06);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--bronze), 0 1px 0 2px var(--leather-deep);
}

.button--secondary {
  background: transparent;
  border-color: var(--bronze);
  box-shadow: none;
  color: var(--parchment);
}

.button--secondary:hover {
  color: var(--gold-light);
  border-color: var(--gold);
}

.button--secondary:active { box-shadow: none; }

.button:disabled,
fieldset:disabled .button {
  cursor: not-allowed;
  filter: grayscale(0.55) brightness(0.8);
  transform: none;
}

/* ---------- Plaque (panel echoing the "GAMES" ribbon) ---------- */
.plaque {
  padding: var(--space-l);
  border: var(--border-gold);
  border-radius: var(--radius-plaque);
  background:
    linear-gradient(180deg, rgb(252 228 182 / 0.05), transparent 40%),
    var(--leather);
  box-shadow:
    inset 0 0 0 4px var(--leather),
    inset 0 0 0 5px rgb(247 163 43 / 0.35),
    0 10px 30px rgb(0 0 0 / 0.35);
}

/* ---------- Form fields ---------- */
.field {
  display: grid;
  gap: var(--space-xs);
}

.field__label {
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0.5em 1em;
  border: 2px solid var(--bronze);
  border-radius: var(--radius-ribbon);
  background: var(--leather-deep);
  color: var(--parchment);
}

.input::placeholder {
  color: rgb(252 228 182 / 0.5);
}

.input:focus-visible {
  outline-offset: 2px;
  border-color: var(--gold);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ---------- Ribbon form: email input and button joined in one pill ---------- */
.ribbon-form {
  display: flex;
  align-items: stretch;
  gap: var(--space-2xs);
  padding: 5px;
  border: 2px solid var(--bronze);
  border-radius: var(--radius-ribbon);
  background: var(--leather);
  box-shadow:
    inset 0 0 0 2px var(--leather-deep),
    0 0 0 2px var(--leather-deep),
    0 10px 28px rgb(0 0 0 / 0.4);
}

.ribbon-form .input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
}

.ribbon-form .button {
  flex: 0 0 auto;
  box-shadow: none;
  border-width: 0;
}

.ribbon-form:focus-within {
  border-color: var(--gold);
}

fieldset:disabled .ribbon-form {
  opacity: 0.75;
}

@media (max-width: 30rem) {
  .ribbon-form {
    flex-direction: column;
    border-radius: 24px;
  }

  .ribbon-form .input {
    text-align: center;
  }
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-m);
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--border-gold);
  border-radius: var(--radius-plaque);
  background: var(--color-surface);
}

.card__art {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border-bottom: var(--border-gold);
  background: var(--night);
}

.card__body {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-m);
}

.card__status {
  color: var(--ember);
  font-style: italic;
}

.card__art--placeholder {
  display: grid;
  place-items: center;
  border-bottom: 2px dashed var(--bronze);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(171 90 24 / 0.08) 14px 28px),
    var(--night);
  color: var(--parchment-dim);
  font-style: italic;
}

/* ---------- Page sections ---------- */
.page-intro {
  padding-block: var(--space-xl) var(--space-l);
}

.lede {
  margin-top: var(--space-s);
  max-width: 48ch;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--parchment-dim);
}

.section {
  padding-block: var(--space-l);
}

.section > h2 {
  margin-bottom: var(--space-m);
}

.cta {
  display: grid;
  justify-items: start;
  gap: var(--space-s);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  margin-top: var(--space-xs);
}

/* ---------- Utility pages (404) ---------- */
.lost {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-s);
  padding: var(--space-xl) var(--space-m);
  text-align: center;
}

.lost__logo {
  width: 200px;
  margin-bottom: var(--space-l);
}

.lost__die {
  width: 96px;
  transform: rotate(-14deg);
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.45));
}

.lost p {
  max-width: 40ch;
  color: var(--parchment-dim);
}

.lost .button {
  margin-top: var(--space-s);
}

/* ---------- Motion and accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .button,
  .ribbon-form,
  .plaque,
  .card {
    border: 2px solid CanvasText;
  }
}
