/*
 * styles.css - site-wide styles for all of ambivalent.systems.
 *
 * Every page links this first. A section with an identity of its own (a game) links its own
 * stylesheet after this one and overrides the tokens below rather than restating rules, e.g.
 * /duello/duello.css. Keep this file free of anything game-specific.
 */

:root {
  /* Studio palette, taken from the kite avatar */
  --red: #d92933;
  --navy: #1b1f3c;

  --ground: #f5f5f7;
  --panel: #ffffff;
  --ink: #2b2d38;
  --dim: #6b6f7d;
  --rule: #dcdde3;
  --accent: var(--red);
  --heading: var(--navy);
  --link: var(--navy);

  --font-body: "Segoe UI", -apple-system, system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-body);

  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --measure: 960px;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.6 var(--font-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; margin-top: 2.5rem; }
h3 { font-size: 1.15rem; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.muted {
  color: var(--dim);
}

/* ---- Header and footer, shared by every page ---- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
}

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

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  color: var(--dim);
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Building blocks ---- */

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  color: #fff;
  filter: brightness(1.1);
}

.button.secondary {
  background: transparent;
  color: var(--heading);
  box-shadow: inset 0 0 0 2px var(--rule);
}

/* 16:9 box for embedded video; the iframe or placeholder fills it */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video iframe,
.video .placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video .placeholder {
  display: grid;
  place-items: center;
  color: #ccc;
  font-size: 0.95rem;
}

/* ---- Studio home: the two dictionary entries ---- */

.definitions {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 3rem 0 1.5rem;
}

.entry {
  transition: transform 0.2s;
}

.entry:hover {
  transform: translateY(-3px);
}

.entry .word {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.entry .pronunciation {
  font-style: italic;
  color: var(--dim);
}

.entry .part-of-speech {
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}

.entry .dictionary {
  color: var(--red);
  font-weight: 700;
}

.tagline {
  text-align: center;
  font-size: 1.2rem;
  color: var(--dim);
  margin: 0 0 1rem;
}

/* A game on the studio home page */
.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.5rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  padding: 0;
}

.game-card .art {
  background: var(--navy) center / cover no-repeat;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  min-height: 180px;
  height: 100%;
}

.game-card .body {
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.game-card:hover h3 {
  color: var(--accent);
}

@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card .body {
    padding: 0 1.25rem 1.25rem;
  }
}
