/* Corsair Clash — game page. Art direction of the game: sunny sea, wood and gold, rounded display type outlined in brown. */

:root {
  --sea-deep: #062a4f;
  --sea: #0b4f8a;
  --sea-light: #1b8fd0;
  --foam: #e9f7ff;
  --gold: #ffc53d;
  --gold-deep: #e08a12;
  --wood: #6b3a17;
  --wood-dark: #2a1a0c;
  --parchment: #f6e4b7;
  --green: #5ed12c;
  --green-deep: #2f8f12;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
  background: var(--sea-deep);
}

body {
  margin: 0;
  background: var(--sea-deep);
  color: var(--foam);
  font-family: var(--text);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

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

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -5rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--gold);
  color: var(--wood-dark);
}

.skip:focus {
  top: 0.75rem;
}

/* ── Display type: white outlined in brown, keywords in gold ── */

.title {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 0.17em var(--wood-dark);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--wood-dark);
  text-wrap: balance;
}

.title b {
  font-weight: 400;
  color: var(--gold);
}

.title--xl {
  font-size: clamp(2.4rem, 7vw, 6rem);
}

.title--l {
  font-size: clamp(2.1rem, 5.2vw, 4.25rem);
}

.title--m {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

.lede {
  max-width: 36rem;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  color: var(--foam);
}

/* ── Buttons: thick, bouncy, like the game's ─────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 3.75rem;
  padding: 0 1.8rem;
  border: 3px solid var(--wood-dark);
  border-radius: 1.1rem;
  background: linear-gradient(#8bea4b, var(--green) 45%, var(--green-deep));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 6px 0 var(--wood-dark), 0 14px 24px rgba(0, 0, 0, 0.35);
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  -webkit-text-stroke: 4px var(--wood-dark);
  paint-order: stroke fill;
  cursor: pointer;
  transition: transform 0.25s var(--bounce), filter 0.25s;
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(4px) scale(0.98);
}

.btn--gold {
  background: linear-gradient(#ffe27a, var(--gold) 45%, var(--gold-deep));
}

.btn--small {
  min-height: 2.9rem;
  padding: 0 1.1rem;
  border-radius: 0.85rem;
  font-size: 1rem;
  -webkit-text-stroke-width: 3px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 4px 0 var(--wood-dark);
}

.btn svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}

/* ── Top bar ─────────────────────────────────────────────── */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: linear-gradient(rgba(6, 42, 79, 0.85), rgba(6, 42, 79, 0));
}

.bar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.25rem;
}

.bar__logo img {
  width: 5.5rem;
}

.bar nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bar nav a:not(.btn) {
  padding: 0.75rem 0;
  text-decoration: none;
  text-shadow: 0 2px 0 var(--wood-dark);
  transition: color 0.2s;
}

.bar nav a:not(.btn):hover {
  color: var(--gold);
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100svh;
  padding-block: 6rem clamp(5rem, 10vw, 8rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: swell 22s ease-in-out infinite alternate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 55% at 50% 45%, rgba(6, 42, 79, 0.1), rgba(6, 42, 79, 0.55)),
    linear-gradient(transparent 55%, var(--sea-deep));
}

.hero__in {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  text-align: center;
}

.hero__logo {
  width: min(34rem, 78vw);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.5));
  animation: bob 5s ease-in-out infinite;
}

.hero .lede {
  text-shadow: 0 2px 8px rgba(6, 42, 79, 0.9);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero__captain {
  position: absolute;
  bottom: 0;
  z-index: -1;
  width: clamp(11rem, 20vw, 19rem);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}

.hero__captain--left {
  left: max(1rem, calc(50% - 46rem));
}

.hero__captain--right {
  right: max(1rem, calc(50% - 46rem));
  transform: scaleX(-1);
}

@keyframes bob {
  50% {
    transform: translateY(-12px) rotate(-1deg);
  }
}

@keyframes swell {
  from {
    transform: scale(1.03);
  }
  to {
    transform: scale(1.12) translateY(-1.5%);
  }
}

/* ── Sections ────────────────────────────────────────────── */

.section {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

.section--sea {
  background: linear-gradient(var(--sea-deep), var(--sea) 55%, var(--sea-light));
}

.section--deep {
  background: var(--sea-deep);
}

.section__head {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

/* Trailer in a wooden frame */

.frame {
  position: relative;
  max-width: 64rem;
  margin-inline: auto;
  padding: clamp(0.6rem, 1.4vw, 1.1rem);
  border: 4px solid var(--wood-dark);
  border-radius: 1.75rem;
  background: linear-gradient(#a8662d, var(--wood));
  box-shadow: inset 0 4px 0 rgba(255, 220, 160, 0.35), 0 10px 0 var(--wood-dark), 0 30px 60px rgba(0, 0, 0, 0.45);
}

.frame video {
  width: 100%;
  aspect-ratio: 1920 / 886;
  border: 3px solid var(--wood-dark);
  border-radius: 1rem;
  background: #000;
  object-fit: cover;
}

.frame__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
}

.frame__play span {
  display: grid;
  place-items: center;
  width: clamp(4.5rem, 9vw, 7rem);
  aspect-ratio: 1;
  border: 4px solid var(--wood-dark);
  border-radius: 50%;
  background: linear-gradient(#ffe27a, var(--gold) 45%, var(--gold-deep));
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.5), 0 8px 0 var(--wood-dark), 0 0 0 0 rgba(255, 197, 61, 0.6);
  color: var(--wood-dark);
  animation: pulse 2.2s ease-out infinite;
  transition: transform 0.3s var(--bounce);
}

.frame__play:hover span {
  transform: scale(1.1);
}

.frame__play svg {
  width: 40%;
  margin-left: 8%;
}

.frame.is-playing .frame__play {
  display: none;
}

@keyframes pulse {
  to {
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.5), 0 8px 0 var(--wood-dark), 0 0 0 2.2rem rgba(255, 197, 61, 0);
  }
}

/* How to play: text + screenshot, alternating */

.steps {
  display: grid;
  gap: clamp(3.5rem, 8vw, 7rem);
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.step:nth-child(even) .step__text {
  order: 2;
}

.step__n {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  aspect-ratio: 1;
  margin-bottom: 1.25rem;
  border: 3px solid var(--wood-dark);
  border-radius: 50%;
  background: linear-gradient(#ffe27a, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 4px 0 var(--wood-dark);
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--wood-dark);
}

.step__text p {
  max-width: 30rem;
  margin-top: 1.25rem;
}

.shot {
  justify-self: center;
  width: min(21rem, 78vw);
  border: 4px solid var(--wood-dark);
  border-radius: 2rem;
  box-shadow: 0 10px 0 var(--wood-dark), 0 30px 50px rgba(0, 0, 0, 0.45);
  transform: rotate(3deg);
  transition: transform 0.5s var(--bounce);
}

.step:nth-child(even) .shot {
  transform: rotate(-3deg);
}

.shot:hover,
.step:nth-child(even) .shot:hover {
  transform: rotate(0) scale(1.03);
}

/* Captains: endless parade */

.parade {
  position: relative;
  overflow: hidden;
  padding-block: 1rem 2rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.parade__track {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  width: max-content;
  animation: parade 46s linear infinite;
}

.parade:hover .parade__track {
  animation-play-state: paused;
}

.parade img {
  width: clamp(9rem, 16vw, 14rem);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.4s var(--bounce);
}

.parade img:hover {
  transform: translateY(-14px) scale(1.06);
}

@keyframes parade {
  to {
    transform: translateX(calc(-50% - clamp(0.5rem, 1.5vw, 1.25rem)));
  }
}

/* Monsters: full-bleed key art */

.monster {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(52rem, 100svh);
  padding-block: clamp(4rem, 8vw, 7rem);
  overflow: hidden;
  isolation: isolate;
}

.monster img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(6, 42, 79, 0.82), rgba(6, 42, 79, 0.35) 45%, transparent 70%),
    linear-gradient(var(--sea-deep), transparent 22%, transparent 45%, rgba(6, 42, 79, 0.92));
}

.monster__text {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
}

/* Adventure: parchment cards */

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 4px solid var(--wood-dark);
  border-radius: 1.75rem;
  background: linear-gradient(#fdf1cf, var(--parchment));
  box-shadow: 0 10px 0 var(--wood-dark), 0 28px 50px rgba(0, 0, 0, 0.4);
  color: var(--wood-dark);
}

.card h3 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: var(--wood);
}

.card p {
  margin-top: 0.9rem;
  font-size: 1.05rem;
}

.card img {
  border: 3px solid var(--wood-dark);
  border-radius: 1.25rem;
  box-shadow: 0 6px 0 var(--wood-dark);
}

/* Final call */

.final {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  text-align: center;
}

.final img {
  width: min(22rem, 64vw);
  animation: bob 5s ease-in-out infinite;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.5rem;
  border-top: 2px solid rgba(233, 247, 255, 0.15);
  font-size: 0.92rem;
  color: rgba(233, 247, 255, 0.7);
}

.foot nav {
  display: flex;
  gap: 1.5rem;
}

.foot a {
  padding-block: 0.7rem;
  text-decoration: none;
}

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

/* Scroll reveal, only applied by corsair.js */

.reveal {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--bounce);
}

.reveal-pending {
  opacity: 0;
  transform: translateY(2.5rem) scale(0.97);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero__captain {
    display: none;
  }

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

@media (max-width: 720px) {
  .bar nav a:not(.btn) {
    display: none;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .step:nth-child(even) .step__text {
    order: 0;
  }

  .step__text p {
    margin-inline: auto;
  }

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

  .card img {
    width: min(15rem, 70%);
    margin-inline: auto;
  }

  .cta .btn {
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal-pending {
    opacity: 1;
    transform: none;
  }
}
