/* Resofire Games — resofire.com. Colors from the Fetterdeep key art: the
   deep sea, the parchment of the game's panels, the sunset over the
   mountains, the studio's teal. */

@font-face {
  font-family: "Fira Sans";
  src: url("../fonts/FiraSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --sea-deep: #0b1720;
  --sea: #10222f;
  --sea-light: #1a3344;
  --line: #2a4456;
  --parchment: #ece4d4;
  --parchment-dim: #b9b1a2;
  --sunset: #e8b45a;
  --sunset-deep: #c98b34;
  --teal: #3fb8b0;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sea-deep);
  color: var(--parchment);
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.6;
}

a { color: var(--sunset); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* --- Header ------------------------------------------------------------ */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(6, 13, 19, 0.75), rgba(6, 13, 19, 0));
}
.site-header.solid { position: relative; background: var(--sea); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.studio {
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--parchment);
}
.studio { flex-shrink: 0; }
.studio img { height: 44px; width: auto; }
.studio:hover { text-decoration: none; }
.site-nav { display: flex; gap: 10px; }
.nav-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sea-light);
  color: var(--parchment);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.nav-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn svg .fill { fill: currentColor; stroke: none; }
.nav-btn:hover, .nav-btn:focus-visible {
  text-decoration: none;
  color: var(--sunset);
  border-color: var(--sunset);
  background: #213d50;
  transform: translateY(-1px);
}
/* The label, under the button, on hover. */
.nav-btn::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 6px 12px;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 20;
}
.nav-btn:hover::after, .nav-btn:focus-visible::after, .nav-btn.copied::after { opacity: 1; transform: translate(-50%, 0); }
/* The last button's label sits flush with its right edge, so it stays on screen. */
.nav-btn:last-child::after { left: auto; right: 0; transform: translate(0, -4px); }
.nav-btn:last-child:hover::after, .nav-btn:last-child:focus-visible::after, .nav-btn:last-child.copied::after { transform: translate(0, 0); }

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

.hero {
  position: relative;
  aspect-ratio: 3072 / 1518;  /* the whole painting, below where its logo was */
  background: url("../images/fetterdeep-hero.jpg") center top / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 23, 32, 0) 55%, rgba(11, 23, 32, 0.85) 85%, var(--sea-deep) 100%);
}
.hero-logo {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding-top: 40px;
}
.hero-logo img { width: 340px; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(8, 18, 30, 0.6)); }
.hero-text {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 48px;
}
.hero-text .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.hero-text p {
  margin: 0;
  max-width: 560px;
  font-size: 22px;
  line-height: 1.45;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.button {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 4px;
  font-size: 16px;
  letter-spacing: 0.05em;
  border: 1px solid var(--sunset);
  color: var(--sunset);
  background: rgba(11, 23, 32, 0.55);
}
.button:hover { background: rgba(232, 180, 90, 0.12); text-decoration: none; }
.button.primary { background: var(--sunset); color: #1b140a; }
.button.primary:hover { background: #f1c271; }
.button.soon { cursor: default; }

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

section { padding: 88px 0; }
section.alt { background: var(--sea); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

h2 {
  margin: 0 0 12px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
}
h3 { margin: 0 0 8px; font-weight: 500; font-size: 22px; color: var(--parchment); }
.lead { font-size: 26px; line-height: 1.4; max-width: 820px; margin: 0 0 40px; }
.dim { color: var(--parchment-dim); }

/* The chain under a heading: links drawn in CSS. */
.chain {
  height: 10px;
  width: 132px;
  margin: 0 0 32px;
  background:
    radial-gradient(ellipse 9px 4px at 9px 5px, transparent 55%, var(--parchment-dim) 60%, var(--parchment-dim) 80%, transparent 85%) 0 0 / 22px 10px repeat-x;
  opacity: 0.5;
}

/* Trailer */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000 url("../images/press/01_colony-large.webp") center / cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .soon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 13, 19, 0.55);
  font-size: 20px; letter-spacing: 0.12em; text-transform: uppercase;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 36px;
}
.feature p { margin: 0; color: var(--parchment-dim); font-size: 17px; }
.feature .mark {
  width: 36px; height: 3px; margin-bottom: 18px;
  background: var(--sunset);
}

/* Screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.shots a { display: block; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.25s; }
.shots a:hover img { transform: scale(1.02); }

/* Community */
.community {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.community p { margin: 0; max-width: 620px; color: var(--parchment-dim); }

/* --- Press kit ---------------------------------------------------------- */

.press { display: grid; grid-template-columns: 300px 1fr; gap: 56px; padding: 64px 0 96px; }
.facts { position: sticky; top: 24px; align-self: start; }
.facts dl { margin: 0; }
.facts dt { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); margin-top: 20px; }
.facts dd { margin: 4px 0 0; }
.press h2 { margin-top: 56px; }
.press h2:first-child { margin-top: 0; }
.press p, .press li { color: var(--parchment-dim); }
.press ul { padding-left: 20px; }
.downloads a { display: inline-block; margin: 8px 18px 0 0; }

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

footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--parchment-dim);
  font-size: 15px;
}
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
/* The footer's buttons are the top bar's; their labels show above them. */
.footer-nav .nav-btn::after { top: auto; bottom: calc(100% + 10px); transform: translate(-50%, 4px); }
.footer-nav .nav-btn:last-child::after { transform: translate(0, 4px); }
.footer-nav .nav-btn:hover::after, .footer-nav .nav-btn:focus-visible::after, .footer-nav .nav-btn.copied::after { transform: translate(-50%, 0); }
.footer-nav .nav-btn:last-child:hover::after, .footer-nav .nav-btn:last-child:focus-visible::after, .footer-nav .nav-btn:last-child.copied::after { transform: translate(0, 0); }

/* --- Narrow screens ------------------------------------------------------- */

@media (max-width: 860px) {
  body { font-size: 17px; }
  .studio img { height: 30px; }
  .site-header .wrap { height: 64px; }
  .hero-logo { padding-top: 24px; }
  .hero-logo img { width: 190px; }
  .nav-btn { width: 40px; height: 40px; }
  .nav-btn svg { width: 21px; height: 21px; }
  .hero { aspect-ratio: auto; min-height: 78vh; background-position: 35% top; }
  .hero-text p { font-size: 19px; }
  .lead { font-size: 21px; }
  .features { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .press { grid-template-columns: 1fr; }
  .facts { position: static; }
  section { padding: 64px 0; }
}

/* --- Press kit grids ------------------------------------------------------ */

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid3 a { display: block; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--sea); }
.grid3 img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.25s; }
.grid3 a:hover img { transform: scale(1.03); }
.grid3.art img { aspect-ratio: 3 / 2; object-position: center top; }
.grid3.logos a { background: #2b3b47; }
.grid3.logos img { object-fit: contain; padding: 18px; aspect-ratio: 4 / 3; }
.zip { display: inline-block; margin-top: 14px; }
.zip .size { color: var(--parchment-dim); font-size: 15px; }
.press main h2 + p { margin-top: 0; }

/* --- Lightbox ------------------------------------------------------------- */

html.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 9, 14, 0.94);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: calc(92vh - 44px); width: auto; height: auto; border-radius: 3px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.lightbox figcaption { margin-top: 12px; font-size: 16px; color: var(--parchment); display: flex; gap: 20px; align-items: center; }
.lightbox button {
  position: absolute; background: none; border: 0; color: var(--parchment);
  font: inherit; cursor: pointer; opacity: 0.8; line-height: 1;
}
.lightbox button:hover { opacity: 1; color: var(--sunset); }
.lightbox button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 18px; right: 22px; width: 52px; height: 52px; padding: 12px; border-radius: 50%; background: rgba(16, 34, 47, 0.75) !important; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 64px; height: 64px; padding: 14px; border-radius: 50%; background: rgba(16, 34, 47, 0.75) !important; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

@media (max-width: 860px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .lb-prev, .lb-next { width: 46px; height: 46px; padding: 10px; }
  .lb-close { width: 44px; height: 44px; padding: 10px; top: 10px; right: 10px; }
}

.more { margin: 20px 0 0; }

/* Playtest page */
.press ol { padding-left: 22px; }
.press ol li { margin: 6px 0; }
.press .buttons { margin: 24px 0 8px; }
.press code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: var(--sea-light); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; color: var(--parchment); word-break: break-all; }

/* Phones: Trailer and Screenshots only scroll the page, so they go. */
@media (max-width: 600px) {
  .nav-btn.wide-only { display: none; }
}
