/* ==========================================================
   Carter's site styles
   Change a color here and it changes everywhere on the site.
   ========================================================== */
:root {
  --ink: #1d2433;        /* text, outlines and shadows */
  --paper: #fbf6ec;      /* page background */
  --card: #ffffff;       /* boxes and cards */
  --green: #55673a;      /* main color (from my green shirt) */
  --gold: #f4b93a;       /* highlight color (from my hair) */
  --red: #d4402f;        /* pop color (from the flowers) */
  --muted: #5a606c;      /* quieter text */
  --line: 3px;           /* how thick the outlines are */
  --corner: 18px;        /* how round the corners are */
  --shadow: 6px 6px 0 var(--ink);

  --font-fun: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* graph-paper dots */
  background-image: radial-gradient(rgba(29, 36, 51, 0.13) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
}

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

a { color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

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

h1, h2, h3 { font-family: var(--font-fun); font-weight: 800; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* ---------- Header ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
         font-family: var(--font-fun); font-weight: 800; font-size: 1.35rem; }
.brand img { width: 44px; height: 44px; }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; gap: 6px; }
.site-nav a { font-family: var(--font-fun); font-weight: 700; text-decoration: none; color: var(--ink);
              padding: 6px 12px; border-radius: 999px; border: var(--line) solid transparent; }
.site-nav a:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-fun); font-weight: 800; font-size: 1.1rem; text-decoration: none;
  color: var(--ink); background: var(--gold);
  padding: 12px 22px; min-height: 48px;
  border: var(--line) solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.button:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.button--plain { background: var(--card); }
.button--big { font-size: 1.3rem; padding: 14px 28px; min-height: 56px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Little labels ---------- */
.tag {
  display: inline-block; font-family: var(--font-fun); font-weight: 800; font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; margin: 0 0 12px;
}
.tag--gold { background: var(--gold); }
.tag--red { background: var(--red); color: #fff; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; }
.chips li { font-size: 0.9rem; font-weight: 600; background: var(--paper); border: 2px solid var(--ink);
            border-radius: 999px; padding: 2px 10px; }

/* ---------- Home: hello section ---------- */
.hero { padding: 24px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 .wave { display: inline-block; }
.hero .lead { font-size: 1.3rem; max-width: 32ch; }
.hero .lead strong { background: linear-gradient(transparent 60%, var(--gold) 60%); }

.portrait { position: relative; max-width: 380px; margin: 0 auto; transform: rotate(2.5deg); }
.portrait img { border: var(--line) solid var(--ink); border-radius: 24px; box-shadow: 10px 10px 0 var(--ink);
                aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.portrait .player-tag { position: absolute; top: -14px; left: -14px; transform: rotate(-7deg);
                        font-size: 1rem; box-shadow: 3px 3px 0 var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 32px; }
.game-card {
  position: relative; display: flex; flex-direction: column; background: var(--card);
  border: var(--line) solid var(--ink); border-radius: var(--corner); box-shadow: var(--shadow); overflow: hidden;
}
.game-card__image { display: block; border-bottom: var(--line) solid var(--ink); aspect-ratio: 3 / 2; overflow: hidden; }
.game-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.game-card:hover .game-card__image img { transform: scale(1.04); }
.game-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.game-card__body h3 { margin-bottom: 6px; }
.game-card .tag--new { position: absolute; top: 14px; left: 14px; margin: 0; transform: rotate(-4deg);
                        box-shadow: 3px 3px 0 var(--ink); }
.game-card__body h3 a { color: var(--ink); text-decoration: none; }
.game-card__body h3 a:hover { color: var(--red); }
.game-card__body .actions { margin-top: auto; }

.game-card--next {
  background: transparent; border-style: dashed; box-shadow: none; justify-content: center; align-items: center;
  text-align: center; padding: 32px 24px; min-height: 280px;
}
.game-card--next .big-icon { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.game-card--next p { color: var(--muted); max-width: 26ch; }

/* ---------- About me ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.panel { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--corner);
         box-shadow: var(--shadow); padding: 26px 28px; }
.panel h2 { font-size: 1.7rem; }
.panel h3 { font-size: 1.25rem; }
.panel .chips { margin: 0; }

/* ---------- Game pages ---------- */
.back-link { display: inline-block; font-family: var(--font-fun); font-weight: 700; margin: 8px 0 20px; }
.game-hero { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; padding-bottom: 48px; }
.game-hero .lead { font-size: 1.25rem; }
.shot { margin: 0; }
.shot img { border: var(--line) solid var(--ink); border-radius: var(--corner); box-shadow: var(--shadow); width: 100%; }
.shot figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 12px; }
.game-hero .shot { transform: rotate(-1.2deg); }

.how-to { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.how-to ol, .how-to ul { padding-left: 1.3em; margin: 0; }
.how-to li { margin-bottom: 8px; }
.how-to li:last-child { margin-bottom: 0; }

.keys { width: 100%; border-collapse: collapse; }
.keys th, .keys td { text-align: left; padding: 8px 6px; border-bottom: 2px dashed rgba(29, 36, 51, 0.2); vertical-align: top; }
.keys tr:last-child th, .keys tr:last-child td { border-bottom: 0; }
.keys th { font-family: var(--font-fun); width: 34%; }
.keys td { line-height: 2; }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; font-weight: 700;
  background: var(--paper); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 7px;
  padding: 0 6px; white-space: nowrap;
}

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 28px 0 0; list-style: none; }
.facts li strong { font-family: var(--font-fun); }

.play-again { text-align: center; padding: 64px 0 24px; }
.play-again h2 { margin-bottom: 18px; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 48px; color: var(--muted); font-size: 0.95rem; }
/* the line above the footer, drawn inside the page margins */
.site-footer .wrap { background: linear-gradient(var(--ink), var(--ink)) center top / calc(100% - 32px) var(--line) no-repeat;
                     padding-top: 22px;
                     display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer p { margin: 0; }

/* ---------- Page not found ---------- */
.not-found { text-align: center; padding: 48px 0 24px; }
.not-found .big-icon { font-size: 4rem; line-height: 1; margin-bottom: 12px; }
.not-found .actions { justify-content: center; }

/* ---------- Phones and small screens ---------- */
@media (max-width: 800px) {
  .hero .wrap, .game-hero, .about { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding-top: 8px; }
  .portrait { max-width: 300px; }
  .game-hero .shot { transform: none; }
  .section { padding: 40px 0; }
}

@media (max-width: 420px) {
  .site-nav { gap: 2px; }
  .site-nav a { padding: 6px 7px; font-size: 0.95rem; }
  .brand { font-size: 1.2rem; }
  .brand img { width: 38px; height: 38px; }
  .game-card { box-shadow: 4px 4px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .game-card__image img { transition: none; }
  .game-card:hover .game-card__image img { transform: none; }
}
