/* Clankia Studio placeholder. Mobile-first: base styles are for small phones,
   min-width queries add room. Palette tokens come from the brand SVGs. */

:root {
  --bg: #14161b;
  --raised: #22252d;
  --border: #4c505c;
  --text: #f2efe6;
  --muted: #9298a3;
  --muted-2: #a7adb7;

  --gold: #f2cc66;
  --gold-hi: #fff4c8;
  --gold-shadow: #c99a3a;
  --gold-deep: #7a5f26;

  --saw: #f6a964;
  --saw-2: #d86a2a;
  --saw-deep: #9a4520;

  --steel: #eef0f3;
  --steel-2: #c9cdd3;
  --steel-3: #8e949f;

  --blue: #7fd0f0;
  --blue-2: #3a8fc4;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 5vw, 2.5rem);
  /* Spacing rhythm: one step between related things, one between sections. */
  --step: clamp(1rem, 2.5vw, 1.25rem);
  --space: clamp(4rem, 9vw, 6.5rem);
  --page: 1100px;
  --measure: 68ch;
  --radius: 10px;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background-color: var(--bg);
  /* Faint workshop grid with a warm glow behind the hero. */
  background-image:
    radial-gradient(60rem 36rem at 50% -8rem, rgb(242 204 102 / 0.07), transparent 70%),
    linear-gradient(rgb(146 152 163 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(146 152 163 / 0.045) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  background-position: center top;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
}

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

h1,
h2,
h3,
p,
ul,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3,
blockquote p,
figcaption,
.pitch,
.more {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--gold-hi);
}

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

/* Layout */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

main {
  flex: 1;
  /* The hero blade runs off the side on narrow screens; clip it here, not on body
     (body overflow propagates to the viewport, which can still scroll). */
  overflow-x: clip;
}

main > section + section {
  margin-top: var(--space);
}

.skip-link {
  position: absolute;
  top: 0;
  left: max(1rem, env(safe-area-inset-left));
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
  color: var(--bg);
}

/* Header */

.site-header {
  display: flex;
  justify-content: center;
  padding-top: max(1rem, env(safe-area-inset-top));
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: 8px;
}

.brand img {
  width: clamp(6.5rem, 24vw, 8.5rem);
}

/* Hero */

/* Hierarchy: the logo leads, "Coming soon" is stamped under it, the pitch follows. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(2.5rem, 8vw, 4.5rem) clamp(0.5rem, 3vw, 1.5rem);
  text-align: center;
}

.lockup {
  position: relative;
  width: min(100%, 44rem);
}

.game-logo {
  width: 100%;
  filter: drop-shadow(0 0.5rem 1.5rem rgb(0 0 0 / 0.45));
}

/* The memorable bit: a big, faint blade turning slowly on the same centre as the
   logo's own saw (744, 88 in the logo's 826 x 170 viewBox), so the logo's blade
   reads as its hub. Clipped at the viewport edge by body's overflow-x. */
.saw {
  --blade: clamp(17rem, 88vw, 34rem);
  position: absolute;
  z-index: -1;
  left: 90.07%;
  top: 51.76%;
  width: var(--blade);
  height: var(--blade);
  translate: -50% -50%;
  border-radius: 50%;
  /* A solid disc out to 86%, teeth beyond it, and an arbor hole cut by the mask. */
  background:
    radial-gradient(circle closest-side, var(--border) 0 86%, transparent 86.5%),
    repeating-conic-gradient(var(--border) 0 6deg, transparent 6deg 12deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 20%, #000 20.5%);
  mask: radial-gradient(circle closest-side, transparent 0 20%, #000 20.5%);
  opacity: 0.2;
  animation: spin 120s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* "Coming soon", stamped in the logo's hazard orange over a short hazard stripe. */
.status {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: calc(var(--step) * 1.5);
  color: var(--saw);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
}

.status::after {
  content: "";
  width: 100%;
  height: 6px;
  border-radius: 1px;
  background: repeating-linear-gradient(-45deg, var(--saw-2) 0 5px, transparent 5px 10px);
}

.pitch {
  max-width: 36ch;
  margin-top: var(--step);
  color: var(--steel-2);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
}

.eyebrow {
  color: var(--saw);
  font-size: 1rem;
  font-weight: 700;
}

/* Sections */

h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.25;
  color: var(--gold);
}

.world {
  max-width: calc(60ch + 2 * var(--gutter));
  text-align: center;
}

.world p {
  margin-top: var(--step);
  color: var(--muted-2);
}

.world p:first-of-type {
  color: var(--text);
}

.tiles {
  display: grid;
  gap: var(--step);
}

/* Feature tiles are quiet riveted plates, like the plate on Pebble's belly. */
.tile {
  --rivet: rgb(142 148 159 / 0.45);
  padding: 1.75rem 1.5rem 1.5rem;
  background:
    radial-gradient(circle at 0.75rem 0.75rem, var(--rivet) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 0.75rem) 0.75rem, var(--rivet) 0 2px, transparent 2.5px),
    radial-gradient(circle at 0.75rem calc(100% - 0.75rem), var(--rivet) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 0.75rem) calc(100% - 0.75rem), var(--rivet) 0 2px, transparent 2.5px),
    var(--raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.tile h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--steel);
}

.tile p {
  margin-top: 0.5rem;
  color: var(--muted-2);
}

.more {
  margin-top: calc(var(--step) * 1.75);
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Platforms */

.platforms {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--step);
  text-align: center;
}

.label {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

/* Plain text on purpose, not chips or badges, so nobody mistakes them for store
   links. Each name stays whole; the dots are decoration, hidden from screen
   readers (the list already says there are three). */
.platform-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--steel-3);
  font-weight: 600;
}

.platform-list li {
  white-space: nowrap;
}

.platform-list li + li::before {
  content: "·";
  content: "·" / "";
  margin-inline: 0.6em;
}

/* The ledge: a panel with Pebble peeking over its top border. The mascot is
   drawn cut off flat at the bottom; that edge sits exactly on the border's
   outer edge because the image is anchored to it (bottom: 100% + border). */

.panel {
  --peek: min(clamp(7.5rem, 36vw, 12rem), 30svh);
  --ledge: 3px;
  --pad-x: clamp(1.25rem, 5vw, 3rem);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--step);
  max-width: 46rem;
  margin: var(--peek) auto 0;
  padding: clamp(1.75rem, 5vw, 2.75rem) var(--pad-x);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.03), transparent 40%), var(--raised);
  border: 1px solid var(--border);
  border-top: var(--ledge) solid var(--steel-3);
  border-radius: var(--radius);
  /* A thin highlight under the ledge so it reads as a solid edge Pebble is behind. */
  box-shadow: inset 0 1px 0 rgb(238 240 243 / 0.08), 0 1.5rem 3rem rgb(0 0 0 / 0.25);
  text-align: center;
}

.peek {
  position: absolute;
  bottom: calc(100% + var(--ledge));
  left: 50%;
  width: var(--peek);
  height: var(--peek);
  max-width: none;
  margin-left: calc(var(--peek) / -2);
}

.quote blockquote p {
  max-width: 30ch;
  color: var(--text);
  font-size: clamp(1.125rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.45;
}

.quote figcaption {
  margin-top: 0.75rem;
  color: var(--blue);
  font-size: 0.9375rem;
  font-weight: 600;
}

.quote figcaption::before {
  content: "— ";
}

.panel h2 {
  margin-top: 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  align-self: stretch;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--gold-shadow);
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(242 204 102 / 0.14), rgb(242 204 102 / 0.04));
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: box-shadow 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.button:hover {
  color: var(--gold-hi);
  border-color: var(--gold);
  box-shadow: 0 0 1.5rem rgb(242 204 102 / 0.25);
}

/* Footer */

.site-footer {
  margin-top: var(--space);
  padding-top: 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--raised);
}

.footer-inner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted-2);
}

.footer-inner a:hover {
  color: var(--gold);
}

/* Privacy policy: one readable, left-aligned column. */

.legal {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-top: clamp(2rem, 6vw, 3.5rem);
}

.legal h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.2;
}

.legal .updated {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.legal section {
  margin-top: calc(var(--step) * 2);
}

.legal h2 {
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
}

.legal p {
  margin-top: 0.625rem;
  color: var(--muted-2);
}

.nowrap {
  white-space: nowrap;
}

/* Inline links get a taller tap area (44px+) without changing the line layout:
   vertical padding on an inline element doesn't move the lines around it. */
.legal p a {
  padding-block: 0.75em;
}

/* 404 */

.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70svh;
  padding-block: clamp(2rem, 6vw, 3.5rem);
}

.not-found .panel {
  width: 100%;
  max-width: 36rem;
}

.not-found h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.2;
}

.not-found .eyebrow {
  margin-bottom: 0.25rem;
}

/* Larger screens */

@media (min-width: 600px) {
  .platforms {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 960px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Short landscape screens (phones on their side). */
@media (orientation: landscape) and (max-height: 500px) {
  .not-found {
    min-height: auto;
  }

  /* 404: the whole message fits on one screen. A small Pebble peeks over the
     left of the ledge; heading on the left, Pebble's line and the link on the right. */
  .not-found {
    padding-block: 0.25rem 0;
  }

  .not-found .panel {
    --peek: 4.5rem;
    max-width: 44rem;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    grid-template-areas: "head quote" "head link";
    align-items: center;
    column-gap: 2rem;
    row-gap: 0.75rem;
    padding: 1rem 1.5rem;
    text-align: left;
  }

  .not-found .panel-head { grid-area: head; }
  .not-found .quote { grid-area: quote; }
  .not-found .button { grid-area: link; justify-self: start; }

  .not-found h1 {
    font-size: 1.5rem;
  }

  .not-found .quote blockquote p {
    font-size: 1.0625rem;
  }

  .not-found .quote figcaption {
    margin-top: 0.25rem;
  }

  .not-found ~ .site-footer {
    margin-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
