/* AllFun Games — allfun.games
   The idea: a games cupboard. Felt and walnut from the tables we play on, ivory and brass from the
   pieces; each game sits on the shelf as its own box. One loud thing (the wide Archivo wordmark and
   headlines), everything else quiet. */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('fonts/lora-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --felt: #1c4a3b;
  --felt-deep: #0d261e;
  --felt-night: #081a14;
  --walnut: #5a3820;
  --walnut-dark: #2f1d10;
  --ivory: #f6efe0;
  --ivory-soft: #d6ddd6;
  --brass: #e2b04f;
  --brass-light: #f6dc8c;
  --red: #b8322a;
  --muted: #9fb3a8;
  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --text: 'Lora', Georgia, serif;
  --measure: 34rem;
  --radius-box: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--felt-night);
  color: var(--ivory);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brass-light); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(8, 26, 20, 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 176, 79, 0.18); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ivory); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--brass); font-weight: 500; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.top nav a { color: var(--ivory-soft); text-decoration: none; font-size: 0.98rem; }
.top nav a:hover, .top nav a[aria-current='page'] { color: var(--ivory); text-decoration: underline; text-decoration-color: var(--brass); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 48px; padding: 0 1.4rem;
  border-radius: 999px; font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 1rem; text-decoration: none;
  color: #23180a; background: linear-gradient(180deg, #f7e6b4 0%, #e6c06a 40%, #c9952f 70%, #e2b04f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 22px rgba(226, 176, 79, 0.25); }
.button:hover { filter: brightness(1.05); }
.button.quiet { color: var(--ivory); background: transparent; border: 1px solid rgba(246, 239, 224, 0.4); box-shadow: none; }
.top .button { min-height: 40px; padding: 0 1.1rem; font-size: 0.92rem; }

/* Hero: the felt of a games table, with a walnut rail along the bottom */
.hero { position: relative; overflow: hidden;
  background:
    radial-gradient(70% 90% at 78% 30%, rgba(60, 120, 92, 0.55), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-deep) 100%);
  border-bottom: 14px solid var(--walnut);
  box-shadow: inset 0 -2px 0 rgba(255, 220, 160, 0.18); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 2.5rem;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem); }
.hero h1 { margin: 0; font-family: var(--display); font-stretch: 125%; font-weight: 900; line-height: 0.98;
  font-size: clamp(2.6rem, 6.4vw, 5.1rem); letter-spacing: -0.025em; text-wrap: balance; }
.hero p { margin: 1.4rem 0 0; max-width: 30rem; font-size: 1.18rem; color: var(--ivory-soft); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.hero-art { position: relative; min-height: 440px; }
.hero-board { position: absolute; right: -6%; top: 6%; width: 108%; border-radius: 14px; transform: rotate(-5deg);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(246, 223, 164, 0.25); }
.phone { position: absolute; left: 4%; bottom: -2%; width: 39%; aspect-ratio: 390 / 844; padding: 2.4%; border-radius: 34px;
  background: #0b0f0d; transform: rotate(4deg); box-shadow: 0 36px 70px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(246, 223, 164, 0.35); }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; }

/* Sections */
section.block { padding-block: clamp(3.5rem, 8vw, 6rem); }
h2 { margin: 0 0 1rem; font-family: var(--display); font-stretch: 118%; font-weight: 800; line-height: 1.05;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -0.015em; text-wrap: balance; }
h3 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 750; font-size: 1.3rem; line-height: 1.15; }
.lead { max-width: var(--measure); color: var(--ivory-soft); margin: 0; }

/* The shelf: each game is a box, standing on a walnut shelf */
.shelf { position: relative; margin-top: 2.5rem; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 1.6rem; align-items: end;
  padding-bottom: 22px; }
.shelf::after { content: ''; position: absolute; left: -1rem; right: -1rem; bottom: 0; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, #7a5131 0%, var(--walnut) 45%, var(--walnut-dark) 100%);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 170, 0.35); }
.box { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-box); overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 22px 36px rgba(0, 0, 0, 0.4); }
.box-lid { position: relative; padding: 1.4rem 1.4rem 1.2rem; min-height: 100%; }
.box-lid::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(246, 223, 164, 0.45); border-radius: 3px; pointer-events: none; }
.box-live { background: linear-gradient(160deg, #24604b 0%, var(--felt) 45%, #133a2d 100%); min-height: 430px; }
.box-live .box-lid { display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; }
.box-live img { width: 100%; border-radius: 8px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); align-self: center; }
.box-live h3 { font-size: 1.7rem; }
.box-live .box-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.box-live p { margin: 0.2rem 0 0; color: var(--ivory-soft); font-size: 0.98rem; }
.box-next { min-height: 300px; background: linear-gradient(160deg, #23324f 0%, #18233a 60%, #121a2c 100%); }
.box-idea { min-height: 250px; background: transparent; box-shadow: none; border: 2px dashed rgba(246, 223, 164, 0.4); }
.box-idea .box-lid::before { display: none; }
.box-next .box-lid, .box-idea .box-lid { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.5rem; }
.box-next p, .box-idea p { margin: 0; color: var(--ivory-soft); font-size: 0.95rem; }
.suits { display: flex; gap: 0.6rem; opacity: 0.55; margin-bottom: auto; padding-bottom: 1.5rem; }
.suits svg { width: 30px; height: 30px; }
.tag { align-self: flex-start; justify-self: start; font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 0.8rem;
  padding: 0.2rem 0.65rem; border-radius: 999px; background: rgba(246, 239, 224, 0.12); color: var(--ivory); }
.tag-live { background: var(--red); color: #fff; }

/* The game, up close */
.feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.feature { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.feature-phone { justify-self: center; width: min(330px, 78%); aspect-ratio: 390 / 844; padding: 10px; border-radius: 40px; background: #0b0f0d;
  box-shadow: 0 36px 70px rgba(0, 0, 0, 0.55), 0 0 0 1.5px rgba(246, 223, 164, 0.35); }
.feature-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 31px; }
.facts { list-style: none; margin: 1.6rem 0 2rem; padding: 0; display: grid; gap: 1.1rem; }
.facts li { display: grid; grid-template-columns: 34px 1fr; gap: 0.9rem; align-items: start; }
.facts strong { display: block; font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: 1.05rem; }
.facts span { color: var(--ivory-soft); font-size: 0.98rem; }
.pip { width: 34px; height: 34px; border-radius: 8px; background: var(--ivory); position: relative; box-shadow: inset 0 -2px 0 #cdbf9f; }
.pip::after { content: ''; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%; background: #1f1a17;
  box-shadow: var(--pips, none); }
.pip-2::after { box-shadow: -8px -8px 0 #1f1a17, 8px 8px 0 #1f1a17; background: transparent; }
.pip-3::after { box-shadow: -9px -9px 0 #1f1a17, 9px 9px 0 #1f1a17; }
.pip-4::after { box-shadow: -8px -8px 0 #1f1a17, 8px -8px 0 #1f1a17, -8px 8px 0 #1f1a17, 8px 8px 0 #1f1a17; background: transparent; }

/* House rules: four promises, set like a rule sheet in a game box */
.rules { background: var(--felt-deep); border-top: 1px solid rgba(226, 176, 79, 0.18); }
.rule-sheet { margin-top: 2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid rgba(226, 176, 79, 0.3); }
.rule-sheet div { padding: 1.4rem 1.6rem 1.4rem 0; border-bottom: 1px solid rgba(226, 176, 79, 0.3); }
.rule-sheet div:nth-child(odd) { padding-right: 2rem; border-right: 1px solid rgba(226, 176, 79, 0.3); }
.rule-sheet div:nth-child(even) { padding-left: 2rem; }
.rule-sheet p { margin: 0.4rem 0 0; color: var(--ivory-soft); max-width: 28rem; }

/* Closing call */
.closing { text-align: center; }
.closing .lead { margin: 0 auto 2rem; }

/* Footer */
footer { background: #06140f; border-top: 6px solid var(--walnut); padding-block: 2.5rem; color: var(--muted); font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-left: auto; }
footer a { color: var(--ivory-soft); }

/* Legal and contact pages */
.page-head { background: linear-gradient(180deg, var(--felt) 0%, var(--felt-deep) 100%); border-bottom: 10px solid var(--walnut); }
.page-head .wrap { padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-head h1 { margin: 0; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; }
.page-head p { margin: 0.8rem 0 0; color: var(--ivory-soft); }
.doc { max-width: 44rem; padding-block: clamp(2.5rem, 6vw, 4rem); }
.doc h2 { font-size: 1.45rem; margin: 2.2rem 0 0.6rem; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--ivory-soft); }
.doc ul { padding-left: 1.2rem; }
.doc li::marker { color: var(--brass); }
.topics { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.8rem; }
.topics a { display: block; padding: 1rem 1.2rem; border-radius: 10px; text-decoration: none; color: var(--ivory);
  background: rgba(28, 74, 59, 0.45); border: 1px solid rgba(226, 176, 79, 0.3); }
.topics a:hover { border-color: var(--brass); }
.topics strong { display: block; font-family: var(--display); font-stretch: 110%; font-size: 1.08rem; }
.topics span { color: var(--ivory-soft); font-size: 0.95rem; }

.brand-name, .button { white-space: nowrap; }
.top .short { display: none; }
@media (max-width: 520px) { .top .long { display: none; } .top .short { display: inline; } }

/* Phones */
@media (max-width: 860px) {
  .top nav a:not(.button) { display: none; }
  .hero .wrap { grid-template-columns: 1fr; gap: 1rem; }
  .hero-art { min-height: 0; aspect-ratio: 1 / 0.82; margin-top: 1rem; }
  .shelf { grid-template-columns: 1fr; align-items: stretch; }
  .box-live, .box-next, .box-idea { min-height: 0; }
  .box-next .box-lid { min-height: 220px; }
  .box-idea .box-lid { min-height: 160px; }
  .feature { grid-template-columns: 1fr; }
  .rule-sheet { grid-template-columns: 1fr; }
  .rule-sheet div, .rule-sheet div:nth-child(odd), .rule-sheet div:nth-child(even) { padding: 1.2rem 0; border-right: none; }
  footer nav { margin-left: 0; }
}

/* Specificity fixes: the header button keeps its own colours; the contact topics are not a bulleted list. */
.top nav a.button, .top nav a.button:hover { color: #23180a; text-decoration: none; }
.doc ul.topics { padding-left: 0; }
