/* orka. Read on a phone first.
 *
 * The marathon dashboard's design system, carried over: Daylight by default (paper, deep
 * ink), Graphite when the phone is in dark mode, and one vivid pink that only ever means
 * you, now, next. Green is done, blue is the plan, orange is short or at risk.
 * Type: Familjen Grotesk (made in Stockholm) for reading, Big Shoulders Display, a race-bib
 * condensed, for headings and the big numbers. Both are SIL OFL, self-hosted (fonts/).
 * The one memorable thing on the landing page is the track: today as the pink dot, the
 * plan as a line out to the goal. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* Only for Google's sign-in button, which its branding guidelines set in Roboto Medium. */
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Big Shoulders Display";
  src: url("/static/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  /* Daylight */
  --page: #f4f7fb;
  --panel: #ffffff;
  --line: #dfe6ef;
  --line-2: #c3cfde;
  --ink: #0e1a2b;
  --ink-2: #33435a;
  --mist: #5b6a80;
  --lamp: #e8157a;      /* you, now, next */
  --lamp-ink: #c8106a;  /* the same, at 4.5:1 for text and button fills */
  --on-lamp: #ffffff;
  --plan: #2f80ed;      /* the plan */
  --done: #1fa257;      /* done, met, target */
  --error: #a84800;

  --body: "Familjen Grotesk", system-ui, -apple-system, sans-serif;
  --bib: "Big Shoulders Display", "Familjen Grotesk", system-ui, sans-serif;

  --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  /* Graphite */
  :root {
    --page: #111214;
    --panel: #18191c;
    --line: #26282c;
    --line-2: #3a3d43;
    --ink: #ececee;
    --ink-2: #c2c4c9;
    --mist: #8e9199;
    --lamp: #e0338a;
    --lamp-ink: #ff7ab8;
    --on-lamp: #111214;
    --plan: #8f7fd6;
    --done: #2ea55f;
    --error: #ffad66;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lamp-ink); color: var(--on-lamp); }

main {
  max-width: 30rem;
  margin: 0 auto;
  padding: max(var(--s5), env(safe-area-inset-top)) var(--s5)
    max(var(--s7), env(safe-area-inset-bottom));
}

/* The mark and the name, top left on every page. */
.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s7);
  color: var(--ink);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.mark { width: 34px; height: 34px; fill: none; stroke-linecap: round; }
.mark-wave { stroke: var(--line-2); stroke-width: 2.5; }
.mark-run { stroke: var(--ink); stroke-width: 5; }
.mark-dot { fill: var(--lamp); }

h1 {
  margin: 0 0 var(--s4);
  font-family: var(--bib);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.landing h1 { font-size: clamp(3.25rem, 15vw, 4.5rem); margin-bottom: var(--s6); }

p { margin: 0 0 var(--s5); color: var(--ink-2); max-width: 34em; text-wrap: pretty; }

/* ---------- the track: today, the plan, the goal ---------- */
.track { margin: 0 0 var(--s6); }
.track svg { display: block; width: 100%; height: auto; overflow: visible; }
.track .rail { stroke: var(--line-2); stroke-width: 2; }
.track .tick { stroke: var(--line-2); stroke-width: 2; stroke-linecap: round; }
.track .plan {
  stroke: var(--plan);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 0;
  animation: plan-out 1.4s cubic-bezier(.3, .7, .2, 1) .2s both;
}
.track .goal { fill: var(--page); stroke: var(--done); stroke-width: 4; }
.track .today { fill: var(--lamp); }
.track .halo { fill: var(--lamp); opacity: .18; }
.track-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s2);
  font-size: 15px;
  font-weight: 600;
}
.track-labels .now { color: var(--lamp-ink); }
.track-labels .then { color: var(--mist); }

@keyframes plan-out { from { stroke-dashoffset: 300; } }

@media (prefers-reduced-motion: reduce) {
  .track .plan { animation: none; }
}

/* ---------- next: the one step that comes after this page ---------- */
.next {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  padding: var(--s5);
  margin-top: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.next-dot {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--lamp) 18%, transparent);
}
.next-label {
  margin: 0;
  color: var(--lamp-ink);
  font-size: 15px;
  font-weight: 600;
}
.next h2 {
  margin: 0 0 var(--s2);
  font-family: var(--bib);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.05;
}
.next p:last-child { margin-bottom: 0; }

/* ---------- actions ---------- */
.button, button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px var(--s5);
  border: 2px solid var(--lamp-ink);
  border-radius: var(--r);
  background: var(--lamp-ink);
  color: var(--on-lamp);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.button:active, button:active { transform: translateY(1px); }

button.secondary {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
  font-weight: 600;
}

button:disabled { opacity: .6; cursor: progress; }

/* Signing out is never the point of a page, so it stays out of the way. */
.signout { margin-top: var(--s6); }
.signout button {
  display: inline-block;
  width: auto;
  min-height: 44px;
  padding: 9px var(--s5);
  font-size: 15px;
}

:where(a, button):focus-visible {
  outline: 3px solid var(--lamp);
  outline-offset: 3px;
}

.form-error { color: var(--error); margin-top: var(--s3); font-size: 15px; }

/* ---------- Sign in with Google ----------
 * Google's branding guidelines, not orka's palette: the standard G, Roboto Medium, a neutral
 * light button (white, #747775 outline, #1F1F1F text) and its dark twin (#131314, #8E918F,
 * #E3E3E3). Scaled up for touch; the proportions follow Google's pill button. */
.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s5);
  border: 1px solid #747775;
  border-radius: 26px;
  background: #ffffff;
  color: #1f1f1f;
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.25px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.google-signin:active { background: #f2f2f2; }
.google-g { width: 20px; height: 20px; flex: none; }
:where(.google-signin):focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }

@media (prefers-color-scheme: dark) {
  .google-signin { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  .google-signin:active { background: #1f1f20; }
}
