/* TMIR website: paper #F5F1E6, ink #292820, red #A94134. Jost for display, system sans for body. */

@font-face {
  font-family: "Jost";
  src: url("/assets/Jost-200.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5f1e6;
  --ink: #292820;
  --red: #a94134;
  --muted: #6f6a5c;
  --line: #ddd3bd;
  --card: #efe8d6;
  --white: #fffdf8;
  --focus: #1f5fa8;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

main {
  display: block;
}

a {
  color: var(--red);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* ---------- Home composition ---------- */

.home {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  text-align: center;
}

.brand-icon {
  display: block;
  margin: 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 1px 4px rgba(41, 40, 32, 0.25);
}

.brand-name {
  font-family: "Jost", "Avenir Next", "Century Gothic", sans-serif;
  font-weight: 200;
  font-size: 2.6rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0.9rem 0 0.4rem;
}

.tagline {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.availability {
  margin: 0.75rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
}

.site-header nav {
  display: flex;
  justify-content: flex-end;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- Demo frame: self-hosted simulator recording ---------- */

.demo-wrap {
  margin: 0 auto;
  max-width: 402px;
}

.demo-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0.3rem auto 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.demo-toggle:hover { color: var(--ink); }
.demo-toggle[data-state="playing"] .icon-play,
.demo-toggle[data-state="paused"] .icon-pause { display: none; }

/* Native phone-width frame; the recording keeps its full 402x874 aspect
   and is never cropped. */
.demo-frame {
  margin: 0 auto;
  width: 100%;
  max-width: 402px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 6px 24px rgba(41, 40, 32, 0.12);
  overflow: hidden;
  padding: 0;
}

.demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 402 / 874;
  object-fit: contain;
  background: #141311;
}

.demo-fallback {
  margin: 0;
  padding: 0 0 0.2rem;
}

.demo-fallback img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 402 / 874;
  object-fit: contain;
  background: #141311;
}

.demo-fallback p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.8rem 1rem 0.6rem;
  text-align: center;
}

.demo-retry {
  font: inherit;
  font-size: 0.9rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin: 0 auto;
  display: block;
  cursor: pointer;
}

.demo-retry:hover {
  border-color: var(--ink);
}

.demo-error-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.6rem 1rem 0;
  text-align: center;
}

.demo-caption {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.9rem 1rem 0;
  text-align: center;
}

/* ---------- Prose pages ---------- */

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.prose-header {
  text-align: center;
  margin-bottom: 2rem;
}

.prose-header img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.prose-header p {
  margin: 0.3rem 0 0;
}

.prose-header .brand-link {
  font-family: "Jost", sans-serif;
  font-weight: 200;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
}

.prose h1 {
  font-family: "Jost", sans-serif;
  font-weight: 200;
  font-size: 2.1rem;
  margin: 0.5rem 0 0.6rem;
  line-height: 1.2;
}

.prose h2 {
  font-family: "Jost", sans-serif;
  font-weight: 200;
  font-size: 1.5rem;
  margin: 2rem 0 0.5rem;
  line-height: 1.3;
}

.prose p,
.prose li {
  font-size: 0.98rem;
}

.prose ul {
  padding-left: 1.3rem;
}

.prose .updated {
  color: var(--muted);
  font-size: 0.9rem;
}

.back-links {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Helpers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 2.1rem;
  }

  .home {
    padding: 2rem 1rem 4rem;
  }

}

[hidden] { display: none !important; }
