/* TortOS — tortos.games */

/* Josefin Sans Thin — the face TortOS itself runs on, straight from the
   repo's res/fonts/menu.ttf, subset to the glyphs this page uses.
   SIL Open Font License 1.1; see OFL.txt beside this file.
   At 100 weight it wants a little more size and a little more contrast
   than a normal body face, which the type scale below allows for. */
@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url("josefin-thin.woff2?v=9") format("woff2");
}

:root {
  --shell-light: #80B076;
  --shell-mid:   #688A60;
  --shell-deep:  #3D5943;
  --cyan:        #3DD6FF;
  --bone:        #E9ECE3;

  --bg:        #0E1411;
  --bg-raised: #151D18;
  --line:      #24322A;
  --text:      #E9ECE3;
  --text-dim:  #9BAA9F;

  /* Ink versions of the brand colors: on a dark ground the brand values
     already carry enough contrast, so these just pass them through.
     The light theme below swaps in deeper mixes. */
  --head: var(--shell-light);
  --ink:  var(--cyan);

  /* Readable from JS, so the toggle can ask what is actually on screen
     rather than re-deriving it from the OS setting plus any override. */
  --is-light: 0;

  --radius: 14px;
  --measure: 62ch;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #F7F8F4;
    --bg-raised: #FFFFFF;
    --line:      #DDE3D9;
    --text:      #17211B;
    --text-dim:  #5B6B5F;
    --head:      #3D5943;
    --ink:       #0F86A6;
    --is-light:  1;
  }
}

:root[data-theme="light"] {
  --bg:        #F7F8F4;
  --bg-raised: #FFFFFF;
  --line:      #DDE3D9;
  --text:      #17211B;
  --text-dim:  #5B6B5F;
  --head:      #3D5943;
  --ink:       #0F86A6;
  --is-light:  1;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Josefin Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 100;
  font-size: 19px;      /* Thin needs the extra size to hold up at body scale */
  line-height: 1.65;
  /* Antialiasing thins strokes further on macOS, so leave it on the default
     subpixel rendering — the face is light enough already. */
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

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

.hero {
  text-align: center;
  padding: 72px 0 56px;
}

.mark {
  width: 190px;
  height: auto;
  display: block;
  margin: 0 auto 26px;
}

/* Which mark is shown has to track the toggle too, not just the OS. */
.mark-on-light { display: none; }
.mark-on-dark  { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .mark-on-dark  { display: none; }
  :root:not([data-theme="dark"]) .mark-on-light { display: block; }
}
:root[data-theme="light"] .mark-on-dark  { display: none; }
:root[data-theme="light"] .mark-on-light { display: block; }

/* The wordmark is artwork, not type — shipped as-is and only ever scaled. */
.wordmark {
  margin: 0;
  line-height: 0;
}
.wordmark img {
  width: min(400px, 74%);
  height: auto;
  display: block;
  margin: 0 auto;
}

.tagline {
  max-width: var(--measure);
  margin: 26px auto 0;
  font-size: clamp(1.1rem, 3.4vw, 1.4rem);
  line-height: 1.45;
  color: var(--text);
}
/* Only weight 100 exists, so emphasis is carried by colour, not a
   synthesised bold that would smear the strokes. */
.tagline strong { color: var(--head); }

.sub {
  max-width: var(--measure);
  margin: 10px auto 0;
  color: var(--text-dim);
}

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

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--shell-light);
  color: #0E1411;
  font-weight: 100;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s ease, transform .15s ease;
}
.cta:hover  { background: var(--cyan); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.gh { flex: none; }

/* ---------- screenshot ---------- */

.shot {
  margin: 8px 0 72px;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

/* ---------- points ---------- */

.points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.point {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.point h2 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  font-weight: 100;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--head);
}

.point p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.97rem;
  line-height: 1.58;
}

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

footer {
  margin-top: 64px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.systems {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.95;
  color: var(--text-dim);
}

.meta {
  margin: 18px 0 0;
  font-size: 0.92rem;
  color: var(--text-dim);
}

a { color: var(--ink); }
footer a { text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero { padding: 52px 0 44px; }
  .mark { width: 150px; }
  .points { grid-template-columns: 1fr; }
  .shot { margin-bottom: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover {
  color: var(--head);
  border-color: var(--head);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Show the icon for the theme you would switch TO. The same three-way
   pattern as the colours above: base is dark, then the OS light case, then
   the explicit override. */
.theme-toggle .moon { display: none; }
.theme-toggle .sun  { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun  { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .moon { display: block; }
}
:root[data-theme="light"] .theme-toggle .sun  { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }

/* No JS, no way to change the theme — so do not advertise one. */
html:not(.js) .theme-toggle { display: none; }
