/*
 * Egypt Temple - egypttemple.com
 *
 * Mobile first. One stylesheet, no framework, no web fonts: the whole page
 * should land on a phone on a bad connection before the player loses interest.
 *
 * The palette is sampled from the game art rather than invented, so the site
 * and the App Store screenshots look like the same product: lapis for ground,
 * polished gold for anything that matters, turquoise and carnelian for accent,
 * and the warm sunset of the title screen for light.
 */

:root {
  /* Ground - the deep blue the pieces are drawn against. */
  --lapis-900: #070e24;
  --lapis-800: #0a1430;
  --lapis-700: #0f1d43;
  --lapis-600: #16295c;
  --lapis-500: #1e3675;

  /* Polished gold. The three stops make a believable metal gradient. */
  --gold-dark: #b87a1c;
  --gold: #e8ae3c;
  --gold-light: #ffd76a;
  --gold-pale: #fff0b8;

  --turquoise: #2fc4cf;
  --carnelian: #d4402f;
  --lotus: #e0479a;
  --sunset: #ff9a3c;

  /* Text. Warm off-white, never pure white - pure white on lapis glares. */
  --ink: #f2ead9;
  --ink-soft: #c3bda9;
  --ink-faint: #8e8a7c;

  --rule: rgba(232, 174, 60, 0.26);
  --panel: rgba(255, 255, 255, 0.035);

  --measure: 36rem;        /* readable line length for the policy pages */
  --wide: 68rem;           /* the home page may breathe wider */
  --pad: 1.25rem;

  --serif: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  color-scheme: dark;
}

/* --------------------------------------------------------------- skeleton */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--lapis-800);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  /*
   * A faint warm glow at the top of every page, as though the sunset from the
   * title screen were still just off the edge of the screen.
   */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 154, 60, 0.16), transparent 70%),
    radial-gradient(90% 50% at 85% 5%, rgba(47, 196, 207, 0.07), transparent 70%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--gold-light); text-decoration-color: rgba(255, 215, 106, 0.4); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-pale); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--lapis-900);
  padding: 0.6rem 1rem; font-weight: 700; z-index: 50;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------- typography */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  /* Gold leaf: a gradient clipped to the letters, with a dark edge beneath. */
  background: linear-gradient(176deg, var(--gold-pale) 2%, var(--gold-light) 34%, var(--gold) 62%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Fallback: if background-clip:text is unsupported the text would vanish. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  h1, h2, h3 { background: none; color: var(--gold-light); }
}

h1 { font-size: clamp(2rem, 7.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin-top: 2.25em; }
h3 { font-size: 1.1875rem; margin-top: 1.9em; }
h2:first-child, h3:first-child { margin-top: 0; }

p, li { margin: 0 0 1rem; }
strong { color: var(--gold-pale); font-weight: 650; }

.eyebrow {
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin: 0 0 0.9rem;
}

.lede { font-size: 1.1875rem; color: var(--ink); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  max-width: var(--wide); margin: 0 auto;
  padding: 0.85rem var(--pad);
  position: relative; z-index: 3;
}
.masthead__home { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.masthead__name {
  font-family: var(--serif); font-size: 1.0625rem; font-weight: 700;
  color: var(--gold-light); letter-spacing: 0.04em;
}
/* The logo already reads "Egypt Temple", so the word beside it is for screen
   readers and for the case where the art has not loaded. */
.masthead__home .logo--small { height: 30px; width: auto; }
.masthead__home .logo--small + .masthead__name { position: absolute; left: -9999px; }

.masthead__nav { display: flex; gap: 1.1rem; font-size: 0.9375rem; }
.masthead__nav a { color: var(--ink-soft); text-decoration: none; }
.masthead__nav a:hover { color: var(--gold-light); }

/* Text stand-in used when the logo image is not available. */
.logo--text {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.05em;
  color: var(--gold-light); font-size: 1.125rem;
}
.logo--text span { color: var(--turquoise); margin-left: 0.3em; }
.logo--hero.logo--text { font-size: clamp(2rem, 9vw, 3rem); display: block; }

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  margin-top: -4rem;             /* the masthead floats over the art */
  padding: 7rem var(--pad) 2.5rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  /* The sun and the pyramids live in the top third of a very tall image. */
  object-position: 50% 18%;
}
/*
 * The art is bright warm orange and gold text cannot be read on it. This scrim
 * keeps the sunset visible at the top and hands back a dark, legible ground by
 * the time the words begin.
 */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(7, 14, 36, 0.55) 0%,
      rgba(7, 14, 36, 0.3) 22%,
      rgba(8, 16, 40, 0.72) 55%,
      var(--lapis-800) 97%);
}
.hero__inner { max-width: 34rem; margin: 0 auto; position: relative; }
.logo--hero { width: min(100%, 25rem); margin: 0 auto 1.25rem; display: block; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55)); }
.hero h1 { font-size: clamp(1.5rem, 5.2vw, 2.1rem); margin-bottom: 0.6rem; }
.hero .lede { color: var(--ink); text-shadow: 0 1px 10px rgba(7, 14, 36, 0.9); margin-bottom: 1.6rem; }
.hero__free {
  display: inline-block; margin-bottom: 1.1rem;
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lapis-900);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.42rem 0.85rem; border-radius: 999px;
}

/* ----------------------------------------------------------- call to action */

.cta {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 0.05rem;
  padding: 0.7rem 1.75rem;
  border-radius: 0.85rem;
  text-decoration: none;
  font-family: var(--sans);
  border: 1px solid rgba(255, 240, 184, 0.5);
}
.cta__sub { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.cta__main { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }
.cta--large { padding: 0.85rem 2.25rem; }

/* Live: polished gold, with a highlight along the top edge. */
.cta--live {
  color: var(--lapis-900);
  background: linear-gradient(180deg, var(--gold-pale) 0%, var(--gold-light) 38%, var(--gold) 70%, var(--gold-dark) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 6px 20px rgba(0, 0, 0, 0.45);
}
.cta--live:hover { color: var(--lapis-900); filter: brightness(1.07); }

/* Not yet live: unmistakably inert, but still a handsome plaque. */
.cta--pending {
  color: var(--gold-light);
  background: linear-gradient(180deg, rgba(232, 174, 60, 0.16), rgba(232, 174, 60, 0.06));
  border-color: var(--rule);
  cursor: default;
}

.cta-note { margin-top: 0.85rem; font-size: 0.875rem; color: var(--ink-soft); }

/* ------------------------------------------------------------------ layout */

/*
 * A handful of spacing utilities. These exist so no page needs a style=""
 * attribute: with none anywhere, the Content-Security-Policy can forbid inline
 * styles outright rather than having to allow them all.
 */
.narrow { max-width: 26rem; margin-left: auto; margin-right: auto; }
.narrow-wide { max-width: 30rem; margin-left: auto; margin-right: auto; }
.push-lg { margin-top: 1.9rem; }
.push-sm { margin-top: 1.1rem; }
.push-under { margin-bottom: 1.7rem; }
.flush-top { margin-top: 0; }

.band { padding: 3rem var(--pad); }
.band--tight { padding-top: 1rem; }
.wrap { max-width: var(--wide); margin: 0 auto; }

/*
 * The policy and support pages put .prose straight into <main>, with no .band
 * around it to supply a gutter. Without this padding their text runs flush to
 * the edge of a phone screen, which is exactly how it shipped the first time.
 * The max-width adds the padding back so the text column itself stays at the
 * readable measure rather than shrinking by 2.5rem.
 */
.prose {
  max-width: calc(var(--measure) + 2 * var(--pad));
  margin: 0 auto;
  padding: 1.25rem var(--pad) 2.5rem;
}
.prose h2 { font-size: clamp(1.35rem, 4.5vw, 1.7rem); }
.center { text-align: center; }

/* ---------------------------------------------------------------- features */

.features { display: grid; gap: 1rem; padding: 0; margin: 0; list-style: none; }
@media (min-width: 40rem) { .features { grid-template-columns: 1fr 1fr; gap: 1.1rem; } }

.feature {
  position: relative;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: 1rem;
  background: linear-gradient(165deg, rgba(30, 54, 117, 0.5), rgba(10, 20, 48, 0.72));
  border: 1px solid var(--rule);
  margin: 0;
  overflow: hidden;
}
/* A thin bright line along the top edge, like light catching inlay. */
.feature::before {
  content: ''; position: absolute; top: 0; left: 1.35rem; right: 1.35rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  opacity: 0.6;
}
.feature h3 { margin: 0 0 0.45rem; font-size: 1.1875rem; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.9875rem; }
.feature__icon {
  width: 46px; height: 46px; display: block; margin-bottom: 0.75rem;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

/* --------------------------------------------------------------- the pieces */

/*
 * A grid rather than a wrapping flex row: eight pieces across a 390px phone
 * wrap 6 + 2, which looks like an accident. Four and four is deliberate.
 */
.pieces {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: center;
  gap: 0.85rem 1rem; list-style: none; padding: 0; margin: 0 0 1.5rem;
}
@media (min-width: 34rem) { .pieces { grid-template-columns: repeat(8, auto); } }
.pieces li { margin: 0; display: flex; }
.pieces img {
  width: 48px; height: 48px;
  filter: drop-shadow(0 3px 9px rgba(0, 0, 0, 0.55));
}
@media (min-width: 30rem) { .pieces img { width: 58px; height: 58px; } }

/* ---------------------------------------------------------------- the sphinx */

.sphinx-block {
  display: grid; gap: 1.25rem; align-items: center; justify-items: center;
  text-align: center;
}
@media (min-width: 44rem) {
  .sphinx-block { grid-template-columns: 220px 1fr; text-align: left; justify-items: start; }
}
.sphinx { width: 190px; height: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5)); }
@media (min-width: 44rem) { .sphinx { width: 220px; } }
.sphinx--small { width: 130px; }

/* ---------------------------------------------------------------- ornament */

.rule { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin: 2.25rem 0; }
.rule::before, .rule::after {
  content: ''; height: 1px; flex: 1 1 auto; max-width: 9rem;
  background: linear-gradient(90deg, transparent, var(--rule), transparent);
}
.rule svg { width: 30px; height: 15px; fill: var(--gold); opacity: 0.8; flex: none; }

/* -------------------------------------------------------------------- cards */

.card {
  padding: 1.35rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--panel);
  margin: 0 0 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

/* The one place a colour other than gold leads: the support email. */
.contact {
  display: block; text-align: center;
  padding: 1.1rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(47, 196, 207, 0.4);
  background: rgba(47, 196, 207, 0.08);
  text-decoration: none; color: var(--ink);
  font-size: 1.0625rem;
  margin-bottom: 1.75rem;
}
.contact strong { display: block; font-size: 1.1875rem; color: var(--turquoise); margin-top: 0.15rem; }
.contact:hover { background: rgba(47, 196, 207, 0.14); color: var(--ink); }

/* ---------------------------------------------------------------------- faq */

.faq { margin: 0 0 1rem; }
.faq summary {
  cursor: pointer; padding: 0.95rem 0.25rem;
  font-family: var(--serif); font-size: 1.0625rem; font-weight: 700;
  color: var(--gold-light);
  border-bottom: 1px solid var(--rule);
  list-style-position: outside;
}
.faq summary::marker { color: var(--turquoise); }
.faq[open] summary { border-bottom-color: transparent; }
.faq > div { padding: 0.25rem 0.25rem 1.1rem; border-bottom: 1px solid var(--rule); }
.faq > div p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- policy prose */

.policy { font-size: 1.03125rem; }
.policy h2 { font-size: 1.3125rem; margin-top: 2.5rem; }
.policy h3 { font-size: 1.0625rem; color: transparent; margin-top: 1.75rem; }
.policy ul { padding-left: 1.15rem; }
.policy li { margin-bottom: 0.55rem; }
.policy table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 0 0 1.25rem; }
.policy th, .policy td { text-align: left; padding: 0.6rem 0.65rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.policy th { color: var(--gold-light); font-family: var(--serif); }
.table-scroll { overflow-x: auto; }

.stamp {
  display: inline-block; margin-bottom: 1.75rem;
  font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.06em;
  color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

/* A bracketed placeholder the owner still has to fill in. Visible on purpose:
   it should be obvious on the page, not something only a grep would find. */
.todo {
  background: rgba(212, 64, 47, 0.16);
  border-bottom: 1px dashed var(--carnelian);
  padding: 0 0.2em; border-radius: 2px;
  color: var(--gold-pale);
}

/* ----------------------------------------------------------------- invite */

.invite { text-align: center; padding: 2rem var(--pad) 3rem; }
.invite .logo--hero { width: min(100%, 21rem); }
.invite__who {
  font-family: var(--serif); font-size: 1.25rem; color: var(--gold-light);
  margin-bottom: 0.3rem;
}
.invite__id {
  font: 500 0.8125rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-faint); letter-spacing: 0.04em; word-break: break-all;
  margin-top: 1.1rem;
}
.invite__steps {
  text-align: left; max-width: 22rem; margin: 1.75rem auto 0;
  list-style: none; padding: 0; counter-reset: step;
}
.invite__steps li {
  position: relative; padding-left: 2.25rem; margin-bottom: 0.9rem;
  color: var(--ink-soft); font-size: 0.9375rem;
}
.invite__steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--lapis-900); font: 700 0.8125rem/1 var(--sans);
}

/* ------------------------------------------------------------------ footer */

.footer { padding: 1rem var(--pad) 3rem; max-width: var(--wide); margin: 0 auto; text-align: center; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.4rem; margin-bottom: 1.1rem; }
.footer__nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.9375rem; }
.footer__nav a:hover { color: var(--gold-light); }
.footer__note { font-size: 0.9375rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.footer__fine { font-size: 0.8125rem; color: var(--ink-faint); margin: 0; }

/* ------------------------------------------------------------- 404 and misc */

.lost { text-align: center; padding: 3rem var(--pad) 4rem; }
.lost .sphinx { margin-bottom: 1.25rem; }

/* High-contrast and forced-colours users lose the gradient text entirely
   unless it is turned off, because clipped text has no colour of its own. */
@media (forced-colors: active) {
  h1, h2, h3 { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
  .cta { border: 1px solid ButtonBorder; }
}

/* ------------------------------------------------------------ support form */

.form { margin: 1.5rem 0 0; }
.form__row { display: grid; gap: 0.9rem; }
@media (min-width: 34rem) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__field { margin: 0 0 0.9rem; }
.form__field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}
.form__hint { color: var(--ink-faint); }
.form input, .form textarea {
  width: 100%;
  font: inherit;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
}
.form input:focus, .form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: transparent;
}
.form textarea { resize: vertical; min-height: 7rem; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .cf-turnstile { margin: 0.4rem 0 1rem; min-height: 65px; }
.form__send { border: 0; cursor: pointer; font-family: var(--sans); }
.form__send:disabled { opacity: 0.55; cursor: default; }
.form__status { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--ink-soft); min-height: 1.2em; }
.form__status.is-error { color: var(--carnelian); }
.form__thanks { margin: 1.5rem 0 0; font-size: 1rem; color: var(--ink); }
