/*
 * Styles for the Yarborn landing page (English and Ukrainian share this file).
 * No web fonts and no scripts: the site ships only HTML, this stylesheet and images,
 * so the Content-Security-Policy in _headers can forbid everything else.
 */

:root {
  /* Palette from the concept art: night forest, cold mist, parchment text, the red Cossack sash. */
  --color-background: #0d1310;
  --color-surface: #151d18;
  --color-border: #2a362e;
  --color-text: #e9e3d5;
  --color-text-muted: #b3ad9f;
  --color-accent: #c8553d;
  --color-accent-soft: #e08a72;

  --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page-gutter: 1.25rem;
  --content-width: 68rem;
}

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

html {
  scroll-behavior: smooth;
}

/* Visitors who ask for less motion get instant jumps to the page sections. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

a {
  color: var(--color-accent-soft);
}

a:hover {
  color: var(--color-text);
}

/* One visible focus style for every link, for keyboard users. */
a:focus-visible {
  outline: 3px solid var(--color-accent-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

/* Short paragraphs wrap into lines of similar length, so that no line ends with one or two orphan words.
   Browsers that do not know the property keep the normal wrapping. */
.tagline,
.lead,
.pull-quote,
.note {
  text-wrap: balance;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* Shown only when focused: lets keyboard users jump over the navigation. */
.skip-link {
  position: absolute;
  left: var(--page-gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--color-text);
  color: var(--color-background);
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---------- Top bar ---------- */

.top-bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  padding: 1rem 0;
}

.top-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.wordmark {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
}

.top-bar nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-bar nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}

.top-bar nav a:hover {
  text-decoration: underline;
}

/* The link to the other language is boxed so that it reads as a switch, not a section link. */
.top-bar nav a.language-switch {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--color-text-muted);
  border-radius: 999px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92vh, 52rem);
  padding: 9rem 0 4rem;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keeps the monastery on the hill in view when the picture is cropped on narrow screens. */
  object-position: 70% 30%;
}

/* Darkens the picture behind the text so that the text keeps its contrast on any crop. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(13, 19, 16, 0.75) 0%, rgba(13, 19, 16, 0.1) 30%, rgba(13, 19, 16, 0.55) 62%, var(--color-background) 100%);
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(3.25rem, 11vw, 7rem);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.hero .subtitle {
  margin: 0.25rem 0 1.25rem;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  font-style: italic;
  color: var(--color-accent-soft);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.hero .tagline {
  font-size: 1.2rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-text-muted);
  border-radius: 999px;
  background: rgba(13, 19, 16, 0.6);
  font-size: 0.9rem;
}

/* ---------- Sections ---------- */

.section {
  padding: 4.5rem 0;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

.section h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.9rem, 5vw, 2.75rem);
}

.section .lead {
  font-size: 1.15rem;
}

.section .note {
  max-width: 44rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* The line that the story section ends on. */
.pull-quote {
  max-width: 44rem;
  margin: 2rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.35;
}

/* The three power cards: one column on phones, one row of three from tablet width up.
   A fixed column count avoids the uneven "two cards, then one" row that auto-fit gives. */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 1.25rem 1.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
}

.card h3 {
  margin-bottom: 0.15rem;
  font-size: 1.35rem;
}

/* The power's name in the other language, under its heading. */
.card .original-name {
  margin-bottom: 0.75rem;
  color: var(--color-accent-soft);
  font-size: 0.95rem;
  font-style: italic;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.gallery figcaption {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 2rem;
  margin: 2rem 0 0;
}

.fact-list dt {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

/* ---------- Footer and the not-found page ---------- */

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0.4rem;
}

.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 0;
}

.not-found h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 8vw, 4rem);
}
