/* Personal Success Tracker website.
   Colours are the app's theme tokens (PersonalSuccess/Themes/Theme.xaml); the face is the app's own, Open Sans (fonts/OFL.txt). */
@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0B0D12;       /* BackgroundColor */
  --sky-top: #101627;     /* SkyTopColor */
  --hairline: #262C3A;    /* HairlineColor */
  --text: #F2F4F8;        /* TextPrimaryColor */
  --text-2: #A3ACBD;      /* TextSecondaryColor */
  --summit: #FFB547;      /* SummitColor */

  --gutter: clamp(20px, 5vw, 64px);
  --max: 78rem;
  --measure: 36rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: var(--night);
  scrollbar-color: var(--hairline) var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--summit); color: var(--night); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { text-wrap: balance; font-weight: 600; }
p { text-wrap: pretty; }

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--summit) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}
a:hover { color: var(--summit); text-decoration-color: var(--summit); }
:focus-visible { outline: 2px solid var(--summit); outline-offset: 4px; border-radius: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--summit); color: var(--night); font-weight: 600; text-decoration: none;
  padding: 10px 16px; border-radius: 6px;
}
.skip:focus { top: 12px; }
.skip:hover { color: var(--night); } /* a:hover would turn it amber on amber */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 3; }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px;
  padding-top: 18px; padding-bottom: 18px;
}
.brand {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 1rem; letter-spacing: -0.005em;
}
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; margin-right: 12px; }
.site-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
/* Narrow screens keep the header on one line: the on-device name, then stacked as a wordmark. Below 22.5rem it wraps under the brand. */
@media (max-width: 33rem) { .brand-tail { display: none; } .site-header .wrap { column-gap: 20px; } .site-nav ul { gap: 20px; } }
@media (min-width: 22.5rem) and (max-width: 27.5rem) { .brand > span { width: min-content; line-height: 1.15; } }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text-2); text-decoration: none; font-size: 0.9375rem;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline 2px var(--summit); text-underline-offset: 0.5em;
}

/* ---------- Home: hero ---------- */
/* The pre-dawn sky. The ridge runs across the foot of the hero, in front of the screen, so the app rises from behind the mountains. */
.home { background: linear-gradient(var(--sky-top), var(--night) min(1100px, 120vh)) no-repeat, var(--night); }
.hero {
  position: relative; overflow: hidden;
  --ridge-h: max(150px, 22.23vw); /* the ridge art is 1440x320: from 675px wide it is drawn whole, never cropped at the top */
}
.hero .wrap {
  display: grid; gap: 48px;
  padding-top: clamp(24px, 5vw, 72px);
}
.hero h1 {
  font-size: clamp(3rem, 1.5rem + 6.4vw, 6rem);
  line-height: 0.98; letter-spacing: -0.04em; font-weight: 650;
  margin: 0 0 clamp(24px, 3vw, 36px);
  max-width: 12ch;
}
.hero .lead {
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem); line-height: 1.5;
  color: var(--text-2); max-width: 30rem; margin: 0 0 28px;
}
.hero .lead strong { color: var(--text); font-weight: 600; }
.availability { margin: 0; color: var(--text-2); font-size: 0.9375rem; max-width: 30rem; }
.availability strong { color: var(--summit); font-weight: 600; }

/* Narrow screens: the screen sits left, so the summit light falls beside it and the route never crosses it */
.hero-shot { margin: 0; width: min(280px, 60%); }
.screen { border-radius: 34px; outline: 1px solid var(--hairline); outline-offset: -1px; }
.hero-shot .screen { border-radius: 36px 36px 0 0; }

.ridge {
  position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2;
  width: 100%; height: var(--ridge-h); pointer-events: none;
}

@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: 32px; }
  .hero-copy { padding-top: clamp(32px, 6vw, 96px); padding-bottom: calc(var(--ridge-h) * 0.9); }
  .hero-shot { width: min(380px, 100%); margin: 0 0 0 auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .route { stroke-dasharray: 1400; animation: climb 2.4s 0.3s var(--ease) backwards; }
  .route-flag, .summit-light { animation: arrive 0.8s 1.9s var(--ease) backwards; }
  @keyframes climb { from { stroke-dashoffset: 1400; } }
  @keyframes arrive { from { opacity: 0; } }
}

/* ---------- Home: sections ---------- */
.part { padding: clamp(72px, 10vw, 152px) 0 0; }
.part h2 {
  font-size: clamp(2.125rem, 1.25rem + 3.2vw, 3.75rem);
  line-height: 1.04; letter-spacing: -0.035em;
  margin: 0 0 24px; max-width: 14ch;
}
.part p { color: var(--text-2); max-width: var(--measure); margin: 0 0 16px; }
.part p strong { color: var(--text); font-weight: 600; }
.part figure { margin: 0; }
@media (min-width: 60rem) { .part p { font-size: 1.125rem; } }
.part figcaption { color: var(--text-2); font-size: 0.875rem; margin-top: 14px; max-width: 30rem; }

/* Two-part compositions: words and the screen that proves them. Each part sets its own columns. */
.duo { display: grid; gap: 40px; align-items: center; }
@media (min-width: 60rem) {
  .duo { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 32px; }
  .camps-part .words { grid-column: 1 / span 5; }
  .camps-part figure { grid-column: 7 / span 6; }
  .tap-part figure { grid-column: 1 / span 7; grid-row: 1; }
  .tap-part .words { grid-column: 9 / span 4; grid-row: 1; }
  .runs-part .words { grid-column: 1 / span 5; align-self: start; position: sticky; top: 48px; }
  .runs-part figure { grid-column: 7 / span 5; }
}

.widget { border-radius: 5.9% / 10.6%; }

/* The whole climb: the app's own sky, full width */
.mountain-part {
  margin-top: clamp(72px, 10vw, 152px);
  padding: clamp(64px, 8vw, 120px) 0;
  background: linear-gradient(var(--night), var(--sky-top) 30%, var(--sky-top) 70%, var(--night));
}
.mountain-part .duo { align-items: center; }
.mountain-part figure { width: min(440px, 100%); }
@media (min-width: 60rem) {
  .mountain-part .words { grid-column: 1 / span 5; }
  .mountain-part figure { grid-column: 7 / span 5; }
}

/* Everything else in 1.1: one quiet list */
.more { padding-top: clamp(72px, 9vw, 128px); }
.more h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.025em; margin: 0 0 28px; max-width: none; }
.more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px 48px; max-width: 64rem; }
.more li { color: var(--text-2); padding-left: 22px; position: relative; max-width: 30rem; }
.more li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--summit); }
.more li strong { color: var(--text); font-weight: 600; }
@media (min-width: 52rem) { .more ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The promise */
.promise { padding: clamp(96px, 13vw, 200px) 0 clamp(80px, 10vw, 144px); }
.promise h2 {
  font-size: clamp(2.5rem, 1.25rem + 5vw, 5.25rem);
  line-height: 1; letter-spacing: -0.04em; font-weight: 650;
  margin: 0 0 32px; max-width: 12ch;
}
.promise p { color: var(--text-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); max-width: 34rem; margin: 0 0 20px; }
.promise .wrap { display: grid; }
@media (min-width: 60rem) {
  .promise .wrap { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
  .promise h2 { grid-column: 1 / span 7; }
  .promise .words { grid-column: 8 / span 5; padding-top: 0.6rem; }
}

/* ---------- Text pages: Support, Privacy, 404 ---------- */
.page { padding: clamp(32px, 6vw, 88px) 0 clamp(80px, 10vw, 144px); }
.page-head h1 {
  font-size: clamp(2.75rem, 1.5rem + 5vw, 5rem);
  line-height: 1; letter-spacing: -0.04em; font-weight: 650;
  margin: 0 0 24px;
}
.page-head .lead { font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem); line-height: 1.5; color: var(--text-2); max-width: 34rem; margin: 0; }

.mail { margin: 36px 0 12px; font-size: clamp(1.5rem, 1rem + 2.2vw, 2.5rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.mail a { overflow-wrap: anywhere; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.mail-note { color: var(--text-2); max-width: 34rem; margin: 0; font-size: 0.9375rem; }

.columns { display: grid; gap: 48px; margin-top: clamp(56px, 7vw, 96px); padding-top: 32px; border-top: 1px solid var(--hairline); }
@media (min-width: 60rem) {
  .columns { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
  .columns > aside { grid-column: 1 / span 4; }
  .columns > aside > * { position: sticky; top: 32px; }
  .columns > .prose { grid-column: 5 / span 7; }
}

.aside-title { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); margin: 0 0 12px; letter-spacing: 0.01em; }
.toc { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; line-height: 1.45; }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 0; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); }

.facts { margin: 0; font-size: 0.9375rem; display: grid; gap: 16px; }
.facts dt { color: var(--text-2); font-size: 0.8125rem; font-weight: 600; }
.facts dd { margin: 2px 0 0; color: var(--text); }

.prose { max-width: 40rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); line-height: 1.25; letter-spacing: -0.02em;
  margin: 64px 0 14px; scroll-margin-top: 24px;
}
.prose h2:first-child, .policy > h2:first-of-type { margin-top: 48px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; color: var(--text-2); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { color: var(--summit); font-weight: 600; }
.prose strong { color: var(--text); font-weight: 600; }
.policy > p:first-child { color: var(--text); font-size: 1.1875rem; line-height: 1.55; }
.site-note { margin-top: 64px; padding-top: 8px; border-top: 1px solid var(--hairline); }

/* 404 */
.lost { position: relative; overflow: hidden; min-height: calc(100vh - 80px); min-height: calc(100svh - 80px); }
.lost .page-head { position: relative; z-index: 1; padding-bottom: 200px; }
.lost ul { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 1.0625rem; }
.lost ul a { display: inline-block; padding: 6px 0; }
.lost .ridge { height: clamp(140px, 22vw, 300px); z-index: 0; }

/* ---------- Footer ---------- */
.site-footer { color: var(--text-2); font-size: 0.875rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px;
  padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--hairline);
  max-width: calc(var(--max) - 2 * var(--gutter)); padding-left: 0; padding-right: 0;
  width: calc(100% - 2 * var(--gutter));
}
.site-footer p { margin: 0; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--text-2); display: inline-block; padding: 8px 0; text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .site-nav a { transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease); }
}

/* ---------- Print (the privacy policy and support answers on paper) ---------- */
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .skip, .site-nav, .site-footer ul, .ridge, aside nav, .hero-shot { display: none; }
  .wrap { padding: 0; }
  .site-header .wrap, .site-footer .wrap { border: 0; width: auto; }
  .site-note { margin-top: 24pt; }
  .site-note h2:first-child { margin-top: 12pt; }
  .brand { color: #000; }
  .page { padding: 12pt 0 0; }
  .page-head h1 { font-size: 26pt; }
  .page-head .lead, .prose p, .prose ul, .prose ol, .facts dt, .facts dd, .policy > p:first-child, .site-footer, .mail-note, .aside-title { color: #000; }
  .prose strong, .prose h2 { color: #000; }
  .prose h2 { font-size: 14pt; margin: 18pt 0 6pt; break-after: avoid; }
  .prose li::marker { color: #000; }
  .columns { display: block; border-top: 1px solid #999; margin-top: 18pt; }
  .columns > aside { margin-bottom: 12pt; }
  .columns > aside > * { position: static; }
  .facts { display: block; }
  .facts div { display: inline-block; margin-right: 24pt; }
  .prose { max-width: none; }
  .site-note { border-top: 1px solid #999; }
  a { color: #000; text-decoration-color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .mail { font-size: 16pt; }
}
