/* SKYWARD site styles.
   Light mode only, on purpose. Colours and type are the game's own design tokens
   (assets/design-tokens.json in the game repo), used at web contrast levels.
   Fredoka is the game's one face: weight carries the hierarchy, not a second family.
   SIL Open Font License, see assets/fonts/Fredoka-OFL.txt. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --paper-soft: #fbf6ec;
  --paper-sunk: #f6efe2;

  --ink: #1f1a16;
  --ink-2: #55483c;
  --ink-3: #82715f;

  --line: #e7ddcc;
  --line-soft: #f0e8da;

  --plum: #4a2b62;
  --plum-deep: #38204a;
  --gold: #e8a93b;
  --gold-ink: #96661a;
  --cyan-ink: #0f7d85;

  --w-page: 1080px;
  --w-prose: 40rem;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: clamp(1.9rem, 1.35rem + 2.2vw, 3rem);
  --step-5: clamp(2.25rem, 1.45rem + 3.6vw, 4rem);
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.7;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  overflow-wrap: break-word;
  line-height: 1.18;
  letter-spacing: -0.018em;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; }
h4 { font-size: var(--step-0); font-weight: 600; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--plum);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(74, 43, 98, 0.32);
}
a:hover { text-decoration-color: currentColor; }

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

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--paper-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 0.08em 0.34em;
}

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

.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--plum);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 20;
}
.skip:focus { left: 0; }

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-right: auto;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.94rem;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

@media (max-width: 640px) {
  .site-head .wrap { min-height: 56px; padding-block: 0.6rem; }
  .site-nav { gap: 1rem; width: 100%; overflow-x: auto; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn-primary {
  background: var(--plum);
  color: #fff;
  border-color: var(--plum);
}
.btn-primary:hover { background: var(--plum-deep); border-color: var(--plum-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-3); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* ---------------------------------------------------------------- sections */

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--line-soft); }
.section-soft { background: var(--paper-soft); border-top: 1px solid var(--line-soft); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-ink);
  margin: 0 0 1rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold);
}

.lede {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 34rem;
}

.section-head { max-width: 38rem; margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-2); margin-bottom: 0; }

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

.hero { padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { margin-bottom: 1rem; max-width: 15ch; }
.hero .lede { margin-bottom: 2rem; }

.hero-shot,
.hero-art {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper-soft);
}

.hero-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot, .hero-art { max-width: 320px; }
}

/* ---------------------------------------------------------------- grids */

.grid {
  display: grid;
  gap: 1.75rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.grid-pair { grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); }

.feature h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.feature p { color: var(--ink-2); margin-bottom: 0; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--plum);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- table */

.table-scroll { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.96rem;
  margin: 0 0 1.5rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
th {
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--line);
  white-space: nowrap;
}
td { color: var(--ink-2); }
tbody tr:last-child td,
tbody tr:last-child th { border-bottom: 0; }

.table-tight { max-width: 32rem; }
.table-tight td:last-child, .table-tight th:last-child { text-align: right; padding-right: 0; }

/* ---------------------------------------------------------------- leagues */

.leagues { list-style: none; margin: 0; padding: 0; }
.leagues li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 11rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.leagues li:last-child { border-bottom: 0; }
.leagues .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.leagues .name { font-weight: 600; }
.leagues .what { color: var(--ink-2); }

@media (max-width: 640px) {
  .leagues li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------------------------------------------------------------- shots */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem;
}
.shots figure { margin: 0; }
.shots img {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper);
}
.shots figcaption {
  margin-top: 0.7rem;
  font-size: 0.87rem;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- prose */

.prose { max-width: var(--w-prose); }
.prose h1 { font-size: var(--step-4); margin-bottom: 0.4rem; }
.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.75rem;
  padding-top: 0.2rem;
}
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.15rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--ink-3); }
.prose table { margin-block: 1.5rem 2rem; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--gold);
  color: var(--ink-2);
}

.doc-meta {
  font-size: 0.9rem;
  color: var(--ink-3);
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.doc-nav {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.callout {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.15rem 1.25rem;
  margin: 0 0 1.5rem;
  font-size: 0.96rem;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); }

/* ---------------------------------------------------------------- faq */

.faq { max-width: var(--w-prose); }
.faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 2rem 0.85rem 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 1.35rem;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.6rem; }
.faq .answer { padding: 0 0 1.1rem; color: var(--ink-2); }

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

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--paper-soft);
  padding-block: 3rem 2.5rem;
  font-size: 0.92rem;
  color: var(--ink-3);
}
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.foot-grid h4 {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 0.5rem; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-brand p { max-width: 24rem; margin-bottom: 0; }
.foot-brand .brand { margin-bottom: 0.8rem; }
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
