/* ==========================================================================
   Diapason Games — main stylesheet
   --------------------------------------------------------------------------
   Contents:
     1. Design tokens (colors, type, spacing)
     2. Base & reset
     3. Paper texture
     4. Typography
     5. Layout containers
     6. Site header & navigation
     7. Site footer
     8. Components (ornaments, buttons, game cards, game one-pagers,
        definition list, store badges, notices)
     9. Contact form
    10. Small screens
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Palette — warm paper, soft ink, calm greens, quirky accents */
  --paper:        #f6f1e6;  /* warm cream background */
  --paper-deep:   #efe7d6;  /* slightly darker panel */
  --ink:          #3a352c;  /* soft near-black for text */
  --ink-muted:    #7a7263;  /* secondary text */
  --line:         #ddd2bc;  /* hairline borders */
  --moss:         #5c6b4e;  /* calm green — links, structure */
  --moss-deep:    #46523c;
  --persimmon:    #c4643a;  /* quirky warm accent — sparingly */
  --plum:         #7d5471;  /* quirky cool accent — hover surprises */

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Newsreader", Georgia, serif;

  /* Rhythm */
  --measure: 38rem;         /* comfortable reading width */
  --wide:    64rem;         /* wide layout width */
  --gap:     1.5rem;
}


/* --------------------------------------------------------------------------
   2. Base & reset
   -------------------------------------------------------------------------- */

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: var(--persimmon);
  color: var(--paper);
}


/* --------------------------------------------------------------------------
   3. Paper texture
   --------------------------------------------------------------------------
   A whisper of grain over the whole page, made from an inline SVG noise
   filter. Kept very low opacity so it adds depth without distraction.
   -------------------------------------------------------------------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.21 0 0 0 0 0.16 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem);  margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--moss);
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
  transition: color 120ms ease;
}

a:hover {
  color: var(--plum);
  text-decoration-color: currentColor;
}

.lede {
  font-size: 1.3rem;
  color: var(--ink-muted);
  font-style: italic;
}

.small {
  font-size: 0.9rem;
  color: var(--ink-muted);
}


/* --------------------------------------------------------------------------
   5. Layout containers
   -------------------------------------------------------------------------- */

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

/* Content sits centered on the page; game one-pagers keep their own layout */
main h1,
.lede {
  text-align: center;
}

.game-hero h1 {
  text-align: left;
}

main {
  flex: 1;
  padding: 3rem 0 4rem;
}


/* --------------------------------------------------------------------------
   6. Site header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 0;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* Little organ-pipe glyph beside the wordmark — stands in for a logo */
.site-title .pipes {
  flex: none;
  transform: translateY(2px);
  transition: transform 200ms ease;
}

.site-title:hover .pipes {
  transform: translateY(2px) rotate(-6deg);
}

/* Mirrored glyph on the right side of the wordmark — pipes descend */
.site-title .pipes-flip {
  transform: translateY(2px) scaleX(-1);
}

.site-title:hover .pipes-flip {
  transform: translateY(2px) scaleX(-1) rotate(-6deg);
}

.site-title:hover {
  color: var(--moss-deep);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--persimmon);
}

.site-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--persimmon);
}


/* --------------------------------------------------------------------------
   7. Site footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer-left {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.footer-left a {
  color: var(--ink-muted);
}

.footer-left a:hover {
  color: var(--plum);
}

.footer-icon {
  display: inline-flex;
  color: var(--ink-muted);
  transition: color 120ms ease;
}

.footer-icon:hover {
  color: var(--plum);
}


/* --------------------------------------------------------------------------
   8. Components
   -------------------------------------------------------------------------- */

/* Buttons */
.button {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--paper);
  background: var(--moss);
  border: 1px solid var(--moss-deep);
  border-radius: 2rem;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease;
}

.button:hover {
  color: var(--paper);
  background: var(--moss-deep);
  transform: translateY(-1px);
}

/* Game cards — used on Home and the Games index */
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--gap);
  padding: 0;
  margin: 2rem 0;
  list-style: none;
}

.game-card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--paper-deep);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 6px 18px rgba(58, 53, 44, 0.12);
}

.game-card a {
  display: block;
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.game-card .thumb {
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  margin-bottom: 1.1rem;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
}

/* Placeholder block shown until real images are added */
.thumb-placeholder {
  border-radius: 0.5rem;
  border: 1px dashed var(--line);
  margin-bottom: 1.1rem;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 0.95rem;
  background:
    repeating-linear-gradient(45deg,
      transparent, transparent 12px,
      rgba(92, 107, 78, 0.05) 12px, rgba(92, 107, 78, 0.05) 24px);
}

.game-card h3 {
  margin: 0 0 0.35rem;
  color: var(--persimmon);
}

.game-card p {
  margin: 0;
  color: var(--ink-muted);
}

/* Game one-pager hero */
.game-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin: 1rem 0 3rem;
}

.game-hero .hero-image,
.game-hero .thumb-placeholder {
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.game-hero .hero-image {
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  object-fit: cover;
}

/* Phone mockups: tall transparent renders (PNG/WebP with alpha) that float
   on the paper, sized by their own aspect ratio rather than cropped. */
.game-hero .hero-image.phone-mock {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 34rem;
  aspect-ratio: auto;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(58, 53, 44, 0.18));
}

/* Game showcase — one-pager built around a single large image. Meant for
   transparent renders (WebP/PNG with alpha) that float directly on the
   paper, exhibition-plate style: title above, image large, text below. */
.game-showcase {
  text-align: center;
  margin: 1rem 0 2rem;
}

.game-showcase h1 {
  margin-bottom: 2rem;
}

.showcase-image {
  width: min(100%, 58rem);
  margin: 0 auto 3rem;
  filter: drop-shadow(0 16px 24px rgba(58, 53, 44, 0.16));
}

.game-showcase .prose p {
  margin-bottom: 1.3em;
}

.showcase-cta {
  margin-top: 2.25rem;
}

.game-kicker {
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--moss);
  margin-bottom: 0.5rem;
}

/* Store badges (official Apple / Google artwork goes in these slots) */
.store-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.store-badges img {
  height: 54px;
  width: auto;
}

/* Definition list — About page. The two entries are deliberately equal in
   width and weight; that's part of the joke. */
.definitions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: 1rem 0 3rem;
}

.definitions section {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.75rem 2rem 2rem;
}

.definitions .word {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 550;
  margin: 0 0 0.25rem;
}

.definitions .pronunciation {
  color: var(--ink-muted);
  font-style: italic;
  margin: 0 0 1rem;
}

.definitions ol {
  margin: 0;
  padding-left: 1.4rem;
}

.definitions li {
  margin-bottom: 0.6rem;
}

.definitions li::marker {
  color: var(--persimmon);
  font-family: var(--font-display);
}

/* Notices — contact form feedback */
.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--moss);
  border-radius: 0.35rem;
  background: var(--paper-deep);
  padding: 0.9rem 1.2rem;
  max-width: var(--measure);
  margin: 0 auto 2rem;
}

.notice.error {
  border-left-color: var(--persimmon);
}


/* --------------------------------------------------------------------------
   9. Contact form
   -------------------------------------------------------------------------- */

.contact-form {
  max-width: var(--measure);
  margin-inline: auto;
}

.contact-form label {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 1.4rem 0 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.65rem 0.85rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
}

.contact-form textarea {
  min-height: 10rem;
  resize: vertical;
}

.contact-form button {
  margin-top: 1.75rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--paper);
  background: var(--moss);
  border: 1px solid var(--moss-deep);
  border-radius: 2rem;
  padding: 0.7rem 2rem;
  transition: background 120ms ease;
}

.contact-form button:hover {
  background: var(--moss-deep);
}

/* Honeypot field — hidden from people, visible to bots */
.hp {
  position: absolute;
  left: -9999px;
}


/* --------------------------------------------------------------------------
   10. Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 44rem) {
  .game-hero,
  .definitions {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

}
