/* Pirate Cove theme, used by its product page and its homepage section.
   From the game (Games/piratecove): the painted UI kit (wood panel, parchment, plaque, scroll,
   badge and teal button as 9-slice images with the borders from Art/UI/ui_kit.json), the
   palette sampled from its concept art (lagoon #18B1F8, deck #75553B, hull navy #1F365F),
   the Jolly Roger and Pirata One. */

@font-face {
  font-family: "Pirata One";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/pirata-one-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Pirata One";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/pirata-one-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.pv-hero,
.pv-section,
.pv-band {
  --pv-sea: #18b1f8;
  --pv-sea-light: #5fd0ff;
  --pv-sea-deep: #0b7fc4;
  --pv-deck: #75553b;
  --pv-deck-dark: #4a3423;
  --pv-navy: #1f365f;
  --pv-gold: #e8b04a;
  --pv-parchment: #f1dcb0;
  --pv-ink: #3b2414;
  --pv-cream: #fff3d6;
  --pv-display: "Pirata One", "Archivo", serif;
  position: relative;
  isolation: isolate;
  color: var(--pv-cream);
  font-family: var(--font);
  font-weight: 600;
}

body.theme-piratecove {
  background: var(--pv-parchment, #f1dcb0);
}

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

.pv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shared parts */
.pv-tagline {
  margin-top: 12px;
  color: var(--pv-cream);
  font-family: var(--pv-display);
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 400;
  line-height: 1.05;
  -webkit-text-stroke: 6px var(--pv-deck-dark);
  paint-order: stroke fill;
}

.pv-lead {
  margin-top: 14px;
  max-width: 44ch;
  color: #fff;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  text-shadow: 0 2px 0 rgba(11, 60, 100, 0.55);
}

/* "Coming soon" on the game's teal button, but not a link. */
.pv-actions .soon-store,
.pv-home .soon-store {
  min-height: 64px;
  padding: 4px 26px 6px;
  border: 26px solid transparent;
  border-width: 22px 34px;
  border-image: url(/images/piratecove/button-teal.webp) 51 73 fill / 22px 34px / 0 stretch;
  background: none;
  color: #fff;
  text-align: center;
}

.pv-actions .soon-store .label,
.pv-home .soon-store .label {
  color: #d9fbff;
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pv-actions .soon-store strong,
.pv-home .soon-store strong {
  font-family: var(--pv-display);
  font-size: 26px;
  font-weight: 400;
  -webkit-text-stroke: 4px #0c5b5c;
  paint-order: stroke fill;
}

.pv-actions,
.pv-home .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 26px;
}

.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 18px;
  border-style: solid;
  border-color: transparent;
  border-width: 18px 50px;
  border-image: url(/images/piratecove/plaque.webp) 40 113 fill / 18px 50px / 0 stretch;
  color: var(--pv-gold);
  font-family: var(--pv-display);
  font-size: 22px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.pv-btn svg {
  width: 18px;
  height: 18px;
}

.pv-btn:hover,
.pv-btn:focus-visible {
  transform: translateY(-3px);
  outline: none;
}

/* Wood frame with brass corners, from UI_WoodPanel. */
.pv-cove {
  margin: 0;
  border: 30px solid transparent;
  border-image: url(/images/piratecove/woodpanel.webp) 64 fill / 30px / 0 stretch;
  filter: drop-shadow(0 18px 24px rgba(11, 60, 100, 0.45));
}

.pv-cove img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

/* Sea and flag */
.pv-waves {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120px 18px at 50% 0, rgba(255, 255, 255, 0.35), transparent 70%) 0 0 / 220px 90px,
    radial-gradient(90px 14px at 50% 0, rgba(255, 255, 255, 0.22), transparent 70%) 110px 45px / 220px 90px,
    linear-gradient(180deg, var(--pv-sea-light) 0%, var(--pv-sea) 45%, var(--pv-sea-deep) 100%);
}

.pv-flag {
  position: absolute;
  top: 18px;
  right: clamp(12px, 4vw, 56px);
  z-index: 1;
  width: clamp(110px, 12vw, 180px);
  height: auto;
  border: 4px solid var(--pv-deck-dark);
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(11, 60, 100, 0.4);
  transform-origin: left center;
}

/* Hero */
.pv-hero {
  overflow: hidden;
  padding: 28px 0 clamp(72px, 9vw, 120px);
}

.pv-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--pv-cream);
  font-size: 15px;
  text-shadow: 0 1px 0 rgba(11, 60, 100, 0.6);
}

.pv-crumbs a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pv-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}

.pv-logo {
  margin-top: clamp(16px, 3vw, 36px);
}

.pv-logo img,
.pv-home-logo img {
  width: clamp(240px, 30vw, 460px);
  height: auto;
  filter: drop-shadow(0 8px 0 rgba(74, 52, 35, 0.35));
}

/* Sections */
.pv-section {
  overflow-x: clip;
  padding: clamp(64px, 9vw, 120px) 0;
}

.pv-section--deck {
  background:
    linear-gradient(rgba(74, 52, 35, 0.62), rgba(74, 52, 35, 0.62)),
    url(/images/piratecove/planks.webp) 0 0 / 360px repeat;
}

.pv-section--sea {
  background: linear-gradient(180deg, var(--pv-sea) 0%, var(--pv-sea-deep) 100%);
}

.pv-section--parchment {
  background: var(--pv-parchment);
  color: var(--pv-ink);
}

.pv-section--parchment + .pv-section--parchment {
  padding-top: 0;
}

/* Section titles on the brass-tipped plaque. */
.pv-head {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.pv-head h2 span {
  display: inline-block;
  padding: 0 10px;
  border-style: solid;
  border-color: transparent;
  border-width: 20px 56px;
  border-image: url(/images/piratecove/plaque.webp) 40 113 fill / 20px 56px / 0 stretch;
  color: var(--pv-gold);
  font-family: var(--pv-display);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.05;
}

.pv-note {
  max-width: 58ch;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
}

.pv-section--deck .pv-note,
.pv-section--sea .pv-note {
  color: var(--pv-cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* The galley chain on parchment cards, joined by rope. */
.pv-chain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  border: 0;
}

.pv-chain li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 18px 16px;
  border: 28px solid transparent;
  border-image: url(/images/piratecove/parchment.webp) 56 fill / 28px / 0 stretch;
  color: var(--pv-ink);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.35;
  text-align: center;
}

.pv-chain li::before {
  content: none;
}

.pv-chain li + li::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 28px);
  width: clamp(20px, 3vw, 44px);
  border-top: 5px dashed #c79a5a;
}

.pv-chain img {
  width: 96px;
  height: auto;
}

.pv-chain strong {
  font-family: var(--pv-display);
  font-size: 30px;
  font-weight: 400;
  color: var(--pv-deck-dark);
}

/* Crew upgrades on scrolls, like the game's upgrade window. */
.pv-upgrades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 260px));
  gap: clamp(16px, 2vw, 28px);
}

.pv-upgrades li {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 4px 12px;
  border-style: solid;
  border-color: transparent;
  border-width: 44px 22px;
  border-image: url(/images/piratecove/scroll.webp) 96 48 fill / 44px 22px / 0 stretch;
  color: var(--pv-ink);
  text-align: center;
}

.pv-upgrade-name {
  font-family: var(--pv-display);
  font-size: 30px;
  color: var(--pv-deck-dark);
}

.pv-upgrades img {
  width: 96px;
  height: auto;
}

.pv-upgrade-note {
  font-size: 16px;
}

/* Sea chart */
.pv-chart {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}

.pv-chart-map {
  margin: 0;
  border: 26px solid transparent;
  border-image: url(/images/piratecove/woodpanel.webp) 64 fill / 26px / 0 stretch;
}

.pv-chart-map img {
  display: block;
  width: 100%;
}

.pv-coves {
  display: grid;
  gap: 14px;
}

.pv-coves li {
  display: grid;
  grid-template-columns: 92px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  padding: 4px 10px;
  border: 24px solid transparent;
  border-image: url(/images/piratecove/parchment.webp) 56 fill / 24px / 0 stretch;
  color: var(--pv-ink);
}

.pv-coves img {
  grid-row: span 2;
  width: 92px;
  height: auto;
}

.pv-coves strong {
  align-self: end;
  font-family: var(--pv-display);
  font-size: 30px;
  font-weight: 400;
  color: var(--pv-deck-dark);
}

.pv-coves span {
  align-self: start;
  font-size: 16px;
}

.pv-coves .is-here {
  outline: 4px solid var(--pv-gold);
  outline-offset: 2px;
}

/* Phones in wood frames */
.pv-phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 290px));
  justify-content: center;
  gap: clamp(16px, 3vw, 44px);
}

.pv-phones a {
  display: block;
  border: 20px solid transparent;
  border-image: url(/images/piratecove/woodpanel.webp) 64 fill / 20px / 0 stretch;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}

.pv-phones img {
  display: block;
  width: 100%;
}

.pv-phones a:hover {
  transform: translateY(-8px) rotate(-1.5deg);
}

.pv-phones figcaption {
  margin-top: 14px;
  color: var(--pv-cream);
  font-size: 16px;
  text-align: center;
}

/* Support and related on parchment */
.pv-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(28px, 5vw, 80px);
  align-items: start;
}

.pv-section .link-list {
  border-top: 3px solid var(--pv-deck);
}

.pv-section .link-list a,
.pv-section .link-list-note {
  border-bottom: 3px solid rgba(117, 85, 59, 0.35);
}

.pv-section .link-list strong {
  font-family: var(--pv-display);
  font-size: 26px;
  font-weight: 400;
}

.pv-section .link-list span {
  color: #6b4a2e;
}

.pv-section .link-list a:hover {
  background: var(--pv-deck);
  color: var(--pv-cream);
}

.pv-section .link-list a:hover span {
  color: inherit;
}

.pv-more .rows {
  border-top: 3px solid var(--pv-deck);
}

.pv-more .row {
  border-bottom-color: rgba(117, 85, 59, 0.35);
}

.pv-more .row:hover,
.pv-more .row:focus-visible {
  background: var(--pv-deck);
  color: var(--pv-cream);
}

/* Homepage section */
.pv-band {
  overflow: hidden;
  margin-top: 0;
  padding: clamp(64px, 8vw, 112px) 0 clamp(64px, 8vw, 112px);
}

.pv-band .bar {
  font-family: var(--font);
}

/* On the homepage the flag flies below the section bar, clear of its link. */
.pv-band .pv-flag {
  top: calc(clamp(64px, 8vw, 112px) + 64px);
}

.pv-band .bar .label,
.pv-band .text-link {
  color: #fff;
}

.pv-band .text-link:hover {
  color: var(--pv-gold);
}

.pv-home {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  margin-top: clamp(28px, 4vw, 48px);
}

.pv-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pv-facts li {
  padding: 0 6px;
  border-style: solid;
  border-color: transparent;
  border-width: 14px 20px;
  border-image: url(/images/piratecove/badge.webp) 38 41 fill / 14px 20px / 0 stretch;
  color: var(--pv-cream);
  font-size: 15px;
  line-height: 1.2;
}

.pv-small {
  display: inline-block;
  margin-top: 18px;
  color: #fff;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pv-small:hover {
  color: var(--pv-gold);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .pv-waves {
    animation: pv-swell 14s linear infinite;
  }

  .pv-flag {
    animation: pv-flap 2.6s ease-in-out infinite;
  }

  .pv-cove {
    animation: pv-bob 6s ease-in-out infinite;
  }

  .pv-hero .pv-logo img {
    animation: pv-drop 0.9s 0.1s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  }

  .pv-hero .pv-tagline,
  .pv-hero .pv-lead,
  .pv-hero .pv-actions {
    animation: pv-rise 0.7s cubic-bezier(0.25, 1.2, 0.4, 1) both;
  }

  .pv-hero .pv-tagline { animation-delay: 0.45s; }
  .pv-hero .pv-lead { animation-delay: 0.55s; }
  .pv-hero .pv-actions { animation-delay: 0.65s; }

  .pv-coves .is-here img {
    animation: pv-bob 3s ease-in-out infinite;
  }
}

@keyframes pv-swell {
  to { background-position: 220px 0, 330px 45px, 0 0; }
}

@keyframes pv-flap {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50% { transform: skewY(-4deg) scaleX(0.96); }
}

@keyframes pv-bob {
  50% { transform: translateY(-10px) rotate(-0.8deg); }
}

@keyframes pv-drop {
  from { transform: translateY(-80px) rotate(-8deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes pv-rise {
  from { transform: translateY(26px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .pv-head h2,
    .pv-chain li,
    .pv-upgrades li,
    .pv-coves li,
    .pv-phones figure,
    .pv-band .pv-home-copy > * {
      animation: pv-rise linear both;
      animation-timeline: view();
      animation-range: entry calc(var(--i, 0) * 6%) entry 100%;
    }
  }
}

/* Layout */
@media (max-width: 1024px) {
  .pv-hero-grid,
  .pv-home,
  .pv-split,
  .pv-chart {
    grid-template-columns: 1fr;
  }

  .pv-chart-map {
    max-width: 360px;
  }
}

@media (max-width: 720px) {
  .pv-chain,
  .pv-upgrades {
    grid-template-columns: 1fr;
  }

  .pv-chain li + li::after {
    content: none;
  }

  .pv-phones {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .pv-phones a {
    border-width: 10px;
  }

  .pv-phones figcaption {
    font-size: 13px;
  }

  .pv-flag {
    width: 90px;
  }

  .pv-coves li {
    grid-template-columns: 64px 1fr;
  }

  .pv-coves img {
    width: 64px;
  }
}
