/* simoncastelain.com: the start page (index.html) and the site-wide 404 (404.html).
   Fonts come from the versions' own folders, so a visitor downloads each file once. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/ski/fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/ski/fonts/pixelify-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("/case/fonts/oswald-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --dot: #ebe6db;
  --ink: #1e2233;
  --text: #16181f;
  --muted: #5a6072;
  --link: #1f4fbf;
  --line: #ddd7ca;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --pix: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --head: "Oswald", "Arial Narrow", sans-serif;
  --body: Arial, Helvetica, sans-serif;
  /* Each version's colours */
  --ski-sky: #dceefb;
  --ski-red: #e23b2e;
  --ski-yellow: #ffc93c;
  --q-cream: #fbeedb;
  --q-shell: #ee6a4b;
  --q-ink: #2a2136;
  --q-yellow: #ffc93f;
  --c-cork: #a87a4f;
  --c-desk: #1b130d;
  --c-paper: #f6efdf;
  --c-red: #b4232b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.6px);
  background-size: 24px 24px;
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px 0;
  font: 700 12px/1.5 var(--body);
  text-align: center;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--ink);
}

/* ---------- Who ---------- */

.intro {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 8px;
}

.name {
  margin: 0;
  font: 400 30px/1.25 var(--pixel);
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--ski-sky);
}

.role { margin: 12px 0 0; font-size: 19px; color: var(--ink); }

.lede {
  max-width: 40em;
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--text);
}

.links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; font-size: 17px; }

/* ---------- Choice ---------- */

.choose {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 24px;
}

.welcome {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 22px;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
}
.welcome-hi { font-weight: 700; }
.welcome-go {
  display: inline-block;
  padding: 7px 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--ski-yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  text-decoration: none;
}
.welcome-go::after { content: " \2192"; }
.welcome-go:hover { background: #ffd666; }

.choose-head h2 {
  margin: 0;
  font: 700 26px/1.2 var(--pix);
  color: var(--ink);
}
.choose-head p { max-width: 44em; margin: 8px 0 0; color: var(--muted); }
.choose-head .hurry { margin-top: 10px; font-weight: 700; }
.hurry a::after { content: " \2192"; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.slot { position: relative; display: flex; }

.card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
.card-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 20px 20px;
}

.card-name { margin: 0; color: var(--ink); }
.card-line { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--text); }

.card-how {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
}
.card-how li {
  padding: 2px 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(30, 34, 51, 0.06);
  border-radius: 999px;
}

.card-go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
/* The whole card is the link. */
.card-go::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.card-go:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.card-go kbd { display: none; }

.keys-hint { display: none; margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* Keys 1, 2 and 3 need JavaScript (home.js adds .js) and a keyboard. */
@media (hover: hover) and (pointer: fine) {
  .js .card-go kbd { display: inline-block; }
  .js .keys-hint { display: block; }
}

/* Simon Ski: a pixel window on a snowy slope. */
.card-ski {
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.card-ski .card-art { background: var(--ski-sky); border-bottom: 3px solid var(--ink); }
.card-ski .card-name { font: 400 17px/1.4 var(--pixel); }
.card-ski .card-name::first-letter { color: var(--ski-red); }
.card-ski .card-go {
  font: 400 12px/1.4 var(--pixel);
  background: var(--ski-yellow);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.card-ski .card-go kbd { font-family: var(--body); }
.card-ski .card-body {
  background-color: #ffffff;
  background-image: radial-gradient(var(--ski-sky) 1.2px, transparent 1.6px);
  background-size: 20px 20px;
}

/* Simon Quest: an orange handheld. */
.card-quest {
  background: var(--q-shell);
  border: 3px solid var(--q-ink);
  border-radius: 18px;
  box-shadow: 0 7px 0 var(--q-ink);
}
.card-quest .card-art {
  margin: 12px 12px 0;
  border: 3px solid var(--q-ink);
  border-radius: 10px 10px 26px 10px;
}
.card-quest .card-body {
  margin: 12px;
  background: #fffaf1;
  border: 3px solid var(--q-ink);
  border-radius: 10px;
}
.card-quest .card-name { font: 700 24px/1.2 var(--pix); color: var(--q-ink); }
.card-quest .card-go {
  font: 700 17px/1.2 var(--pix);
  color: var(--q-ink);
  background: var(--q-yellow);
  border: 3px solid var(--q-ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--q-ink);
}

/* The Castelain File: a sheet pinned on cork. */
.slot-case {
  padding: 10px;
  background-color: var(--c-cork);
  background-image:
    radial-gradient(rgba(60, 35, 12, 0.35) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 230, 190, 0.25) 1px, transparent 1.5px);
  background-size: 9px 9px, 13px 13px;
  background-position: 0 0, 4px 6px;
  border: 3px solid #4a3220;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.12), 0 6px 0 #4a3220;
}
.card-case {
  background: var(--c-paper);
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(27, 19, 13, 0.45);
  transform: rotate(-0.8deg);
}
.card-case .card-art { border-bottom: 1px solid #c9b896; }
.card-case .card-name { font: 700 22px/1.15 var(--head); letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-desk); }
.card-case .card-go {
  font: 700 15px/1.2 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff4e6;
  background: var(--c-red);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.card-case .card-go kbd { letter-spacing: 0; }
.card-case .card-how li { background: rgba(27, 19, 13, 0.08); }
.slot-case .pin {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 3;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: radial-gradient(circle at 35% 30%, #ff8a80 0 2px, #d32f2f 3px, #8e1118 8px);
  border-radius: 50%;
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.slot-case .string {
  position: absolute;
  top: 6px;
  left: 0;
  z-index: 3;
  width: 50%;
  height: 40px;
  overflow: visible;
  pointer-events: none;
}
.string path { fill: none; stroke: var(--c-red); stroke-width: 2.5; vector-effect: non-scaling-stroke; }

/* Hover: the card lifts a little. */
@media (hover: hover) {
  .card-ski:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
  .card-quest:hover { transform: translateY(-3px); box-shadow: 0 10px 0 var(--q-ink); }
  .card-case:hover { transform: rotate(0deg) translateY(-2px); }
  .card-ski:hover .card-go { background: #ffd666; }
  .card-quest:hover .card-go { background: #ffd666; }
  .card-case:hover .card-go { background: #cf2d35; }
}
.card-go:active { transform: translateY(2px); }

/* The yeti behind the Simon Ski card. Sprite from /ski/site.js (yetiA, yetiUp). */
.yeti {
  position: absolute;
  top: 0;
  right: 26px;
  z-index: 0;
  width: 60px;
  height: 72px;
  cursor: pointer;
  transform: translateY(8px);
  transition: transform 0.35s ease;
}
.yeti .yeti-up { display: none; }
.yeti.wave .yeti-a { display: none; }
.yeti.wave .yeti-up { display: inline; }
.slot-ski:hover .yeti,
.slot-ski:focus-within .yeti,
.yeti.peek,
.yeti.wave { transform: translateY(-38px); }
.yeti-says {
  position: absolute;
  top: -38px;
  right: 92px;
  z-index: 3;
  margin: 0;
  padding: 6px 10px;
  font: 400 10px/1.5 var(--pixel);
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}

/* ---------- Contact ---------- */

.contact {
  max-width: 1120px;
  margin: 24px auto 0;
  padding: 26px 20px 48px;
  border-top: 1px solid var(--line);
}
.contact h2 { margin: 0 0 6px; font: 700 20px/1.3 var(--pix); color: var(--ink); }
.contact p { margin: 6px 0 0; }
.meta { color: var(--muted); font-size: 15px; }

/* ---------- Not found (404.html) ---------- */

.lost-head { max-width: 1120px; margin: 0 auto; padding: 22px 20px 0; }
.lost-head a { font: 400 13px/1.4 var(--pixel); color: var(--ink); text-decoration: none; }
.lost-head a:hover { color: var(--link); }
.lost-main { max-width: 1120px; margin: 0 auto; padding: 40px 20px 56px; }
.lost-main h1 { margin: 0; font: 400 24px/1.35 var(--pixel); color: var(--ink); text-shadow: 3px 3px 0 var(--ski-sky); }
.lost-main > p { max-width: 40em; margin: 14px 0 0; color: var(--muted); }
.mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.mini a {
  display: block;
  height: 100%;
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
}
.mini b { display: block; margin-bottom: 4px; }
.mini span { display: block; font-size: 15px; line-height: 1.45; color: var(--muted); }
.mini-ski a { background: #ffffff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.mini-ski b { font: 400 13px/1.5 var(--pixel); }
.mini-quest a { background: #fffaf1; border: 3px solid var(--q-ink); border-radius: 12px; box-shadow: 0 5px 0 var(--q-ink); }
.mini-quest b { font: 700 20px/1.2 var(--pix); }
.mini-case a { background: var(--c-paper); border: 1px solid #4a3220; border-radius: 3px; box-shadow: 0 6px 14px rgba(27, 19, 13, 0.3); }
.mini-case b { font: 700 18px/1.2 var(--head); letter-spacing: 0.04em; text-transform: uppercase; }
.mini a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.lost-main .back { margin-top: 26px; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .slot { animation: rise 0.45s ease-out both; }
  .slot-quest { animation-delay: 0.07s; }
  .slot-case { animation-delay: 0.14s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) {
  .card, .yeti { transition: none; }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 959px) {
  .cards { grid-template-columns: minmax(0, 1fr); gap: 34px; max-width: 560px; }
  .mini { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .intro { padding: 28px 16px 4px; }
  .name { font-size: 20px; text-shadow: 2px 2px 0 var(--ski-sky); }
  .role { font-size: 17px; }
  .lede { font-size: 16.5px; }
  .links { gap: 4px 16px; font-size: 16px; }
  .choose { padding: 22px 16px 20px; }
  .choose-head h2 { font-size: 22px; }
  .cards { gap: 40px; margin-top: 42px; }
  .card-body { padding: 16px 16px 18px; }
  .card-quest .card-art { margin: 10px 10px 0; }
  .card-quest .card-body { margin: 10px; }
  .slot-case { padding: 8px; }
  .yeti-says { top: -36px; right: 88px; font-size: 9px; }
  .contact { padding: 22px 16px 40px; }
  .lost-head { padding: 18px 16px 0; }
  .lost-main { padding: 30px 16px 44px; }
  .lost-main h1 { font-size: 18px; }
}

@media print {
  body { background: #ffffff; }
  .choose, .yeti, .yeti-says { display: none; }
}
