/* TURNT theme. Colours come from the DawnBringer 32 palette the logo is drawn in
   (#5b6ee1 / #3f3fae / #639bff are its blues), so extra colour stays in the same family.
   Look: one narrow column, flat colour, square corners, hard offset shadows, no glows. */
:root {
  /* Palette (DB32) */
  --tnt-blue:       #5b6ee1;
  --tnt-blue-dark:  #3f3fae;
  --tnt-blue-light: #639bff;

  /* Physics colours, matching the game's PHY_TYPE_COLOR */
  --tnt-phy-tpm: #73b2ff;
  --tnt-phy-cpm: #66e68c;
  --tnt-phy-vq3: #f2bf59;
  --tnt-phy-vnt: #cc8cf2;

  /* Primary button, modelled on the game's own buttons */
  --tnt-btn-bg:     #3355c4;
  --tnt-btn-bg-hi:  #4064d6;
  --tnt-btn-border: #6b8cf2;

  /* Surfaces */
  --tnt-bg:      #12131f;
  --tnt-bg-deep: #0c0d16;
  --tnt-line:    #262944;
  --tnt-text:    #e4e6f2;
  --tnt-muted:   #9097bd;

  --tnt-column: 38rem;
  --tnt-gutter: 0.8rem;  /* Matches Material's content margin; widened below */
}

@media screen and (min-width: 76.25em) {
  :root {
    --tnt-gutter: 1.2rem;
  }
}

[data-md-color-scheme="slate"] {
  --md-hue: 235;
  --md-default-bg-color:          var(--tnt-bg);
  --md-default-fg-color:          var(--tnt-text);
  --md-default-fg-color--light:   var(--tnt-muted);
  --md-default-fg-color--lighter: #5d6388;
  --md-default-fg-color--lightest: var(--tnt-line);
  --md-typeset-color:             var(--tnt-text);
  --md-typeset-a-color:           var(--tnt-blue-light);
  --md-primary-fg-color:          var(--tnt-blue);
  --md-primary-fg-color--light:   var(--tnt-blue-light);
  --md-primary-fg-color--dark:    var(--tnt-blue-dark);
  --md-accent-fg-color:           #8fb6ff;
  --md-code-bg-color:             #1a1c2e;
}

/* Accidental Presidency is the game's own UI font (Tepid Monkey freeware; served
   unaltered with its ReadMe, as the licence asks). It has a single weight. */
@font-face {
  font-family: "Accidental Presidency";
  src: url("../assets/fonts/AccidentalPresidency.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* Material defines --md-text-font-family on body, so this can't live on :root */
body {
  --tnt-display-font: "Accidental Presidency", var(--md-text-font-family);
}

::selection {
  color: var(--tnt-bg-deep);
  background: var(--tnt-phy-tpm);
}

/* The logo is 156x40 pixel art; keep its edges crisp when scaled */
.tnt-header__logo img,
.tnt-hero__logo,
.tnt-post-meta img {
  image-rendering: pixelated;
}

/* One column everywhere, like a page rather than a docs site */
.md-grid {
  max-width: var(--tnt-column);
}

.md-main__inner {
  margin-top: 0;
}

/* Material varies this margin with page layout; pin it so content lines up with the header */
.md-main .md-content__inner {
  margin-left: var(--tnt-gutter) !important;
  margin-right: var(--tnt-gutter) !important;
  padding: 2.4rem 0 3.2rem;
}

.md-content__inner::before {
  display: none;
}

.md-typeset {
  font-size: 0.85rem;
  line-height: 1.65;
}



/* --- Buttons --- */
.tnt-btn,
.md-typeset .tnt-btn {
  display: inline-block;
  padding: 0.6em 1.4em;
  font-weight: 700;
  color: #fff;
  background: var(--tnt-btn-bg);
  border: 0.05rem solid var(--tnt-btn-border);
  border-radius: 0.15rem;
  transition: background-color 120ms, border-color 120ms;
}

.tnt-btn:hover,
.tnt-btn:focus,
.md-typeset .tnt-btn:hover,
.md-typeset .tnt-btn:focus {
  color: #fff;
  background: var(--tnt-btn-bg-hi);
  border-color: #9bb2ff;
}

.tnt-btn:active,
.md-typeset .tnt-btn:active {
  background: var(--tnt-btn-bg);
}

.tnt-btn--small {
  padding: 0.35em 0.9em;
}



/* --- Header --- */
.tnt-header {
  border-bottom: 0.1rem solid var(--tnt-line);
}

.tnt-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--tnt-gutter);
}

.tnt-header__logo img {
  display: block;
  height: 1.2rem;
  width: auto;
}

/* The home hero shows the big logo, so the header keeps only the nav */
.tnt-header--home {
  border-bottom: 0;
}

.tnt-header--home .tnt-header__logo {
  visibility: hidden;
}

.tnt-header__nav {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.tnt-header__nav a:not(.tnt-btn) {
  color: var(--tnt-muted);
}

.tnt-header__nav a:not(.tnt-btn):hover,
.tnt-header__nav a.is-active {
  color: var(--tnt-text);
}



/* --- Home hero --- */
.tnt-hero__inner {
  padding: 1.6rem var(--tnt-gutter) 0.4rem;
}

.tnt-hero__logo {
  display: block;
  width: min(468px, 100%);
  height: auto;
  margin-bottom: 1.8rem;
}

.tnt-hero__tagline {
  margin: 0 0 0.5rem;
  font-family: var(--tnt-display-font);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.05;
  color: #fff;
}

.tnt-hero__lede {
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--tnt-text);
}

.tnt-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin: 0;
  font-size: 0.85rem;
}

.tnt-hero__link {
  font-weight: 700;
  color: var(--tnt-blue-light);
}

.tnt-hero__link:hover {
  color: #fff;
}

.tnt-hero__meta {
  margin: 1.1rem 0 0;
  font-size: 0.75rem;
  color: var(--tnt-muted);
}

/* Screenshots: framed flat, with the same hard shadow as the buttons */
.tnt-hero__shot,
.md-typeset img.tnt-shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0.1rem solid var(--tnt-line);
  box-shadow: 0.3rem 0.3rem 0 var(--tnt-blue-dark);
}

.tnt-hero__shot {
  margin-top: 2.2rem;
}

/* An ultrawide capture: show it at its real shape, that's the point of it */
.md-typeset img.tnt-shot--wide {
  aspect-ratio: auto;
}

.md-typeset p:has(> img.tnt-shot:only-child) {
  margin: 1.6em 0 2em;
}



/* --- Headings --- */
.md-typeset h1,
.md-typeset h2 {
  font-family: var(--tnt-display-font);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #fff;
}

.md-typeset h1 {
  margin-bottom: 1rem;
  font-size: 2.4em;
  line-height: 1.1;
}

.md-typeset h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.8em;
  line-height: 1.1;
}

/* A single pixel block marks each section, echoing the logo's corner pixels */
.md-typeset h2::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-right: 0.45em;
  vertical-align: 0.15em;
  background: var(--tnt-blue);
  box-shadow: 0.12em 0.12em 0 var(--tnt-blue-dark);
}

.md-typeset > h2:first-child {
  margin-top: 0.4rem;
}

.md-typeset h3 {
  margin: 1.8em 0 0.3em;
  font-size: 1em;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
}

/* Feature subheadings sit tight against their paragraph */
.md-typeset h3 + p {
  margin-top: 0;
}



/* --- Physics styles --- */
.md-typeset .tnt-styles {
  margin: 1.2em 0 0;
}

.md-typeset .tnt-styles > div {
  display: grid;
  grid-template-columns: 3.6em 1fr;
  gap: 0.9em;
  padding: 0.8em 0;
  border-top: 0.05rem solid var(--tnt-line);
}

.md-typeset .tnt-styles > div:last-child {
  border-bottom: 0.05rem solid var(--tnt-line);
}

.md-typeset .tnt-styles dt {
  margin: 0;
}

.md-typeset .tnt-styles dd {
  margin: 0;
}

.tnt-tag {
  display: inline-block;
  width: 100%;
  padding: 0.1em 0 0.05em;
  font-family: var(--tnt-display-font);
  font-size: 1.25em;
  font-weight: 400;
  text-align: center;
  color: var(--tnt-bg-deep);
}

.tnt-tag--tpm { background: var(--tnt-phy-tpm); }
.tnt-tag--cpm { background: var(--tnt-phy-cpm); }
.tnt-tag--vq3 { background: var(--tnt-phy-vq3); }
.tnt-tag--vnt { background: var(--tnt-phy-vnt); }



/* --- Content --- */
.md-typeset strong {
  color: #fff;
}

.md-typeset :is(p, li, td) > a:not(.tnt-btn) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
}

.md-typeset :is(p, li, td) > a:not(.tnt-btn):hover {
  text-decoration-color: currentColor;
}

.md-typeset ul li::marker {
  color: var(--tnt-blue);
}

.md-typeset img,
.md-typeset figure img {
  border-radius: 0;
}

.md-typeset kbd {
  white-space: nowrap;
}

.md-typeset .admonition,
.md-typeset details {
  border-radius: 0;
  box-shadow: none;
}



/* --- Blog --- */
/* The header nav replaces Material's sidebars on every page. !important because
   Material re-shows the TOC sidebar with a more specific :not([hidden]) rule. */
.md-sidebar {
  display: none !important;
}

/* Post titles run long; the pixel font is kept for short headings */
.md-post--excerpt .md-typeset h2,
.md-content--post .md-typeset h1 {
  font-family: var(--md-text-font-family);
  font-weight: 800;
  line-height: 1.25;
}

.md-post--excerpt .md-typeset h2 {
  margin: 0.5em 0 0.6em;
  font-size: 1.35em;
}

.md-post--excerpt .md-typeset h2::before {
  display: none;
}

.md-post--excerpt .md-typeset h2 a {
  color: #fff;
  text-decoration: none;
}

.md-post--excerpt .md-typeset h2 a:hover {
  color: var(--tnt-blue-light);
}

.md-post--excerpt {
  margin-bottom: 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 0.05rem solid var(--tnt-line);
}

.md-post--excerpt .md-post__header {
  min-height: 0;
}

.md-post__action a {
  font-weight: 700;
}

.tnt-post-back {
  margin: 0 0 1.4em;
  font-size: 0.85em;
}

.tnt-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em 1.2em;
  font-size: 0.8em;
  color: var(--tnt-muted);
}

.tnt-post-meta__author {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.tnt-post-meta img {
  width: 1.5em;
  height: 1.5em;
}

.tnt-post-meta + h1 {
  margin-top: 0.4em;
}



/* --- Footer --- */
.tnt-footer {
  border-top: 0.1rem solid var(--tnt-line);
  background: var(--tnt-bg-deep);
}

.tnt-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  padding: 1.2rem var(--tnt-gutter);
  font-size: 0.7rem;
  color: var(--tnt-muted);
}

.tnt-footer__inner p {
  margin: 0;
}

.tnt-footer nav {
  display: flex;
  gap: 1.2rem;
}

.tnt-footer a {
  color: var(--tnt-muted);
}

.tnt-footer a:hover {
  color: var(--tnt-text);
}



@media screen and (max-width: 44.9375em) {
  .tnt-header__nav {
    gap: 1rem;
  }

  .tnt-hero__tagline {
    font-size: 1.8rem;
  }
}
