/* Treasure Hunters: styles
   Palette comes from the Solar Interactive logo: charcoal, sun amber, flame orange.
   Change a color here and it changes everywhere. */

:root {
  --ink: #14191d;        /* page background */
  --ink-2: #1a2127;      /* raised band */
  --line: #2b343b;       /* hairlines */
  --cream: #ece7d6;      /* headings, key text */
  --text: #cfcbbc;       /* body text */
  --muted: #9ea49c;      /* quiet text */
  --amber: #fba409;      /* sun */
  --orange: #fa7905;     /* flame */

  --gutter: clamp(1.25rem, 5vw, 4rem);
  /* left edge shared by the nav, hero, sections and footer so everything lines up */
  --edge: max(var(--gutter), calc((100% - 76rem) / 2 + var(--gutter)));
  --display: "Saira Stencil One", "Arial Narrow", "Franklin Gothic Condensed", Impact, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.125rem/1.65 var(--serif);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Fine charcoal grain over everything, a nod to the sketched skull. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Navigation ---------- */

.nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--edge);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cream);
  font: 400 1.2rem/1 var(--display);
  letter-spacing: 0.03em;
  text-decoration: none;
}

.nav__brand img {
  width: 2.5rem;
  height: 2.5rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__links a {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.nav__links a:hover { color: var(--cream); }

.nav__links .nav__cta {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  transition: background-color 0.15s, color 0.15s;
}
.nav__links .nav__cta:hover {
  background: var(--amber);
  color: var(--ink);
}

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

.hero {
  --x: 68%;     /* torch position, updated by js/main.js */
  --y: 38%;
  --r: 300px;   /* torch radius */

  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem var(--edge) clamp(2.5rem, 7vh, 5rem);
  overflow: hidden;
  touch-action: pan-y;
}

/* Chalk map on the wall: only visible where the torch reaches. */
.hero__wall {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0, rgba(0, 0, 0, 0.62) 38%, rgba(0, 0, 0, 0.12) 78%, transparent 100%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0, rgba(0, 0, 0, 0.62) 38%, rgba(0, 0, 0, 0.12) 78%, transparent 100%);
}

.hero__wall svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #f1d7a0;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__wall .chalk-dots { stroke-width: 6; stroke-dasharray: 0.5 17; }
.hero__wall .chalk-bold { stroke-width: 8; }

.hero__skull {
  position: absolute;
  z-index: 2;
  /* The image has wide empty margins, so the box is bigger than the skull itself. */
  right: -6vw;
  top: 50%;
  width: min(62vw, 96vh, 860px);
  max-width: none;
  transform: translateY(-56%);
  pointer-events: none;
  user-select: none;
}

.hero__glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(circle calc(var(--r) * 1.15) at var(--x) var(--y), rgba(255, 146, 38, 0.17), rgba(250, 112, 20, 0.07) 45%, transparent 72%);
}

.hero__copy {
  position: relative;
  z-index: 4;
  max-width: 46rem;
}

.hero__title {
  margin: 0;
  color: var(--cream);
  font: 400 clamp(3.6rem, 10vw, 9rem)/0.86 var(--display);
  letter-spacing: 0.005em;
}

.hero__lede {
  max-width: 32ch;
  margin: 1.5rem 0 0;
  color: var(--cream);
  text-wrap: balance;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

/* ---------- Buttons and links ---------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 1.1rem/1 var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}

/* The shape is a pseudo-element so the focus ring stays visible. One cut corner,
   borrowed from the blade in the Solar logo. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--amber);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: background-color 0.15s;
}
.btn:hover::before { background: #ffb93a; }
.btn:disabled { cursor: progress; opacity: 0.7; }

.textlink {
  color: var(--cream);
  font-size: 1.1rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.textlink:hover { color: var(--amber); }

/* ---------- Shared section layout ---------- */

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

.grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.grid--center { align-items: center; }

.heading {
  margin: 0 0 1.5rem;
  color: var(--cream);
  font: 400 clamp(2rem, 4.6vw, 3.6rem)/1.04 var(--display);
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.prose {
  max-width: 34rem;
  margin: 0 0 1.1rem;
  line-height: 1.7;
}

/* ---------- The game ---------- */

.game { padding-block: clamp(5rem, 12vw, 9.5rem); }

.ledger {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.ledger__row {
  display: flex;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.ledger dt {
  display: flex;
  flex: 1;
  align-items: baseline;
  color: var(--muted);
}

/* dotted leader between the label and the value, like a ship's ledger */
.ledger dt::after {
  content: "";
  flex: 1;
  margin: 0 0.9rem;
  border-bottom: 2px dotted rgba(236, 231, 214, 0.22);
  transform: translateY(-0.3em);
}

.ledger dd {
  margin: 0;
  color: var(--cream);
  font-weight: 500;
  text-align: right;
}

/* ---------- Sign-up ---------- */

.notify {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  background: var(--ink-2);
}

.signup label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--cream);
  font-weight: 500;
}

.signup__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.signup input[type="email"] {
  flex: 1 1 14rem;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1.5px solid #3a454d;
  border-radius: 0;
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-size: 1.1rem;
}
.signup input[type="email"]::placeholder { color: #7d847c; }
.signup input[type="email"]:focus {
  border-color: var(--amber);
  outline: none;
  box-shadow: 0 0 0 3px rgba(251, 164, 9, 0.25);
}

.signup__status {
  min-height: 1.7em;
  margin: 0.9rem 0 0;
  font-size: 1rem;
}
.signup__status.is-ok { color: var(--amber); }
.signup__status.is-error { color: #ff9a7a; }

/* spam trap: invisible to people, tempting to bots */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.stores {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.stores p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 1rem;
}
.stores ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stores a {
  color: var(--cream);
  text-underline-offset: 0.3em;
}
.stores a:hover { color: var(--amber); }

.notify__alt {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Studio ---------- */

.studio { padding-block: clamp(5rem, 11vw, 8.5rem); }

.studio__logo-link {
  display: block;
  max-width: 26rem;
}

.studio__logo {
  width: 100%;
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.studio__logo-link:hover .studio__logo { border-color: var(--orange); }

.studio__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 0;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.75rem var(--edge);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.foot p { margin: 0; }

/* ---------- Smaller screens ---------- */

@media (max-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1fr); }

  .hero {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding-top: 5.5rem;
  }

  .hero__skull {
    position: relative;
    right: auto;
    top: auto;
    align-self: center;
    width: min(120vw, 540px);
    margin: -4rem 0 -5rem;
    transform: none;
  }
}

@media (max-width: 640px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .ledger dd { max-width: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn::before,
  .studio__logo,
  .nav__links .nav__cta { transition: none; }
}
