/* =====================================================================
   Amaze Go Arrow Puzzle - amazego.iamtac.com
   One stylesheet, no frameworks, no web fonts, no external requests.
   Brand tokens first, then layout, components, pages, responsive, themes.
   ===================================================================== */

/* --------------------------------------------------------------- tokens -- */

:root {
  --cream: #fbf3e4;
  --surface: #fffaf0;
  --surface-2: #f4e7d1;
  --brown: #3e2a20;
  --brown-soft: #6c5346;
  --coral: #ff7a45;
  --coral-deep: #e4572e;
  --green: #2fbf71;
  --amber: #f0a21c;
  --blue: #3e9bd6;

  --bg: var(--cream);
  --text: var(--brown);
  --text-soft: var(--brown-soft);
  --border: rgba(62, 42, 32, 0.12);
  --shadow: 0 10px 26px rgba(62, 42, 32, 0.14);
  --shadow-sm: 0 3px 10px rgba(62, 42, 32, 0.12);

  --radius: 18px;
  --radius-sm: 12px;
  --pill: 999px;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Consolas", "SF Mono", "Liberation Mono", monospace;

  --wrap: 1100px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #221a16;
    --surface: #2c221c;
    --surface-2: #362a23;
    --text: #f7eedd;
    --text-soft: #c3b2a0;
    --border: rgba(247, 238, 221, 0.14);
    --shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.34);
    --coral: #ff8f5f;
    --green: #4bd48a;
  }
}

/* ---------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--coral-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
h4 {
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(21px, 3.2vw, 28px);
}

h3 {
  font-size: 17px;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 14px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 1px 6px;
  word-break: break-word;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brown);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 800;
  z-index: 50;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 18px;
}

.section {
  padding: 46px 0;
}

.section--tight {
  padding: 28px 0;
}

.section--alt {
  background: linear-gradient(180deg, transparent, var(--surface-2) 18%, var(--surface-2) 82%, transparent);
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  font-weight: 900;
  color: var(--coral-deep);
  text-transform: uppercase;
  margin: 0 0 8px;
}

.lead {
  font-size: 17px;
  color: var(--text-soft);
  max-width: var(--measure);
}

.muted {
  color: var(--text-soft);
}

.small {
  font-size: 13px;
}

.center {
  text-align: center;
}

.center .lead {
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------- header -- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-head {
    background: var(--bg);
  }
}

.site-head__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand__mark--sm {
  width: 30px;
  height: 30px;
}

.mark-bg {
  fill: var(--surface-2);
  stroke: var(--border);
  stroke-width: 1.5;
}

.mark-path {
  stroke: var(--text);
  stroke-width: 7.5;
}

.mark-start {
  fill: var(--coral);
}

.mark-goal {
  fill: var(--green);
}

.brand__text b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand__text small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  font-weight: 800;
  color: var(--text-soft);
}

.accent {
  color: var(--coral-deep);
}

.site-nav {
  flex: 1 1 auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav ul::-webkit-scrollbar {
  display: none;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--pill);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-2);
}

.site-nav a[aria-current='page'] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--coral-deep);
}

.site-head__cta {
  flex: 0 0 auto;
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 100%);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 1px rgba(120, 40, 15, 0.35);
}

.btn--sm {
  padding: 9px 14px;
  font-size: 12px;
}

.btn--wide {
  padding: 15px 26px;
  font-size: 15px;
}

.btn.is-pending {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.is-pending:hover {
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding: 40px 0 10px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.hero h1 {
  margin-bottom: 10px;
}

.hero__pitch {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 46ch;
}

.hero__note {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.pill-row li {
  margin: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 5px 11px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

/* browser-ish frame around the screenshot */
.frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.frame__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}

.frame__url {
  margin-left: 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 700;
}

.frame img {
  display: block;
  width: 100%;
}

/* ---------------------------------------------------------------- cards -- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card__icon {
  font-size: 22px;
  line-height: 1;
  color: var(--coral-deep);
  margin-bottom: 10px;
}

.card h3 {
  margin-bottom: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.steps > li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 20px 62px;
  box-shadow: var(--shadow-sm);
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, var(--coral), var(--coral-deep));
}

.steps h3 {
  margin-bottom: 4px;
}

.steps p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.step-art {
  display: block;
  margin-top: 10px;
}

/* ------------------------------------------------------------------ FAQ -- */

.faq {
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--coral-deep);
  font-weight: 900;
  font-size: 18px;
  flex: 0 0 auto;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p:last-child {
  margin-bottom: 14px;
}

.faq details p {
  font-size: 14.5px;
  color: var(--text-soft);
}

/* --------------------------------------------------------------- tables -- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 460px;
}

caption {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 12px 14px 0;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/* ----------------------------------------------------------- long reads -- */

.page-head {
  padding: 36px 0 6px;
}

.page-head h1 {
  margin-bottom: 8px;
}

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

.prose h2 {
  margin-top: 34px;
  font-size: 21px;
  scroll-margin-top: 90px;
}

.prose h3 {
  margin-top: 22px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.prose ul,
.prose ol {
  color: var(--text-soft);
}

.prose li strong,
.prose li b {
  color: var(--text);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-sm);
}

.callout ul {
  margin: 0;
  color: var(--text);
}

.callout li:last-child {
  margin-bottom: 0;
}

.callout--warn {
  border-left-color: var(--coral-deep);
}

.stamp {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: var(--pill);
  padding: 5px 12px;
  margin-bottom: 14px;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 26px;
}

.toc p {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-soft);
}

.toc ol {
  margin: 0;
  columns: 2;
  column-gap: 26px;
  font-size: 13.5px;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

/* ------------------------------------------------------------ hint page -- */

.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto 18px;
}

.code {
  font-family: var(--mono);
  font-size: clamp(34px, 11vw, 56px);
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 8px 0 6px;
  user-select: all;
  word-break: break-all;
}

.code-timer {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin: 0;
}

.code-bar {
  height: 6px;
  border-radius: var(--pill);
  background: var(--surface-2);
  overflow: hidden;
  margin: 14px 0 18px;
}

.code-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--green));
  transition: width 1s linear;
}

.code-copy {
  width: 100%;
  border: 0;
}

.code-copy.is-copied {
  background: var(--green);
}

.sponsor-slot {
  max-width: 560px;
  margin: 0 auto 18px;
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hint-help {
  max-width: 560px;
  margin: 0 auto;
}

/* --------------------------------------------------------- cookie notice -- */

.cookie-note {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(62, 42, 32, 0.12);
}

.cookie-note__inner {
  padding: 12px 18px;
}

.cookie-note p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-soft);
}

/* --------------------------------------------------------------- footer -- */

.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 30px 0;
  background: var(--surface);
}

.site-foot__inner {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr);
}

.site-foot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-foot__brand p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.site-foot__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px 16px;
}

.site-foot__links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
}

.site-foot__links a:hover {
  color: var(--coral-deep);
  text-decoration: underline;
}

.site-foot__meta p {
  margin: 0 0 6px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ 404 -- */

.notfound {
  padding: 70px 0;
  text-align: center;
}

.notfound__code {
  font-size: clamp(56px, 16vw, 96px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--coral-deep);
  line-height: 1;
  margin: 0 0 8px;
}

/* ----------------------------------------------------------- responsive -- */

@media (min-width: 620px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-foot__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .section {
    padding: 60px 0;
  }
  .hero {
    padding: 56px 0 20px;
  }
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
  }
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-foot__inner {
    grid-template-columns: 0.9fr 1.2fr 1.4fr;
  }
}

@media (max-width: 460px) {
  .toc ol {
    columns: 1;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .btn--sm {
    width: auto;
  }
  .site-head__cta {
    display: none;
  }
}

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

@media print {
  .site-head,
  .site-foot__links,
  .cookie-note,
  .btn {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
