/* Firnhold Tales: site style. Colours from the game's palette (art/style.toml). */

:root {
  --ink: #17131f;
  --ink-2: #1f1a2a;
  --ink-3: #2a2338;
  --line: #3a3149;
  --text: #e9dfc6;
  --text-soft: #b5a593;
  --text-bright: #f7f1dd;
  --gold: #dfc56c;
  --gold-light: #f0e095;
  --gold-dark: #a8843d;
  --gold-deep: #5e4623;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --wrap: 68rem;
  --narrow: 42rem;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-light); }
a:focus-visible,
.cta:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

h1, h2, h3 {
  color: var(--text-bright);
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  margin: 0 0 0.75rem;
}

h2::after {
  /* a short stepped rule, like a row of pixels */
  content: "";
  display: block;
  width: 4.5rem;
  height: 6px;
  margin-top: 0.6rem;
  background:
    linear-gradient(90deg,
      var(--gold-dark) 0 33.3%, var(--gold) 33.3% 66.6%, var(--gold-light) 66.6% 100%);
}

h3 {
  font-size: 1.2rem;
  margin: 1.6rem 0 0.4rem;
  color: var(--gold-light);
}

p { margin: 0 0 1rem; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wrap.narrow { max-width: var(--narrow); }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 0.8rem;
  background: var(--gold);
  color: var(--ink);
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-bright);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand img { display: block; }

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--gold-light); text-decoration: underline; }
nav .nav-play { color: var(--gold); font-weight: 700; }

@media (max-width: 44rem) {
  nav li:not(:last-child) { display: none; }
}

/* Hero */

.hero { padding: 2.75rem 0 1rem; }

.kicker {
  margin: 0 0 0.25rem;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.5vw, 4.4rem);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 var(--gold-deep);
}

.summary {
  max-width: var(--narrow);
  font-size: 1.2rem;
  color: var(--text);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.cta {
  display: inline-block;
  padding: 0.8rem 1.3rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  /* stepped, pixel-like edge */
  box-shadow:
    0 4px 0 var(--gold-dark),
    4px 0 0 var(--gold-dark),
    4px 4px 0 var(--gold-deep);
}
.cta:hover { background: var(--gold-light); color: var(--ink); }
/* (as a button: the unsubscribe page, /news/) */
button.cta { font: inherit; font-weight: 700; border: 0; cursor: pointer; }
button.cta:disabled { opacity: 0.6; cursor: default; }
.cta:active { transform: translate(2px, 2px); box-shadow: 0 2px 0 var(--gold-dark), 2px 0 0 var(--gold-dark); }

.cta-note { color: var(--text-soft); font-size: 1rem; }
.hero .cta { font-size: 1.25rem; padding: 0.9rem 1.8rem; }

/* Screenshots */

.shot { margin: 2rem 0 0; }

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--ink-3);
  border: 4px solid var(--ink-3);
  box-shadow: 0 0 0 1px var(--line);
}
.shot img { image-rendering: pixelated; }

.shot figcaption {
  margin-top: 0.6rem;
  color: var(--text-soft);
  font-size: 0.98rem;
  font-style: italic;
}

/* Sections */

.section { padding: 3.5rem 0; }
.section.alt {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lead {
  max-width: var(--narrow);
  font-size: 1.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.grid.four { grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); }

.card {
  padding: 1.1rem 1.25rem 0.4rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold-dark);
}
.card h3 { margin-top: 0; }

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 2.5rem;
}
@media (min-width: 52rem) {
  .cols { grid-template-columns: 1fr 1fr; }
}
.cols > div > h3:first-child { margin-top: 0.75rem; }
.shot + .cols { margin-top: 1.5rem; }

/* A picture and its text side by side; `flip` puts the picture on the right. One column on narrow screens. */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2.5rem;
  align-items: center;
  margin-top: 3rem;
}
.feature .shot { margin: 0; }
.feature-text h3 { margin-top: 0.5rem; font-size: 1.45rem; }
.feature-text > :last-child { margin-bottom: 0; }
@media (min-width: 60rem) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .feature.flip .shot { order: 2; }
  .feature-text h3 { margin-top: 0; }
}

/* The trades: a few words and a grid of small loops */

.trades { margin-top: 3.5rem; }
.trades-text { max-width: 52rem; }
.trades-text h3 { margin-top: 0; font-size: 1.45rem; }

.loops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 46rem) {
  .loops { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.loops figure { margin: 0; }
.loops video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--ink-3);
  border: 4px solid var(--ink-3);
  box-shadow: 0 0 0 1px var(--line);
}
.loops figcaption {
  margin-top: 0.4rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-style: italic;
}

/* The mountain: colder and darker than the rest, and now and then it rumbles */

.section.mountain {
  background: #10131f;
  border-top: 1px solid #262c44;
  border-bottom: 1px solid #262c44;
}
.mountain .feature { margin-top: 0; }
.mountain h2 { margin-top: 0.5rem; }
.mountain h2::after {
  background: linear-gradient(90deg, #44527a 0 33.3%, #7f93bd 33.3% 66.6%, #c9d6ea 66.6% 100%);
}
.mountain .shot video { border-color: #1c2134; box-shadow: 0 0 0 1px #262c44; }
.mountain blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 4px solid #44527a;
  color: #c9d6ea;
  font-style: italic;
}
.mountain blockquote p { margin: 0; }

.rumbles { overflow: hidden; }
.rumbles video { animation: rumble 11s linear infinite; }
@keyframes rumble {
  0%, 80%, 100% { transform: translate(0, 0); }
  81% { transform: translate(-2px, 1px); }
  82% { transform: translate(2px, -1px); }
  83% { transform: translate(-1px, -2px); }
  84% { transform: translate(2px, 1px); }
  85% { transform: translate(-2px, 0); }
  86% { transform: translate(1px, -1px); }
  87% { transform: translate(-1px, 1px); }
  88% { transform: translate(1px, 0); }
  89% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .rumbles video { animation: none; }
}

.cta-row.centre { justify-content: center; margin: 2.5rem 0 0; }

.small { font-size: 0.95rem; color: var(--text-soft); }

/* The feedback form */

.feedback { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.5rem; }
.feedback label { color: var(--text-bright); font-size: 1rem; }
.feedback .optional { color: var(--text-soft); font-size: 0.9rem; }
.feedback textarea,
.feedback input[type="text"],
.feedback input[type="email"] {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--ink);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  font-size: 1.05rem;
}
.feedback textarea { min-height: 9rem; resize: vertical; }
.feedback textarea:focus,
.feedback input:focus { outline: 3px solid var(--gold-light); outline-offset: 1px; border-color: var(--gold-dark); }
.fb-row { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 40rem) { .fb-row { grid-template-columns: 1fr 1fr; } }
.fb-row > div { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.35rem; }      /* (the inputs in line, whatever their labels) */
.fb-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-send { margin: 0.25rem 0 0.75rem; }
.feedback button.cta { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.feedback button.cta:disabled { opacity: 0.6; cursor: wait; }
.fb-state { color: var(--text-soft); }
.fb-state.done { color: var(--gold-light); }
.fb-state.failed { color: #e2807a; }

.faq h3 { margin-top: 1.75rem; }
.faq h3:first-child { margin-top: 0.75rem; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }

/* 404 */

.notfound {
  min-height: 60vh;
  padding: 4rem 0;
}
.notfound h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem); }

/* the privacy policy: a plain page of text */
.privacy h1 { margin-bottom: 1.2rem; }
.privacy h2 { margin-top: 2.2rem; }
.privacy ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.privacy li { margin: 0 0 0.45rem; }
.privacy code { font-size: 0.92em; }
