/* Isekai Defense - public site (Firebase Hosting). No scripts, no third-party requests. */

@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/fonts/lilita-one-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/fonts/lilita-one-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Palette sampled from the game's theme (src/ui/theme/Theme.ts). */
:root {
  color-scheme: dark;
  --ink: #0b0605;
  --bg: #120e0d;
  --panel: #1c1615;
  --panel-2: #261c1a;
  --panel-lip: #2c211e;
  --wood-hi: #d49a5e;
  --wood: #84502e;
  --wood-dark: #4e2a18;
  --gold-hi: #fffbd0;
  --gold: #fcc33a;
  --gold-deep: #f5a524;
  --gold-dark: #b45d19;
  --title: #fdf08a;
  --text: #efe3c8;
  --cream: #fff4d6;
  --muted: #b8a78a;
  --link: #ffe36e;
  --red: #ff6a5a;
  --display: 'Lilita One', 'Trebuchet MS', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -10%, #3a2415 0%, rgba(58, 36, 21, 0) 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.65 var(--body);
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

/* ---- Header ---------------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 14, 13, 0.92);
  border-bottom: 2px solid var(--wood-dark);
  box-shadow: 0 1px 0 var(--wood) inset, 0 6px 18px rgba(0, 0, 0, 0.45);
}

@supports (backdrop-filter: blur(6px)) {
  .site-header {
    background: rgba(18, 14, 13, 0.8);
    backdrop-filter: blur(6px);
  }
}

.site-header .bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--title);
  text-decoration: none;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 0 var(--ink);
  margin-right: auto;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px 14px;
  flex-wrap: wrap;
  font-size: 15px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--gold);
}

.lang {
  display: inline-flex;
  border: 1px solid var(--wood);
  border-radius: 999px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
}

.lang a,
.lang span {
  padding: 3px 10px;
  text-decoration: none;
  color: var(--muted);
}

.lang span {
  background: var(--gold);
  color: var(--ink);
}

.lang a:hover {
  color: var(--gold-hi);
  background: var(--panel-2);
}

/* ---- Document pages -------------------------------------------------------------------------- */

main.doc {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 0 16px;
}

.card {
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 120px);
  border: 2px solid var(--wood);
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--ink), 0 1px 0 var(--wood-hi) inset, 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 28px clamp(18px, 4vw, 44px) 32px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 0 var(--ink);
}

h1 {
  color: var(--title);
  font-size: clamp(28px, 5vw, 38px);
  margin: 0 0 6px;
}

h2 {
  color: var(--gold);
  font-size: clamp(21px, 3.4vw, 25px);
  margin: 38px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-lip);
}

h3 {
  color: var(--cream);
  font-size: 19px;
  margin: 24px 0 6px;
}

.kicker {
  font-family: var(--display);
  color: var(--gold-deep);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 4px;
}

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

.lead {
  font-size: 17px;
  color: var(--cream);
}

p,
ul,
ol {
  margin: 0 0 14px;
}

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

li {
  margin: 4px 0;
}

li::marker {
  color: var(--gold-deep);
}

strong {
  color: var(--cream);
}

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

.ui {
  font-weight: 700;
  color: var(--title);
}

.summary {
  background: rgba(252, 195, 58, 0.07);
  border: 1px solid rgba(252, 195, 58, 0.35);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 18px 4px;
  margin: 18px 0 8px;
}

.summary h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 20px;
}

.note {
  background: var(--panel-lip);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 15px;
}

.note > :last-child {
  margin-bottom: 0;
}

.toc {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-lip);
  border-radius: 10px;
  padding: 12px 18px 6px;
  margin: 18px 0;
  font-size: 15px;
}

.toc ol {
  columns: 2 16rem;
  column-gap: 28px;
  margin: 6px 0;
}

.toc li {
  break-inside: avoid;
}

.toc a {
  color: var(--text);
}

/* Steps */
ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 10px 14px 10px 54px;
  margin: 8px 0;
  background: var(--panel-lip);
  border-radius: 10px;
  min-height: 48px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-dark) 100%);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  box-shadow: 0 0 0 2px var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.3px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 40%, var(--gold-deep) 75%, var(--gold-dark) 100%);
  border-radius: 10px;
  padding: 10px 20px;
  box-shadow: 0 0 0 2px var(--ink), 0 4px 0 #5e1f02, 0 8px 18px rgba(0, 0, 0, 0.45);
}

.btn:hover {
  color: var(--ink);
  filter: brightness(1.06);
}

.btn.secondary {
  color: var(--cream);
  background: linear-gradient(180deg, #3a2a22 0%, var(--panel-2) 100%);
  box-shadow: 0 0 0 2px var(--wood), 0 4px 0 var(--ink), 0 8px 18px rgba(0, 0, 0, 0.45);
}

.btn.secondary:hover {
  color: var(--gold-hi);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 8px;
}

.mail {
  font-weight: 700;
  white-space: nowrap;
}

/* Tables: a real table on wide screens, stacked rows on phones. */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 10px 0 18px;
  font-size: 15px;
  border: 1px solid var(--panel-lip);
  border-radius: 10px;
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-lip);
}

.table thead th {
  background: var(--wood-dark);
  color: var(--title);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table td:first-child {
  color: var(--cream);
  font-weight: 600;
}

@media (max-width: 640px) {
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tr {
    border-bottom: 1px solid var(--wood-dark);
    padding: 6px 0;
  }

  .table tbody tr:last-child {
    border-bottom: 0;
  }

  .table td {
    border: 0;
    padding: 4px 12px;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--gold-deep);
  }

  .table td:first-child::before {
    display: none;
  }

  .table tbody tr:nth-child(even) td {
    background: none;
  }

  .table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
  }
}

/* ---- Landing --------------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--wood-dark);
  background-color: #1d2a4a;
  background-image: linear-gradient(180deg, rgba(18, 14, 13, 0.15) 0%, rgba(18, 14, 13, 0.35) 55%, var(--bg) 100%),
    url(/assets/bg_title.png);
  background-size: cover;
  background-position: center 30%;
  image-rendering: pixelated;
}

.hero .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(28px, 7vw, 72px) 16px clamp(36px, 7vw, 64px);
  text-align: center;
}

.hero .logo {
  width: min(572px, 100%);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pitch {
  font-family: var(--display);
  color: var(--cream);
  font-size: clamp(20px, 3.6vw, 30px);
  line-height: 1.25;
  max-width: 720px;
  margin: 18px auto 10px;
  text-shadow: 0 2px 0 var(--ink), 0 0 16px rgba(0, 0, 0, 0.7);
}

.badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 0 0 2px var(--ink);
}

.hero .actions {
  justify-content: center;
  margin-top: 26px;
}

.tiles {
  max-width: 960px;
  margin: 28px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 16px;
}

.tile {
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 2px solid var(--wood);
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--ink), 0 1px 0 var(--wood-hi) inset;
  padding: 18px 20px 12px;
}

.tile h2 {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 21px;
}

.tile p {
  font-size: 15px;
}

.tile .links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-weight: 600;
}

/* ---- Footer ---------------------------------------------------------------------------------- */

.site-footer {
  max-width: 960px;
  margin: 36px auto 0;
  padding: 18px 16px 32px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
}

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

@media (max-width: 480px) {
  body {
    font-size: 15.5px;
  }

  .brand {
    font-size: 19px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .nav {
    font-size: 14px;
  }

  main.doc {
    margin-top: 18px;
  }

  .card {
    border-radius: 12px;
  }

  ol.steps > li {
    padding-left: 50px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .lang,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    border: 0;
    box-shadow: none;
    background: none;
  }

  h1,
  h2,
  h3,
  strong,
  .ui {
    color: #000;
    text-shadow: none;
  }
}
