/*
 * irondiary.soleer.com — one stylesheet for every page.
 *
 * Colors are the app's own tokens (workoutapp/src/design/theme/tokens.ts)
 * so the site and the screenshots on it read as one product. Always dark,
 * like the app — deliberately no prefers-color-scheme: light variant.
 */

:root {
  --bg: #0f1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e1e4e8;
  --muted: #8b949e;
  --primary: #388bfd;
  --success: #3fb950;
  --warning: #f0883e;
  --radius: 12px;
  --max: 1040px;
  --prose: 720px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
img, video { max-width: 100%; display: block; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--prose); }

/* ─── Header / footer ─────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ─── Type ────────────────────────────────────────────────────────── */

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.5px; margin: 0 0 16px; }
h2 { font-size: 1.6rem; margin: 56px 0 12px; }
h3 { font-size: 1.1rem; margin: 28px 0 6px; }
.eyebrow {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 620px; }

/* ─── Buttons ─────────────────────────────────────────────────────── */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--primary);
}
.button.primary { background: var(--primary); color: #fff; }
.button.secondary { color: var(--primary); background: var(--surface); }

/* ─── Landing ─────────────────────────────────────────────────────── */

.hero { padding: 72px 0 24px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.fine { color: var(--muted); font-size: 0.85rem; margin-top: 14px; }

/* The hero phone matches the height of the text column beside it. It's
   positioned absolutely inside its grid cell so it can't feed back into
   the row height: the text alone sizes the row, the phone fills that
   height, and its width follows from the aspect ratio. */
.hero-media { position: relative; align-self: stretch; }
.hero-media .shot {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  /* On narrower desktops the text wraps taller; never let the phone grow
     wider than its column (the video crops to fit instead). */
  max-width: 100%;
  border-radius: 44px;
}
.card table { margin: 8px 0 12px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); }

/* Landing sections need real air between them: the phone-shaped
   screenshots are taller than the text beside them. The `.wrap` in the
   selector is for specificity: `.wrap`'s own `margin: 0 auto` would
   otherwise win and zero the top margin. */
main > section + section.wrap { margin-top: 96px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* ─── Screenshots (placeholders until real captures land) ─────────── */

.shot {
  margin: 0;
  aspect-ratio: 9 / 19.5;
  max-width: 260px;
  width: 100%;
  justify-self: center;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 36px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shot img, .shot video { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { color: var(--muted); font-size: 0.85rem; padding: 24px; text-align: center; }
.shot[data-todo] { border-style: dashed; }

/* Video in a phone frame; same shape as the screenshots. */
.shot.video video { width: 100%; height: 100%; object-fit: cover; }

/* A row of phones with a caption under each. */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.gallery figure { margin: 0; }
.gallery .shot { max-width: none; border-radius: 28px; }
.gallery figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 12px; text-align: center; }

/* ─── Guides ──────────────────────────────────────────────────────── */

.guide { padding-top: 48px; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin: 18px 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
}
.callout.warn { border-left-color: var(--warning); }
.callout p { margin: 0; }
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}
.toc ol { margin: 6px 0 0; padding-left: 20px; }
.ui { font-weight: 700; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }

/* Guided / Advanced: two alternative ways to do one step, as tabs styled
   like the app's segmented switch. One panel shows at a time once the
   script runs (.tabs-ready); without it both panels show in sequence. */
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 22px 0 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.mode-tab {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
  padding: 14px 16px; border-radius: 11px; border: 0; background: transparent;
}
.mode-tab strong { font-size: 1.05rem; }
.mode-tab span { color: var(--muted); font-size: 0.88rem; line-height: 1.35; }
.mode-tab[aria-selected="true"] { background: var(--primary); }
.mode-tab[aria-selected="true"] span { color: rgba(255, 255, 255, 0.85); }
.mode-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
html:not(.tabs-ready) .mode-tabs { display: none; }
.mode-panel {
  margin-top: 14px; padding: 4px 22px 22px;
  border: 1px solid var(--border); border-radius: 16px;
}
html:not(.tabs-ready) .mode-panel + .mode-panel { margin-top: 24px; }
.panel-title { margin-top: 20px; }
.panel-title span { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.mode-panel .shot { margin-top: 18px; }
/* The 1RM formula: monospace, line-numbered by its own comments. */
.formula {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; line-height: 1.55; font-size: 0.95rem;
}
.formula .c { color: var(--muted); }
.formula sub, .formula sup { font-size: 0.7em; }
/* Wide tables scroll sideways on phones instead of squashing. */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 560px; }
.refs li { margin: 10px 0; }

h4 { font-size: 1rem; margin: 22px 0 4px; }
.toc-more { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; }

/* ─── Small screens ───────────────────────────────────────────────── */

@media (max-width: 760px) {
  .hero { padding-top: 40px; }
  .hero .wrap, .split { grid-template-columns: 1fr; gap: 32px; }
  main > section + section.wrap { margin-top: 64px; }
  .shot { max-width: 220px; }
  .hero-media .shot {
    position: static; transform: none;
    height: auto; width: 100%; max-width: 260px; border-radius: 36px;
  }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .mode-panel { padding: 4px 14px 18px; }
  .gallery .shot { border-radius: 22px; }
  /* In a single column the screenshot reads after its text, not before. */
  .split > .shot:first-child { order: 2; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.85rem; white-space: nowrap; }
  h2 { margin-top: 44px; }
}
