/* Timepile marketing page. No build step, no framework: edit and reload. */

@font-face { font-family: 'Plex Sans'; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }

/* Same tokens as the app (web/src/index.css), so the page and the product look like one thing. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --line: #dde4e2;
  --line-strong: #c2ccca;
  --fg: #121a19;
  --muted: #44504e;
  --subtle: #5f6b69;
  --accent: #0e7c6b;
  --accent-hover: #0a6658;
  --accent-text: #0b6b5c;
  --accent-soft: #ddf2ed;
  --ink: #0f1716;
  --ink-fg: #dfe7e5;
  --ink-muted: #8a9794;
  --p-blue: #2563eb;
  --p-pink: #db2777;
  --p-amber: #d98e04;
  --p-gray: #64748b;
  --p-teal: #0e9384;
  --p-orange: #ea580c;
  --shadow: 0 1px 2px rgb(14 26 24 / 7%), 0 18px 40px -18px rgb(14 26 24 / 28%);
  --sans: 'Plex Sans', system-ui, sans-serif;
  --mono: 'Plex Mono', ui-monospace, monospace;
  --row: 24px; /* the ruled-paper rhythm used by the hero grid */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1312;
    --surface: #151b1a;
    --surface-2: #1c2423;
    --line: #283230;
    --line-strong: #3a4744;
    --fg: #e6ecea;
    --muted: #b1bcb9;
    --subtle: #8a9794;
    --accent: #2cc4ac;
    --accent-hover: #4fd6c0;
    --accent-text: #5fdcc8;
    --accent-soft: #11332e;
    --ink: #070b0a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 18px 40px -18px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
code { font: 500 0.9em var(--mono); background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ── Buttons and links ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 500; padding: 12px 20px; border-radius: 8px;
  transition: background 0.15s;
}
@media (prefers-color-scheme: dark) { .btn { color: #06241f; } }
.btn:hover { background: var(--accent-hover); }
.btn-small { padding: 7px 14px; font-size: 15px; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--accent-soft); }
.link { text-decoration: none; color: var(--muted); }
.link:hover { color: var(--fg); }
.arrow::after { content: ' →'; transition: margin 0.15s; }
.arrow:hover::after { margin-left: 4px; }

/* ── Header ── */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 32px; height: 60px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; font-size: 18px; }
.mark svg { width: 28px; height: 28px; }
.mark rect { fill: var(--accent); }
.mark path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--fg); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: 15px; }
@media (max-width: 880px) { .nav { display: none; } }

/* ── Hero ── */
.hero {
  padding: 72px 0 88px;
  border-bottom: 1px solid var(--line-strong);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 64px; align-items: end; }
.kicker { font-size: 13px; color: var(--subtle); margin-bottom: 20px; }
.hero h1 { font-size: clamp(48px, 8vw, 96px); max-width: 9ch; }
.lede { font-size: 20px; color: var(--muted); max-width: 34em; margin-top: 28px; }

.demo-timer {
  margin-top: 36px; max-width: 560px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow);
}
.demo-timer input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 17px; padding: 8px 0;
}
.demo-timer input::placeholder { color: var(--subtle); }
.demo-clock { font-size: 22px; font-weight: 500; color: var(--subtle); min-width: 5.2ch; text-align: right; }
.running .demo-clock { color: var(--fg); }
.demo-go {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  transition: background 0.15s, transform 0.1s;
}
.demo-go:hover { background: var(--accent-hover); }
.demo-go:active { transform: scale(0.95); }
.demo-go svg { width: 22px; height: 22px; fill: currentColor; }
.demo-go .i-stop, .running .demo-go .i-play { display: none; }
.running .demo-go .i-stop { display: block; }
.running .demo-go { background: #c4321f; }
.demo-hint { font-size: 14px; color: var(--subtle); margin-top: 12px; }
.hero-cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }

/* The pile: today's entries stacked bottom-up, height by duration. */
.pile {
  margin: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; min-height: 460px;
  padding: 0 0 0 20px; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px calc(var(--row) * 2));
  background-position: 0 calc(100% - 64px);
}
.pile-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0 4px 10px; order: 3; margin-top: 10px;
}
.pile-head .mono { font-size: 28px; color: var(--fg); letter-spacing: 0; text-transform: none; font-weight: 500; }
.pile-stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; order: 1; }
.pile-stack li {
  --unit: 11px;
  --h: 0;
  --c: var(--accent);
  position: relative;
  min-height: calc(36px + var(--h) * var(--unit));
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 12px;
  padding: 8px 14px 8px 16px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border-left: 4px solid var(--c);
  border-radius: 4px 6px 6px 4px;
  font-size: 15px; line-height: 1.35;
  box-shadow: 0 1px 0 rgb(14 26 24 / 6%);
}
/* the sample entries (no inline styles: the server's Content-Security-Policy forbids them) */
.pile-stack .p-blue { --c: var(--p-blue); }
.pile-stack .p-gray { --c: var(--p-gray); }
.pile-stack .p-pink { --c: var(--p-pink); }
.pile-stack .p-amber { --c: var(--p-amber); }
.pile-stack .h1 { --h: 1; }
.pile-stack .h5 { --h: 5; }
.pile-stack .h8 { --h: 8; }
.pile-stack .h9 { --h: 9; }
.pile-stack li:nth-child(4n+1) { margin-right: 18px; }
.pile-stack li:nth-child(4n+2) { margin-left: 10px; }
.pile-stack li:nth-child(4n+3) { margin-right: 6px; margin-left: 4px; }
.pile-stack li:nth-child(4n) { margin-left: 22px; }
.pile-stack b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pile-stack i { font-style: normal; color: color-mix(in srgb, var(--c) 75%, var(--fg)); font-size: 14px; grid-row: 2; }
.pile-stack span { grid-row: 1; grid-column: 2; font-size: 14px; color: var(--muted); }
.pile-stack li.live { --c: var(--accent); outline: 1.5px dashed var(--accent); outline-offset: -1.5px; }
.pile-stack li.dropped { animation: drop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
@keyframes drop {
  from { transform: translateY(-90px) rotate(-1.5deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .pile-stack li.dropped { animation: none; } }
.pile-floor { order: 2; height: 3px; background: var(--fg); border-radius: 2px; margin-top: 6px; }

@media (max-width: 900px) {
  .hero { padding: 48px 0 56px; }
  .pile { padding-left: 0; border-left: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .pile { min-height: 0; }
}

/* ── Sections ── */
.sec { padding: 112px 0; border-bottom: 1px solid var(--line); }
.sec-alt { background: var(--surface); }
.sec-head { max-width: 40em; }
.sec-head > p:not(.stamp) { color: var(--muted); margin-top: 18px; }
.sec-head > p + p:not(.stamp) { margin-top: 12px; }
.sec h2 { font-size: clamp(34px, 4.6vw, 52px); }
.small { font-size: 15px; }

/* Each section is stamped with a time of day, as if the page were one day on a calendar. */
.stamp {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500; color: var(--accent-text); margin-bottom: 18px;
}
.stamp::after { content: ''; height: 1px; width: 56px; background: currentColor; opacity: 0.5; }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 64px; align-items: start; }
.split-rev { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.35fr); }
@media (max-width: 960px) { .split, .split-rev { grid-template-columns: 1fr; gap: 40px; } }

/* Screenshots: framed like a window on a desk, never floating in a gradient. */
.shot {
  margin: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--surface);
  box-shadow: var(--shadow);
}
.shot img { width: 100%; }
@media (prefers-color-scheme: dark) { .shot img { filter: brightness(0.92); } }
@media (min-width: 961px) {
  /* the reports shot runs off the right edge of the page */
  .shot-bleed { width: calc(100% + max(16px, (100vw - 1180px) / 2) + 40px); border-right: 0; border-radius: 10px 0 0 10px; }
  #reports { overflow: hidden; }
}

.views { margin-top: 48px; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
}
.seg button {
  font: inherit; font-size: 15px; color: var(--muted); background: transparent;
  border: 0; border-radius: 6px; padding: 6px 16px; cursor: pointer;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-selected='true'] { background: var(--surface); color: var(--fg); font-weight: 500; box-shadow: 0 1px 2px rgb(14 26 24 / 10%); }
.views-note { margin-top: 14px; color: var(--subtle); font-size: 15px; min-height: 1.6em; }

.facts {
  list-style: none; padding: 0; margin: 64px 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px;
}
.facts li { padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); }
.facts b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 4px; }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr; } }

/* A ledger: the features as line items, numbers on the right. */
.ledger { width: 100%; border-collapse: collapse; margin: 32px 0 20px; font-size: 16px; }
.ledger th { text-align: left; font-weight: 400; padding: 9px 0; }
.ledger td { text-align: right; font-family: var(--mono); font-size: 14px; color: var(--accent-text); padding: 9px 0; white-space: nowrap; }
.ledger tr { border-bottom: 1px dotted var(--line-strong); }
.ledger tr:first-child { border-top: 1px solid var(--fg); }
.ledger tr:last-child { border-bottom: 1px solid var(--fg); }
.sec-head .small { color: var(--subtle); }

#teams .shot { margin-top: 48px; }
.defs { margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
.defs div { border-left: 2px solid var(--line-strong); padding-left: 16px; }
.defs dt { font-weight: 600; }
.defs dd { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .defs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .defs { grid-template-columns: 1fr; } }

/* ── Terminal ── */
.sec-ink { background: var(--ink); color: var(--ink-fg); border-bottom: 0; }
.sec-ink .sec-head > p:not(.stamp) { color: var(--ink-muted); }
.sec-ink .stamp { color: #5fdcc8; }
.sec-ink code { background: #1f2a28; color: #e6ecea; }
.term { border-radius: 10px; border: 1px solid #2a3633; background: #0a100f; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid #1d2725; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3633; }
.term-bar span { margin-left: 10px; font: 13px var(--mono); color: #5f6b69; }
.term-body {
  margin: 0; padding: 22px 22px 26px; overflow-x: auto;
  font: 13px/1.7 var(--mono); color: #cfd8d6;
}
.term-body .p { color: #5fdcc8; user-select: none; }
.term-body .o { color: #8a9794; }
.term-body .o b { color: #e6ecea; font-weight: 500; }
.term-body .rule { color: #3a4744; }

/* ── Data ── */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 14px 0 14px 44px; border-top: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 500 14px/1.9 var(--mono); color: var(--accent-text); }
.steps b { color: var(--fg); font-weight: 600; }

/* ── Pricing ── */
.billing { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 16px; margin: 40px 0 24px; }
.billing button {
  font: inherit; font-size: 15px; color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--line-strong); padding: 6px 16px;
}
.billing button:first-of-type { border-radius: 8px 0 0 8px; margin-right: -17px; }
.billing button:nth-of-type(2) { border-radius: 0 8px 8px 0; }
.billing button[aria-checked='true'] { background: var(--fg); border-color: var(--fg); color: var(--bg); position: relative; }
.billing-note { font-size: 14px; color: var(--accent-text); margin-left: 16px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.plan { padding: 28px 28px 32px; display: flex; flex-direction: column; }
.plan + .plan { border-left: 1px solid var(--line-strong); }
.plan h3 { margin: 0; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.plan-main { background: var(--surface); border-radius: 0 12px 12px 0; box-shadow: inset 0 3px 0 var(--accent); }
.plan-main h3 { color: var(--accent-text); }
.price { margin-top: 18px; font-size: 52px; line-height: 1; font-weight: 500; letter-spacing: -0.02em; }
.per { margin-top: 8px; font-size: 14px; color: var(--subtle); min-height: 1.6em; }
.plan ul { list-style: none; padding: 0; margin: 28px 0 32px; flex: 1; font-size: 15px; }
.plan li { padding: 7px 0 7px 22px; position: relative; border-top: 1px dotted var(--line-strong); }
.plan li::before { content: ''; position: absolute; left: 2px; top: 15px; width: 9px; height: 5px; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.plan li.all { color: var(--subtle); font-size: 14px; }
.plan li.all::before { display: none; }
.plan li.all { padding-left: 0; }
.plan .btn { align-self: flex-start; }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.fine { margin-top: 16px; color: var(--subtle); }
@media (max-width: 900px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line-strong); }
  .plan-main { border-radius: 0 0 12px 12px; }
}

/* ── End of day ── */
.end { background: var(--accent); color: #fff; padding: 96px 0; }
@media (prefers-color-scheme: dark) { .end { background: #0b5e52; } }
.end .stamp { color: #fff; }
.end h2 { font-size: clamp(40px, 6vw, 72px); }
.end p:not(.stamp):not(.spent) { margin: 18px 0 32px; max-width: 32em; font-size: 19px; color: rgb(255 255 255 / 85%); }
.end-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
.spent { display: grid; gap: 4px; text-align: right; font-size: 13px; color: rgb(255 255 255 / 75%); text-transform: uppercase; letter-spacing: 0.06em; }
.spent b { font-size: clamp(40px, 6vw, 64px); color: #fff; font-weight: 500; letter-spacing: 0; line-height: 1.1; }
.spent .nb { font-size: 12px; justify-self: end; border: 1px solid rgb(255 255 255 / 50%); border-radius: 4px; padding: 1px 6px; }
@media (max-width: 640px) { .spent { text-align: left; } .spent .nb { justify-self: start; } }

/* ── Footer ── */
.foot { padding: 28px 0 40px; font-size: 14px; color: var(--subtle); }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot-row span:first-child { font-weight: 600; color: var(--fg); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot-note { margin-left: auto; }
@media (max-width: 640px) { .foot-note { margin-left: 0; width: 100%; } }
