/* Box Climb website. Same tokens as the game (scripts/ui/ui_theme.gd):
   midnight glass surfaces, warm ivory type and one ember accent. */

:root {
  color-scheme: dark;
  --night: #0a0d17;
  --surface: #111726;
  --surface-2: #182033;
  --surface-3: #232d45;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --ivory: #f6f1e7;
  --text-2: #b9bfcd;
  --text-3: #8a91a6;
  --ember: #ffc46b;
  --ember-2: #ff9d5c;
  --on-ember: #2b1705;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max: 1120px;
  --gutter: clamp(16px, 5vw, 40px);
  --radius: 20px;
}

* { box-sizing: border-box; }

html {
  background: var(--night);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  font-optical-sizing: auto;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { top: 12px; }

/* Language hint (English page, Turkish browsers) */

.lang-hint {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px var(--gutter);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
}

.lang-hint[hidden] { display: none; }

.lang-hint a { color: var(--ember); font-weight: 700; }

/* Header */

.site-header {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  padding-top: max(14px, env(safe-area-inset-top));
}

.lang-hint:not([hidden]) + .site-header { position: relative; background: var(--night); padding-bottom: 14px; }

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 52px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.nav {
  display: none;
  gap: 26px;
  font-size: 15px;
  font-weight: 600;
}

.nav a,
.lang-link {
  color: var(--text-2);
  text-decoration: none;
}

.nav a:hover,
.lang-link:hover { color: var(--ivory); }

.lang-link {
  font-size: 15px;
  font-weight: 600;
}

@media (min-width: 880px) {
  .nav { display: flex; }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(180deg, var(--ember), #ffb65f);
  color: var(--on-ember);
  box-shadow: 0 10px 30px -12px rgba(255, 180, 95, 0.55);
}

.btn-primary:hover { background: #ffd08a; }

.btn-ghost {
  border: 1px solid var(--line-2);
  background: rgba(10, 13, 23, 0.35);
  color: var(--ivory);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); }

.btn-small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.btn svg { width: 18px; height: 18px; flex: none; }

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  min-height: max(640px, 100svh);
  overflow: hidden;
  /* Room below the text for the stairs and the cube in the portrait art. */
  padding: 104px 0 clamp(240px, 36vh, 360px);
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 100%;
}

/* Phones: text over the sky, the cube and the stairs stay visible below. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 13, 23, 0.92) 0%, rgba(10, 13, 23, 0.78) 34%, rgba(10, 13, 23, 0.1) 62%, transparent 72%),
    linear-gradient(0deg, var(--night) 0%, transparent 16%);
}

.hero-inner { position: relative; }

.eyebrow {
  margin-bottom: 14px;
  color: var(--ember);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(56px, 11vw, 112px);
  line-height: 0.98;
}

.tagline {
  margin-top: 14px;
  font-family: var(--display);
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.2;
  color: var(--ivory);
}

.hero .lead {
  max-width: 34em;
  margin-top: 18px;
  color: var(--text-2);
  font-size: 17px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-note {
  margin-top: 20px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
}

@media (orientation: landscape) and (min-width: 720px) {
  .hero {
    align-items: center;
    padding: 110px 0 48px;
  }

  .hero-art img { object-position: 70% 60%; }

  .hero::before {
    background:
      linear-gradient(90deg, rgba(10, 13, 23, 0.94) 0%, rgba(10, 13, 23, 0.72) 38%, rgba(10, 13, 23, 0.05) 68%, transparent 80%),
      linear-gradient(0deg, var(--night) 0%, transparent 14%);
  }

  .hero-inner > * { max-width: 560px; }
}

/* Sections */

.section { padding: clamp(72px, 11vw, 128px) 0 0; }

.section-head { max-width: 680px; }

.section-head h2,
.split h2 {
  font-size: clamp(34px, 5.4vw, 54px);
}

.section-head .lead,
.split .lead {
  margin-top: 16px;
  color: var(--text-2);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

/* How to play */

.steps {
  display: grid;
  gap: 14px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 26px 24px 28px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 14px;
  color: var(--ember);
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
}

.steps h3 { font-size: 26px; }

.steps p {
  margin-top: 10px;
  color: var(--text-2);
}

.controls-note {
  margin-top: 18px;
  color: var(--text-3);
  font-size: 15px;
}

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* Worlds */

.worlds {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

.world {
  margin: 0;
  overflow: hidden;
}

.world img {
  width: 100%;
  aspect-ratio: 960 / 469;
  object-fit: cover;
}

.world figcaption { padding: 18px 22px 22px; }

.world h3 { font-size: 24px; }

.world p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 16px;
}

@media (min-width: 700px) {
  .worlds { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1040px) {
  .worlds { grid-template-columns: repeat(3, 1fr); }
}

/* Skills */

.skills {
  display: grid;
  margin: 36px 0 0;
  padding: 8px 24px;
  list-style: none;
}

.skills li {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.skills li:last-child { border-bottom: 0; }

.skills strong {
  font-size: 17px;
  font-weight: 700;
}

.skills span { color: var(--text-2); font-size: 16px; }

@media (min-width: 760px) {
  .skills {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 48px;
    padding: 12px 32px;
  }

  .skills li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* Feature rows: Daily Climb, Sky Journal */

.split {
  display: grid;
  gap: 36px;
  align-items: center;
}

.split .copy { max-width: 560px; }

.split .lead + .lead { margin-top: 14px; }

.phone {
  width: min(300px, 78vw);
  margin: 0 auto;
  border: 1px solid var(--line-2);
  border-radius: 30px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}

@media (min-width: 820px) {
  .split { grid-template-columns: 1.2fr 1fr; gap: 64px; }
  .split.flip .copy { order: 2; }
}

/* Screenshots */

.shots {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  padding: 0 var(--gutter) 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.shots img {
  flex: none;
  width: min(250px, 62vw);
  border: 1px solid var(--line);
  border-radius: 22px;
  scroll-snap-align: start;
}

@media (min-width: 1200px) {
  .shots {
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin-left: auto;
    margin-right: auto;
  }

  .shots img { width: calc((var(--max) - 5 * 16px) / 6); }
}

/* Facts */

.facts {
  display: grid;
  margin: 36px 0 0;
  padding: 6px 24px;
}

.facts div {
  display: grid;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts div:last-child { border-bottom: 0; }

.facts dt {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd { margin: 0; }

@media (min-width: 760px) {
  .facts { padding: 6px 32px; }
  .facts div { grid-template-columns: 220px 1fr; gap: 24px; align-items: baseline; }
}

/* FAQ */

.faq { margin-top: 28px; }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.25;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-right: 2px solid var(--ember);
  border-bottom: 2px solid var(--ember);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 180ms ease;
}

.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }

.faq details p {
  max-width: 46em;
  padding: 0 0 24px;
  color: var(--text-2);
}

/* About and support */

.about {
  display: grid;
  gap: 28px;
  align-items: start;
}

.support { padding: 28px 26px 30px; }

.support h3 { font-size: 28px; }

.support p {
  margin: 10px 0 22px;
  color: var(--text-2);
}

.support p a,
.facts dd a,
.faq details p a {
  color: var(--ember);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

@media (min-width: 860px) {
  .about { grid-template-columns: 1.3fr 1fr; gap: 64px; }
  .about .support { margin-top: 30px; }
}

/* Closing call to action */

.closing {
  margin-top: clamp(72px, 11vw, 128px);
  padding: clamp(64px, 10vw, 112px) 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 196, 107, 0.12), transparent 60%),
    var(--surface);
  border-top: 1px solid var(--line);
}

.closing h2 { font-size: clamp(36px, 6vw, 64px); }

.closing .actions { justify-content: center; }

/* Footer */

.site-footer {
  padding: 32px 0 max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 20px; }

.site-footer a { color: var(--text-2); text-decoration: none; }

.site-footer a:hover { color: var(--ivory); }

/* 404 */

.missing {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 48px var(--gutter);
  text-align: center;
}

.missing h1 { font-size: clamp(40px, 8vw, 72px); }

.missing p { margin-top: 12px; color: var(--text-2); }

.missing .actions { justify-content: center; }

/* Privacy, terms and support */

.doc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
}

.doc-brand {
  font-family: var(--display);
  font-size: 22px;
  text-decoration: none;
}

.doc-bar nav { display: flex; gap: 20px; font-size: 15px; }

.doc-bar nav a { color: var(--text-2); text-decoration: none; }

.doc-bar nav a:hover { color: var(--ivory); }

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 72px) var(--gutter) 72px;
}

.doc h1 { font-size: clamp(38px, 7vw, 56px); }

.doc-date { margin-top: 12px; color: var(--text-3); font-size: 15px; }

.doc-intro { margin-top: 24px; color: var(--text-2); font-size: 19px; }

.doc section { margin-top: 40px; }

.doc h2 { font-size: clamp(22px, 3.4vw, 28px); line-height: 1.2; }

.doc section p { margin-top: 12px; color: var(--text-2); }

.doc a { color: var(--ember); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after { transition: none; }
}
