/* Hearthhold: playhearthhold.com
   One loud thing: the game's own gold title lettering. Everything else stays quiet.
   The page runs like a day in the game: golden sky, the stone wall, daylight on the battlefield,
   the royal-blue banners of the heroes, Morrath's dusk with one warm hearth, then gold again. */

@font-face {
  font-family: "Citadel Display";
  src: url("/assets/fonts/citadel-display.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sky-1: #ffe9b8;
  --sky-2: #f7c477;
  --sky-3: #ec9a55;
  --royal: #24468f;
  --royal-deep: #172d63;
  --ink: #1c2547;
  --ink-soft: #3d4772;
  --gold-1: #ffe38a;
  --gold-2: #e8a82e;
  --contour: #2b1708;
  --stone: #e2c288;
  --stone-shade: #c9a263;
  --mortar: #a07a45;
  --day: #e9f1fb;
  --day-line: #cfdcee;
  --dusk-1: #19152f;
  --dusk-2: #33205a;
  --ember: #ffb35c;
  --cream: #fff6e4;

  --display: "Citadel Display", "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --max: 72rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--royal-deep);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--day);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 500;
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

picture {
  display: block;
}

a {
  color: var(--royal);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--royal-deep);
}

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

p {
  margin: 0 0 1em;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

ul[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--royal);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
}

.skip:focus {
  top: 10px;
}

/* ---------- The title lettering (from the game: gold fill FFE38A -> E8A82E, brown contour, soft shadow) ---------- */

.title {
  position: relative;
  z-index: 0;
  isolation: isolate;
  font-family: var(--display);
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: transparent; /* the real text keeps layout, selection and screen readers; the two layers below paint it */
  text-wrap: balance;
}

.title::before,
.title::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  padding: inherit;
  pointer-events: none;
}

/* Contour and shadow. */
.title::before {
  z-index: -1;
  color: var(--contour);
  -webkit-text-stroke: 0.13em var(--contour);
  text-shadow: 0 0.08em 0.1em rgba(43, 23, 8, 0.45);
}

/* Gold fill. */
.title::after {
  z-index: 1;
  color: var(--gold-2);
  background: linear-gradient(180deg, var(--gold-1) 22%, var(--gold-2) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (forced-colors: active) {
  .title {
    color: CanvasText;
  }

  .title::before,
  .title::after {
    display: none;
  }
}

.title--hero {
  font-size: clamp(3.1rem, 14vw, 6.75rem);
  padding: 0.08em 0.07em 0.12em;
  margin: 0 -0.07em;
}

.title--section {
  font-size: clamp(2.25rem, 8.5vw, 3.75rem);
  padding: 0.06em 0.06em 0.1em;
  margin: 0 -0.06em 0.3em;
}

@media (prefers-reduced-motion: no-preference) {
  .title--hero {
    animation: stamp 0.7s cubic-bezier(0.2, 1.5, 0.45, 1) both;
    transform-origin: 30% 60%;
  }
}

@keyframes stamp {
  from {
    transform: scale(1.12) translateY(-0.12em);
  }
  to {
    transform: none;
  }
}

/* ---------- Top bar (over the sky) ---------- */

.bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--royal-deep);
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  width: auto;
  height: 38px;
  filter: drop-shadow(0 2px 2px rgba(43, 23, 8, 0.25));
}

.lang a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid rgba(23, 45, 99, 0.18);
  color: var(--royal-deep);
  font-weight: 800;
  text-decoration: none;
}

.lang a:hover {
  background: rgba(255, 255, 255, 0.85);
}

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

.hero {
  position: relative;
  padding: 88px 0 0;
  background-color: var(--sky-2);
  background-image:
    linear-gradient(180deg, rgba(255, 233, 184, 0.35), rgba(247, 196, 119, 0) 45%),
    image-set(url("/assets/img/bg-sky-864.avif") type("image/avif"), url("/assets/img/bg-sky-864.webp") type("image/webp"));
  background-size: cover;
  background-position: center 30%;
}

/* Browsers without image-set type(): the JPG. */
@supports not (background-image: image-set(url("x.avif") type("image/avif"))) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(255, 233, 184, 0.35), rgba(247, 196, 119, 0) 45%),
      url("/assets/img/bg-sky-864.jpg");
  }
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: 8px;
}

.hero-copy {
  max-width: 34rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.45;
  font-weight: 700;
  color: var(--ink);
  margin: 0.55em 0 1.1em;
  max-width: 31rem;
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.appstore {
  display: inline-block;
  border-radius: 12px;
  line-height: 0;
}

.appstore img {
  height: 54px;
  width: auto;
}

.soon {
  margin: 0;
  font-weight: 800;
  font-size: 0.9375rem;
}

.soon a {
  color: var(--ink-soft);
}

/* The stage: the Knight leaning in beside a phone playing the game, standing on the wall. */
.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, 58%);
  align-items: end;
  margin-top: 4px;
  z-index: 1;
}

.stage-knight {
  grid-column: 1 / 3;
  grid-row: 1;
  width: 50%;
  align-self: end;
  margin-bottom: 30px;
  margin-right: -14%;
  justify-self: start;
  z-index: 1;
}

.stage-knight img {
  width: 100%;
  height: auto;
}

.phone {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 2;
  justify-self: end;
  width: 100%;
  max-width: 300px;
  margin-bottom: 22px;
  padding: 7px;
  border-radius: 34px;
  background: linear-gradient(160deg, #2f4f9a, var(--royal-deep));
  box-shadow:
    0 0 0 2px var(--gold-2),
    0 22px 40px -14px rgba(23, 45, 99, 0.6);
}

.phone-screen {
  width: 100%;
  height: auto;
  aspect-ratio: 432 / 936;
  object-fit: cover;
  border-radius: 27px;
  background: #b98e55;
}

.vid-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 45, 99, 0.78);
  color: #fff;
  cursor: pointer;
}

.vid-toggle svg {
  fill: currentColor;
}

.vid-toggle .i-play,
.vid-toggle.is-paused .i-pause {
  display: none;
}

.vid-toggle.is-paused .i-play {
  display: block;
}

.vid-toggle:focus-visible {
  outline-color: #fff;
}

/* The wall: the thing you defend, used once, between the sky and the battlefield. */
.wall {
  position: relative;
  height: 58px;
  margin-top: -58px;
  background:
    linear-gradient(90deg, var(--stone) 0 58%, transparent 58%) 0 0 / 64px 18px repeat-x,
    linear-gradient(180deg, transparent 18px, var(--stone-shade) 18px 22px, transparent 22px),
    repeating-linear-gradient(180deg, transparent 0 34px, var(--mortar) 34px 36px) 0 0 / 100% 58px no-repeat,
    linear-gradient(180deg, transparent 18px, var(--stone) 18px) 0 0 / 100% 58px no-repeat;
}

.wall::after {
  content: "";
  position: absolute;
  inset: 36px 0 0;
  background: repeating-linear-gradient(90deg, transparent 0 62px, var(--mortar) 62px 64px);
  opacity: 0.55;
}

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

.features,
.heroes,
.shots,
.story,
.cta {
  padding: 64px 0 72px;
}

.section-intro {
  font-size: 1.1875rem;
  max-width: 36rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Features */
.features {
  background: var(--day);
  padding-top: 56px;
}

.feature-list {
  display: grid;
  gap: 48px;
  margin-top: 36px;
}

.feature {
  display: grid;
  gap: 20px;
  align-items: center;
}

.feature-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 20px;
  border: 4px solid #fff8ea;
  box-shadow:
    0 0 0 2px var(--gold-2),
    0 16px 30px -18px rgba(28, 37, 71, 0.55);
  background: var(--day-line);
}

.feature-text h3 {
  font-family: var(--display);
  font-size: clamp(1.625rem, 6vw, 2.25rem);
  line-height: 1.08;
  color: var(--royal);
  margin-bottom: 0.4em;
  text-wrap: balance;
}

.feature-text p {
  max-width: 34rem;
  margin: 0;
}

@media (min-width: 40rem) {
  .feature {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 40px;
  }

  .feature--flip .feature-media {
    order: 2;
  }

  .feature-media img {
    aspect-ratio: 4 / 5;
    object-position: center;
  }

  .feature--flip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  }

  .feature-text p {
    font-size: 1.125rem;
  }
}

@media (min-width: 60rem) {
  .feature {
    gap: 64px;
  }

  .feature-list {
    gap: 56px;
  }

  .feature {
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  }

  .feature--flip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  }

  .feature-text p {
    font-size: 1.1875rem;
  }
}

/* Horizontal strips (heroes, screenshots): scroll on phones, laid out on wide screens. */
.strip {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 8px var(--gutter) 20px;
  scrollbar-width: thin;
}

.strip:focus-visible {
  outline-offset: -3px;
}

/* Heroes */
.heroes {
  position: relative;
  color: var(--cream);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(80, 130, 220, 0.45), transparent 60%),
    linear-gradient(180deg, var(--royal), var(--royal-deep));
}

.heroes .section-intro {
  color: rgba(255, 246, 228, 0.88);
}

.heroes :focus-visible,
.story :focus-visible,
.foot :focus-visible {
  outline-color: var(--cream);
}

.roster {
  display: flex;
  gap: 14px;
  width: max-content;
  margin-top: 12px;
}

.hero-card {
  scroll-snap-align: start;
  width: 228px;
  display: grid;
  grid-template-rows: 272px auto;
}

.hero-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 6px;
  position: relative;
  z-index: 1;
}

.hero-art img {
  width: 100%;
  height: 272px;
  object-fit: contain;
  object-position: center bottom;
}

.plaque {
  margin-top: -18px;
  padding: 24px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 2px solid rgba(232, 168, 46, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-name {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.05;
  color: var(--gold-1);
}

.hero-title {
  margin: 2px 0 10px;
  font-weight: 800;
  color: var(--ember);
}

.hero-role {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.45;
}

.hero-power {
  margin: 0;
  font-size: 0.9375rem;
  color: rgba(255, 246, 228, 0.82);
}

.hero-power strong {
  color: var(--cream);
  font-weight: 800;
}

@media (min-width: 75rem) {
  .heroes .strip {
    overflow: visible;
    max-width: var(--max);
    margin: 0 auto;
  }

  .roster {
    width: auto;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
  }

  .hero-card {
    width: auto;
    grid-template-rows: 250px auto;
  }

  .hero-art img {
    height: 250px;
  }

  .plaque {
    padding: 22px 12px 14px;
  }

  .hero-name {
    font-size: 1.5rem;
  }

  .hero-role,
  .hero-power {
    font-size: 0.9375rem;
  }
}

/* Screenshots */
.shots {
  background: var(--day);
}

.shot-list {
  display: flex;
  gap: 14px;
  width: max-content;
}

.shot {
  scroll-snap-align: start;
  width: min(52vw, 220px);
}

.shot img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow:
    0 0 0 2px var(--gold-2),
    0 14px 26px -16px rgba(28, 37, 71, 0.6);
  background: var(--day-line);
}

/* Wide screens: the strip starts at the text edge and runs off the right side of the window. */
@media (min-width: 75rem) {
  .shots .strip {
    padding-left: calc((100vw - var(--max)) / 2 + var(--gutter));
    scroll-padding-inline: calc((100vw - var(--max)) / 2 + var(--gutter));
  }

  .shot {
    width: 250px;
  }
}

/* Story: Morrath's dusk, and the one fire left. */
.story {
  position: relative;
  overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(70% 55% at 50% 108%, rgba(255, 150, 60, 0.55), rgba(255, 120, 40, 0.12) 55%, transparent 75%),
    radial-gradient(60% 50% at 85% 0%, rgba(154, 107, 255, 0.28), transparent 70%),
    linear-gradient(180deg, var(--dusk-1), var(--dusk-2));
  padding-bottom: 96px;
}

.story-inner {
  max-width: 44rem;
}

.story-quote {
  margin: 8px 0 0;
}

.story-quote blockquote {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.65;
}

.story-quote blockquote p {
  max-width: 36rem;
}

.story-big {
  font-family: var(--display);
  font-size: clamp(1.75rem, 6.5vw, 2.75rem);
  line-height: 1.12;
  color: var(--ember);
  margin: 1.1em 0 0.9em;
  text-wrap: balance;
  text-shadow: 0 0 28px rgba(255, 140, 50, 0.45);
}

.story-quote figcaption {
  font-size: 0.9375rem;
  color: rgba(255, 246, 228, 0.7);
}

/* Final call: the gate under the same golden sky. */
.cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2) 70%, var(--sky-3));
  padding-bottom: 0;
}

.cta-inner {
  position: relative;
  z-index: 1;
  padding-bottom: 28px;
}

.cta-inner > p {
  font-size: 1.1875rem;
  font-weight: 700;
  max-width: 32rem;
}

.appstore--cta {
  margin: 4px 0 28px;
}

.android {
  max-width: 30rem;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(23, 45, 99, 0.16);
  scroll-margin-top: 24px;
}

.android:target {
  border-color: var(--royal);
  background: rgba(255, 255, 255, 0.78);
}

.android h3,
.social h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--royal);
  margin-bottom: 4px;
}

.android p {
  margin: 0;
}

.social {
  margin-top: 28px;
}

.social ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--royal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.social a:hover {
  background: var(--royal-deep);
  color: #fff;
}

.social svg {
  fill: currentColor;
}

.cta-gate {
  position: relative;
  margin: 0 auto;
  max-width: 560px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%);
  mask-image: linear-gradient(180deg, transparent, #000 40%);
}

.cta-gate img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
}

@media (min-width: 60rem) {
  .cta {
    padding-bottom: 72px;
  }

  .cta-gate {
    top: 0;
  }

  .cta-gate img {
    aspect-ratio: auto;
    height: 100%;
    object-position: center 15%;
  }

  .cta-inner {
    padding-bottom: 0;
    min-height: 420px;
  }

  /* The copy keeps a readable column on any width; the gate sits beside it, not over it. */
  .cta-inner > * {
    max-width: min(34rem, 50vw);
  }

  .cta-gate {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(50%, 760px);
    max-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%), linear-gradient(180deg, transparent, #000 25%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 25%), linear-gradient(180deg, transparent, #000 25%);
    mask-composite: intersect;
  }
}

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

.foot {
  background: var(--royal-deep);
  color: rgba(255, 246, 228, 0.86);
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  font-size: 0.9375rem;
}

.foot a {
  color: var(--cream);
}

.foot a:hover {
  color: #fff;
}

.brand--foot {
  color: var(--gold-1);
  margin-bottom: 18px;
}

.foot-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-bottom: 22px;
}

.foot-nav li {
  padding: 4px 0;
  font-size: 1rem;
}

.fine {
  max-width: 48rem;
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: rgba(255, 246, 228, 0.72);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 28px;
  }

  .features,
  .heroes,
  .shots,
  .story,
  .cta {
    padding-top: 88px;
    padding-bottom: 96px;
  }

  .cta {
    padding-bottom: 0;
  }

  .hero-stage {
    grid-template-columns: 1fr 300px;
    max-width: 560px;
  }
}

@media (min-width: 60rem) {
  .hero {
    padding-top: 112px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
  }

  .hero-copy {
    padding-bottom: 96px;
  }

  .lede {
    font-size: 1.375rem;
  }

  .cta {
    padding-bottom: 96px;
  }

  .hero-stage {
    justify-self: end;
    width: 100%;
    max-width: 520px;
    grid-template-columns: 1fr 290px;
  }

  .stage-knight {
    width: 62%;
    margin-right: -22%;
    margin-bottom: 44px;
  }

  .brand {
    font-size: 1.75rem;
  }

  .brand img {
    height: 46px;
  }
}

/* ---------- 404 ---------- */

.page-404 {
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nf {
  flex: 1;
  padding: 128px 0 64px;
}

.nf-inner p {
  font-size: 1.1875rem;
  font-weight: 700;
}
