/* Tree Fort Games — shared styles for both landing page versions.
   Mobile first: the base rules are the phone layout; wider screens only adjust. */
:root {
  --bg: #14110f;
  --bg-glow: #1f2a1c;
  --ink: #efe6d2;
  --muted: #a89f8c;
  --accent: #c94a5a;
  --rule: rgba(239, 230, 210, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 1rem;
  /* Screen height. svh = the height with the browser's toolbars showing, so the first
     screen is measured the way a phone shows it on arrival. vh is the fallback. */
  --screen: 100vh;
  --crest-ratio: 0.6552; /* studio logo width / height (600 x 916) */
}
@supports (height: 100svh) { :root { --screen: 100svh; } }

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

html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 120% 70% at 50% 30%, var(--bg-glow) 0%, transparent 70%) no-repeat,
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { text-align: center; }

h1 { margin: 0; line-height: 0; }

/* ---- First screen: the logo fills it ---- */
.hero {
  min-height: var(--screen);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: max(1rem, env(safe-area-inset-top)) var(--gutter) 1.5rem;
}

/* The crest takes 80% of the screen height, or the full width less the gutters on
   narrow or landscape screens, whichever is smaller. */
.studio-logo {
  display: block;
  height: auto;
  width: min(
    calc(100vw - 2 * var(--gutter)),
    calc(var(--screen) * 0.8 * var(--crest-ratio))
  );
}

.tagline {
  margin: 0;
  max-width: 30ch;
  color: var(--muted);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.5;
}

/* ---- Featured-game version: crest + "Developer of" + game logo share the first screen ---- */
.hero--feature { gap: 1.75rem; }

.studio-logo--feature {
  width: min(
    55vw,
    calc(var(--screen) * 0.42 * var(--crest-ratio))
  );
}

.feature { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: 100%; }

.feature-label,
.contact h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-logo { display: block; width: min(640px, 100%); height: auto; }

.game-name { /* visually hidden full title for screen readers & search */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- Below the first screen ---- */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 0;
  border-top: 1px solid var(--rule);
  width: min(320px, calc(100% - 2 * var(--gutter)));
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: #fff; text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* Comfortable tap target on phones */
.email { display: inline-block; padding: 0.4rem 0.25rem; font-size: 1.25rem; overflow-wrap: anywhere; }

footer {
  padding: 3rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
footer p { margin: 0 auto; max-width: 70ch; }
footer p + p { margin-top: 0.4rem; }

/* ---- Larger screens ---- */
@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  .tagline { font-size: 1.1875rem; }
  .studio-logo--feature { width: calc(var(--screen) * 0.42 * var(--crest-ratio)); }
}

@media (prefers-reduced-motion: reduce) { a { transition: none; } }
