/*
 * ectep.com — site stylesheet
 *
 * Look taken from the studio's game, Block Grid: a white board, light grey
 * empty cells, soft pastel blocks and light-weight type (the game's menu sets
 * "Block Grid" in a thin sans). System fonts only: the site loads nothing
 * from other servers, which is also what the privacy policy promises.
 *
 * Font sizes never go below 15px (house rule for web projects).
 */

/* ---------------------------------------------------------------------- */
/* Tokens                                                                 */
/* ---------------------------------------------------------------------- */
:root {
  /* Surfaces and text */
  --paper: #ffffff;          /* the game's white background */
  --cell: #e4e6eb;           /* empty cell grey, from the game board */
  --ink: #262a33;            /* body text */
  --muted: #5f6672;          /* secondary text, the slate block of the icon */
  --link: #2a66b8;           /* deep version of the game's blue (AA on white) */

  /* Block colours, sampled from the game's screenshots */
  --y: #fdd878;  /* yellow */
  --b: #7aacf0;  /* blue   */
  --c: #72cdea;  /* cyan   */
  --g: #b5dd8a;  /* green  */
  --p: #a994e4;  /* purple */
  --r: #f17c86;  /* red    */
  --t: #6fd8c0;  /* teal   */
  --o: #fc8c78;  /* coral  */

  /* Type: Apple's rounded system face where available, else the system UI */
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;            /* page width for header, hero and lists */
  --measure: 40rem;          /* reading width for text (~70 characters) */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  /* Footer stays at the bottom on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* Visible keyboard focus everywhere, in the game's blue */
:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; border-radius: 3px; }

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

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* "Skip to content" link: hidden until it receives keyboard focus */
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--paper); padding: 8px 12px; }

/* ---------------------------------------------------------------------- */
/* Header and footer                                                      */
/* ---------------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--cell); }

.site-header__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mark { width: 34px; height: 34px; flex: none; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.menu a { color: var(--ink); text-decoration: none; font-size: 17px; padding-block: 4px; }
.menu a:hover { color: var(--link); }
/* Current page: a block-coloured underline, like a placed piece */
.menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--b); }

.site-footer { border-top: 1px solid var(--cell); margin-top: 72px; color: var(--muted); font-size: 16px; }
.site-footer__in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 28px;
}
.site-footer p { margin: 0; }
.menu--footer a { font-size: 16px; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* Home hero: tagline beside a Block Grid board                           */
/* ---------------------------------------------------------------------- */
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding-block: 72px 64px;
}

.hero__title {
  margin: 0 0 24px;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;            /* light, like the game's title */
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero__lead { margin: 0 0 32px; font-size: 20px; max-width: 30em; color: var(--ink); }

.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 0; }

.button {
  display: inline-block;
  background: var(--link);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  padding: 14px 22px;
  border-radius: 4px;          /* same small rounding as the game's cells */
}
.button:hover { background: #1f5299; }

/* The board: 10 x 10 square cells with thin white gaps, as in the game */
.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 460px;
  justify-self: end;
  aspect-ratio: 1;
}

.cell { background: var(--cell); border-radius: 3px; aspect-ratio: 1; }
.cell--y { background: var(--y); }
.cell--b { background: var(--b); }
.cell--c { background: var(--c); }
.cell--g { background: var(--g); }
.cell--p { background: var(--p); }
.cell--r { background: var(--r); }
.cell--t { background: var(--t); }
.cell--o { background: var(--o); }

/*
 * The one moment of motion on the site: the full bottom line "breaks" once
 * after the page loads, cell by cell from left to right, and is left empty,
 * which is how points are made in Block Grid. Each cell's --i (its column)
 * staggers the start. Skipped entirely for people who prefer reduced motion.
 */
@media (prefers-reduced-motion: no-preference) {
  .clear {
    animation: clear-line 700ms ease-in calc(900ms + var(--i) * 55ms) both;
  }
}

@keyframes clear-line {
  0%   { transform: scale(1); filter: none; }
  30%  { transform: scale(1.12); filter: brightness(1.12); }
  65%  { transform: scale(0); }
  66%  { transform: scale(0); background: var(--cell); }
  100% { transform: scale(1); background: var(--cell); }
}

/* ---------------------------------------------------------------------- */
/* Sections, post lists                                                   */
/* ---------------------------------------------------------------------- */
.section__title {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.teasers { max-width: var(--measure); }

/* Each post summary sits under a thin grey rule (the board's grid line) */
.teaser { border-top: 1px solid var(--cell); padding-block: 28px; }
.teaser__title { margin: 0 0 4px; font-size: 26px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.teaser__title a { color: var(--ink); text-decoration: none; }
.teaser__title a:hover { color: var(--link); }
.teaser p { margin: 0 0 10px; }
.more { font-weight: 600; }

.meta { color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.meta a { color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* Single pages and posts                                                 */
/* ---------------------------------------------------------------------- */
.entry { padding-top: 56px; }

.entry__title {
  margin: 0 0 12px;
  max-width: var(--measure);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.entry__title + .prose,
.entry__title + .teasers { margin-top: 32px; }

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 26px; font-weight: 500; line-height: 1.25; margin: 1.8em 0 0.5em; letter-spacing: -0.01em; }
.prose h3 { font-size: 20px; font-weight: 600; margin: 1.5em 0 0.4em; }

/* Quotes from players: a block-coloured bar instead of quotation marks */
.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 22px;
  border-left: 5px solid var(--y);
  font-size: 20px;
  font-weight: 300;
}
.prose blockquote:nth-of-type(2) { border-left-color: var(--c); }
.prose blockquote p { margin: 0; }

/* Figures: centred, like the WordPress "aligncenter" blocks they replace */
.figure { margin: 32px 0; text-align: center; }
.figure figcaption { color: var(--muted); font-size: 16px; margin-top: 8px; }
.figure--badge img { width: 280px; }
/* Phone screenshots: framed by the grey cell colour so the white UI shows */
.figure--phone img {
  width: 320px;
  border: 1px solid var(--cell);
  border-radius: 18px;
}

/* E-mail written with spaces (anti-spam) set apart so it is easy to read */
.email { font-weight: 600; white-space: nowrap; }
.email--big { font-size: 24px; font-weight: 400; }

/* Previous / next post links */
.post-nav {
  max-width: var(--measure);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--cell);
  margin-top: 48px;
  padding-top: 24px;
}
.post-nav a { display: flex; flex-direction: column; text-decoration: none; font-weight: 500; }
.post-nav span { color: var(--muted); font-size: 15px; font-weight: 400; }
.post-nav__next { margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------------- */
/* Small screens                                                          */
/* ---------------------------------------------------------------------- */
@media (max-width: 820px) {
  .hero__in { grid-template-columns: 1fr; gap: 40px; padding-block: 48px 40px; }
  .board { justify-self: start; max-width: 380px; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .site-header__in { flex-direction: column; align-items: flex-start; }
  .hero__lead { font-size: 18px; }
  .board { gap: 4px; }
}
