/*
 * IntraFitness site styling.
 *
 * The palette and faces are the app's, taken from lib/theme.ts rather
 * than approximated: ink #08060F behind everything, one blue accent
 * doing all the emphasis, Cinzel for display, Spectral for reading,
 * JetBrains Mono for the small uppercase labels. The app's engraved
 * details carry over too -- the double rule under headings, the
 * bracket corners around panels -- so the site reads as the same
 * object as the app rather than a marketing page about it.
 */
:root {
  --ink: #08060f;
  --void: #040309;
  --panel: #17121f;
  --panel-raised: #211a2c;
  --line: #332c42;
  --line-soft: #231d2f;
  --bone: #f5f7ff;
  --fog: #abb2c9;
  --accent: #3e8eff;
  --accent-light: #6faaff;
  --accent-soft: #2a5ba8;
  --accent-wash: rgba(62, 142, 255, 0.09);
  --bronze: #7f93c4;

  --display: "Cinzel", Georgia, serif;
  --body: "Spectral", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  /*
   * A single wash of accent behind the top of the page, the way the
   * app's ScreenGlow sits behind its headers. Fixed rather than
   * repeated per section, so it never seams.
   */
  background-image: radial-gradient(
    120% 55% at 50% -12%,
    rgba(62, 142, 255, 0.13),
    transparent 62%
  );
  background-repeat: no-repeat;
}

/* One gutter rule for the whole site, set once, never overridden. */
.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.wrap.narrow {
  max-width: 42rem;
}

/* ---------- chrome ---------- */

header.site {
  border-bottom: 1px solid var(--line-soft);
  padding-block: 20px;
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 24px;
}

.wordmark {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.045em;
  color: var(--accent);
  text-decoration: none;
}

.wordmark:hover,
.wordmark:focus-visible {
  color: var(--accent-light);
}

nav.site {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

nav.site a {
  color: var(--fog);
  text-decoration: none;
}

nav.site a:hover,
nav.site a:focus-visible {
  color: var(--bone);
}

footer.site {
  border-top: 1px solid var(--line-soft);
  padding-block: 30px 48px;
  color: var(--fog);
  font-size: 14.5px;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: baseline;
}

footer.site a {
  color: var(--fog);
}

footer.site a:hover,
footer.site a:focus-visible {
  color: var(--bone);
}

/* ---------- type ---------- */

main {
  padding-block: 0 88px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(34px, 7.4vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-wrap: balance;
  margin: 0 0 20px;
}

h2 {
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 27px);
  font-weight: 600;
  line-height: 1.22;
  text-wrap: balance;
  margin: 0 0 14px;
}

h3 {
  font-family: var(--body);
  font-size: 18.5px;
  font-weight: 600;
  margin: 0 0 8px;
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
}

a {
  color: var(--accent);
}

a:hover,
a:focus-visible {
  color: var(--bone);
}

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

.lede {
  font-size: clamp(18px, 2.6vw, 21px);
  line-height: 1.55;
  color: var(--fog);
  margin-bottom: 30px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 16px;
}

.updated {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 36px;
}

.mail {
  font-family: var(--mono);
  font-size: 15px;
  word-break: break-word;
}

/*
 * The app's DoubleRule: a hairline, a gap, a second hairline. Used
 * under the hero and between sections, not as decoration on every
 * block.
 */
.rule {
  border: 0;
  height: 4px;
  margin: 0 0 34px;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) top / 100% 1px no-repeat,
    linear-gradient(var(--line-soft), var(--line-soft)) bottom / 100% 1px no-repeat;
}

.rule.wide {
  margin: 56px 0;
}

/* ---------- sections ---------- */

.hero {
  padding-block: 72px 56px;
}

section {
  padding-block: 44px;
  border-top: 1px solid var(--line-soft);
}

section.plain {
  border-top: 0;
}

.section-head {
  margin-bottom: 26px;
}

/* ---------- the progression figure ---------- */

.figure {
  margin: 0 0 8px;
}

.figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-top: 14px;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.steps li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 18px;
  margin: 0;
}

.step-n {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
}

.steps p {
  margin: 0;
  color: var(--fog);
}

.steps h3 {
  margin-bottom: 5px;
}

/* ---------- panels, with the app's bracket corners ---------- */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 26px;
  margin: 0 0 20px;
}

.panel :last-child {
  margin-bottom: 0;
}

.panel.accent {
  border-color: var(--accent-soft);
  background: linear-gradient(var(--accent-wash), var(--accent-wash)), var(--panel);
}

/*
 * Bracket corners, drawn as two boxes with only two borders each. The
 * app frames its media plates and seals this way.
 */
.panel.bracketed::before,
.panel.bracketed::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent-soft);
  pointer-events: none;
}

.panel.bracketed::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.panel.bracketed::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}

.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.cards .panel {
  margin: 0;
  min-width: 0;
}

.cards p {
  color: var(--fog);
  font-size: 16px;
}

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

.button {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(var(--accent-light), var(--accent));
  border-radius: 3px;
  padding: 14px 24px;
}

.button:hover,
.button:focus-visible {
  color: var(--ink);
  background: var(--accent-light);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 8px;
}

.cta-note {
  font-size: 15px;
  color: var(--fog);
  margin: 0;
}

/* ---------- tables (privacy page) ---------- */

.scroll {
  overflow-x: auto;
  margin: 24px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 15.5px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

th {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 400;
  white-space: nowrap;
}

/* ---------- long-form legal pages ---------- */

/*
 * main's top padding is zero so the home page's hero can set its own.
 * A document page has no hero, so it takes the padding here instead.
 */
.doc {
  padding-top: 56px;
}

.doc h2 {
  margin-top: 44px;
}

.doc h3 {
  margin-top: 28px;
}

.doc section {
  padding-block: 0;
  border-top: 0;
}
