/* Palette from the Tylesser emblem (branding/tylesser-logo.svg); tooltip colours from the game. */
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/alegreya-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --abyss: #0d0a1c;
  --indigo: #191430;
  --rune: #3a2f6b;
  --gold: #f0c24e;
  --gold-deep: #c88a1e;
  --parchment: #e8dfc6;
  --muted: #aaa3c4;
  --gem: #5fe6cb;

  --tt-bg: rgba(6, 6, 20, 0.95);
  --tt-border: #9a9db8;
  --tt-epic: #b45cf5;
  --tt-use: #1eff00;
  --tt-flavor: #ffd100;
  --tt-grey: #9d9d9d;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --text: "Alegreya", Georgia, serif;
  --measure: 40em;
  --page: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--abyss) radial-gradient(ellipse 90rem 40rem at 50% -10rem, #2e2652 0%, #191430 45%, transparent 100%) no-repeat;
  color: var(--parchment);
  font: 400 1.1875rem/1.6 var(--text);
}

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

a { color: var(--gem); text-underline-offset: 0.18em; }
a:hover { color: #9ff3e2; }
:focus-visible { outline: 2px solid var(--gem); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--gold); margin: 0 0 0.5em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--gold); color: var(--abyss); padding: 0.5rem 1rem; z-index: 1; }
.skip:focus { top: 0.75rem; }

/* Header and footer */

.site-header, .site-footer, main { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--gold); font: 600 1.35rem var(--display); letter-spacing: 0.04em; }
.brand img { border-radius: 50%; }
.header-link { color: var(--parchment); }

.site-footer { margin-top: 6rem; padding-block: 2rem 3rem; background: linear-gradient(var(--rune), var(--rune)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat; color: var(--muted); font-size: 1rem; }
.site-footer p { margin: 0 0 0.5em; max-width: var(--measure); }
.site-footer .fine { font-size: 0.875rem; }

/* Home: hero */

.hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(1.25rem, 4vw, 3rem); padding-block: clamp(2rem, 7vw, 5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero-emblem { width: clamp(7rem, 18vw, 13rem); border-radius: 50%; filter: drop-shadow(0 0 2.5rem rgba(63, 224, 192, 0.18)); }
.hero-title {
  font-size: clamp(3rem, 10vw, 6.5rem);
  letter-spacing: 0.06em;
  margin-bottom: 0.2em;
  background: linear-gradient(180deg, #fff2c0 0%, #f7cc55 38%, #c88a1e 72%, #8a5a0c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-intro { margin: 0; max-width: 32em; font-size: clamp(1.15rem, 2.2vw, 1.4rem); }

/* Home: addon list */

.addon {
  display: grid;
  grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rune);
}
.addon-summary > * + * { margin-top: 1.25rem; }
.addon-icon { display: block; width: 7rem; border-radius: 14px; }
.addon-shot { display: block; justify-self: start; border: 1px solid #6b5420; border-radius: 4px; overflow: hidden; line-height: 0; }
.addon-shot img { max-height: 34rem; width: auto; }
.more { font-size: 1.05rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.button {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gold);
  color: #1d1406;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
}
.button:hover { background: #ffd877; color: #1d1406; }
.button-quiet { background: transparent; color: var(--gold); }
.button-quiet:hover { background: rgba(240, 194, 78, 0.12); color: #ffd877; }

/* The in-game tooltip */

.tooltip {
  max-width: 25rem;
  padding: 0.7rem 0.9rem 0.8rem;
  background: var(--tt-bg);
  border: 1px solid var(--tt-border);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #23233c, 0 0.75rem 2rem rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.02rem;
  line-height: 1.35;
}
.tooltip p { margin: 0 0 0.15rem; }
.tooltip .tt-name { color: var(--tt-epic); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.2rem; }
.tooltip .tt-name a { color: inherit; text-decoration: none; }
.tooltip .tt-name a:hover { text-decoration: underline; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 1rem; }
.tooltip .tt-use { color: var(--tt-use); margin-top: 0.35rem; }
.tooltip .tt-flavor { color: var(--tt-flavor); margin-top: 0.35rem; }
.tooltip .tt-date { color: var(--tt-grey); margin-top: 0.35rem; }

/* Addon page */

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  padding-block: clamp(1.5rem, 5vw, 3.5rem) 2.5rem;
}
.detail-intro > * + * { margin-top: 1.25rem; }
.detail-intro h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin-bottom: 0; }
.lead { max-width: 34em; font-size: 1.3rem; }
.lead p { margin: 0; }

.gallery { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; padding-block: 1rem 3rem; }
.gallery figure { margin: 0; max-width: 100%; }
/* The caption wraps to the image width instead of widening the figure. */
.gallery a { display: inline-block; border: 1px solid #6b5420; border-radius: 4px; overflow: hidden; line-height: 0; }
.gallery figcaption { margin-top: 0.6rem; width: 0; min-width: 100%; color: var(--muted); font-size: 1rem; }

.detail-body { display: grid; gap: 1rem; }

.prose { max-width: var(--measure); padding-top: 2rem; border-top: 1px solid var(--rune); }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.3rem; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 1em; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--gold-deep); }
.prose strong { color: #fff4d6; }
.prose code {
  padding: 0.05em 0.35em;
  background: var(--indigo);
  border: 1px solid var(--rune);
  border-radius: 3px;
  font: 0.85em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: nowrap;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 1.05rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rune); vertical-align: top; }
.prose th { color: var(--gold); font-weight: 700; }

.changelog details { border-bottom: 1px solid var(--rune); padding-block: 0.6rem; }
.changelog summary { cursor: pointer; font: 600 1.2rem var(--display); color: var(--gold); }
.changelog details[open] summary { margin-bottom: 0.75rem; }

.not-found { padding-block: 5rem; max-width: var(--measure); }

/* Narrow screens */

@media (max-width: 52rem) {
  .addon, .detail-head { grid-template-columns: minmax(0, 1fr); }
  .addon-shot img { max-height: none; }
}

@media (max-width: 30rem) {
  body { font-size: 1.125rem; }
  .hero { grid-template-columns: 1fr; }
  .prose table { display: block; overflow-x: auto; }
}
