/* toggl pill demo: shared styles for index.html and launch.html.
   Visual language: warm paper ground, 1px ink outlines, lowercase headings,
   one accent (the pill's own Toggl purple). */

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --ink: #1a1a1a;
  --ink-soft: #5d5952;
  --line: #1a1a1a;
  --line-soft: #c9c3b6;
  --accent: #a84c9d;
  --accent-ink: #ffffff;
  --accent-soft: #eadbe7;
  --dark: #191919;
  --gutter: clamp(20px, 4.2vw, 84px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.08;
  max-width: 18ch;
}

h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
}

h3 {
  font-size: 19px;
  letter-spacing: -0.01em;
}

h4 {
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: 19px;
  margin: 0;
}

/* A section title inside a band: h3 in the outline, h2 on the page. */
.h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
}

.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---- buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  transition: background-color 140ms ease;
}
.btn:hover .dot { background: #fff; }

.btn-lg { padding: 18px 30px; font-size: 19px; }
.btn-lg .dot { width: 10px; height: 10px; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- top bar --------------------------------------------------------- */

/* Sticky so the three deliverable tabs stay reachable while reading. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.wordmark::before {
  content: "";
  display: inline-block;
  width: 34px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.wordmark:hover { text-decoration: none; }

/* Tabs: scroll targets for the three deliverables. The current one carries
   an accent rule that sits on the bar's bottom border. */
.tabs {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 48px);
  font-size: 17px;
}
.tabs a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  color: var(--ink);
}
.tabs a .num {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.tabs a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -19px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}
.tabs a[aria-current="true"]::after { transform: scaleX(1); }
.tabs a:hover { text-decoration: none; color: var(--accent); }
.tabs a:hover .num { color: var(--accent); }

/* ---- hero ------------------------------------------------------------- */

.hero {
  padding-top: clamp(64px, 9vw, 140px);
  padding-bottom: clamp(64px, 8vw, 120px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 120px);
  align-items: end;
}

.hero .lede {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 44ch;
  margin-top: 28px;
}

.hero .lede + .lede { margin-top: 16px; color: var(--ink-soft); }

.hero-cta {
  border: 1px solid var(--line);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-cta .fine {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-cta .fine li {
  padding-left: 16px;
  position: relative;
}
.hero-cta .fine li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.attribution {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 40px;
  max-width: 60ch;
}

/* ---- deliverable bands ----------------------------------------------- */
/* The page has three bands, one per deliverable, each a tab's scroll target.
   scroll-margin keeps anchors clear of the sticky bar. */

.band {
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.band-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 18px;
  align-items: baseline;
  padding-top: clamp(48px, 6vw, 96px);
  padding-bottom: clamp(32px, 4vw, 56px);
}

.band-head .num {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.band-head h2 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
}

.band-lede {
  grid-column: 2;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 60ch;
}

.band-actions {
  grid-column: 2;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.band > .section { padding-top: clamp(32px, 4vw, 64px); }

/* ---- insights --------------------------------------------------------- */

.insights {
  display: grid;
  grid-template-columns: minmax(200px, 0.6fr) minmax(0, 2fr);
  gap: clamp(28px, 4vw, 72px);
  padding-bottom: clamp(56px, 7vw, 110px);
}

.toc {
  position: sticky;
  top: 108px;
  align-self: start;
  display: grid;
  gap: 2px;
  font-size: 16px;
}
.toc a {
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.toc a:hover {
  color: var(--ink);
  border-left-color: var(--ink);
  text-decoration: none;
}

.insight {
  padding: 28px 0 32px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 14px;
  scroll-margin-top: 108px;
}
.insight:last-child { border-bottom: 1px solid var(--line-soft); }
.insight h3 { font-size: clamp(22px, 2vw, 28px); }
.insight p,
.insight li {
  font-size: 17px;
  line-height: 1.6;
  max-width: 66ch;
}
.insight ul, .insight ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.placeholder { color: var(--ink-soft); font-style: italic; }

/* ---- loom -------------------------------------------------------------- */

.video {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 17px;
  margin-bottom: clamp(56px, 7vw, 110px);
}
.video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- section shell --------------------------------------------------- */

.section {
  padding-top: clamp(56px, 7vw, 110px);
  padding-bottom: clamp(56px, 7vw, 110px);
  scroll-margin-top: 96px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-head .aside {
  font-size: 17px;
  color: var(--ink-soft);
  display: flex;
  gap: 22px;
  white-space: nowrap;
}

.frame {
  border: 1px solid var(--line);
  padding: clamp(24px, 3vw, 44px);
}

/* ---- chart ------------------------------------------------------------ */

.chart {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4vw, 72px);
}

.chart-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.45;
}

.chart-copy p { max-width: 40ch; }

.chart-copy .more {
  font-size: 19px;
  align-self: flex-start;
}

.rows {
  display: grid;
  gap: 26px;
  align-content: center;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 0 32px;
  font-size: clamp(16px, 1.3vw, 19px);
  border: 1px solid var(--line);
}

.row .value { text-align: right; white-space: nowrap; }
.row .value small {
  display: block;
  font-size: 0.78em;
  color: var(--ink-soft);
}

.row-outline { width: 100%; }
.row > span:first-child { white-space: nowrap; }
.row-muted {
  width: 52%;
  min-width: 300px;
  border-color: transparent;
  background: var(--paper-2);
}
.row-accent {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.row-accent .value small { color: rgba(255, 255, 255, 0.8); }

.legend {
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---- how it works ------------------------------------------------------ */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.card .shot {
  background: var(--paper);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}
.card .shot img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
}

.card .text {
  padding: 22px 24px 28px;
  display: grid;
  gap: 8px;
}

.card .step {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.card p { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }

/* ---- install ---------------------------------------------------------- */

.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(28px, 4vw, 72px);
}

.download {
  border: 1px solid var(--line);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
}

.download .meta { font-size: 15px; color: var(--ink-soft); }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 17px;
  line-height: 1.5;
}
.steps li:last-child { border-bottom: 1px solid var(--line-soft); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-size: 14px;
  color: var(--ink-soft);
  padding-top: 4px;
  letter-spacing: 0.04em;
}

/* ---- what changed ------------------------------------------------------ */

.delta {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.delta th, .delta td {
  text-align: left;
  vertical-align: top;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}
.delta tr:last-child td { border-bottom: 1px solid var(--line-soft); }
.delta th { font-weight: 400; color: var(--ink-soft); font-size: 14px; letter-spacing: 0.04em; border-top: 0; padding-top: 0; }
.delta td:first-child { width: 34%; padding-right: 24px; }
.delta .tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: 1px;
}
.delta .tag-accent { border-color: var(--accent); color: var(--accent); }

.delta-note {
  margin-top: 26px;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 70ch;
}

/* ---- footer strip -------------------------------------------------------- */

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(40px, 6vw, 90px);
}

.strip a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 16px;
  font-size: clamp(20px, 1.8vw, 26px);
  letter-spacing: -0.01em;
  border-right: 1px solid var(--line);
  transition: background-color 140ms ease, color 140ms ease;
}
.strip a:last-child { border-right: 0; }
.strip a:hover { background: var(--ink); color: #fff; text-decoration: none; }

.colophon {
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- launch page --------------------------------------------------------- */

.launch {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.launch main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--gutter);
}

.panel {
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 44px);
  display: grid;
  gap: 18px;
}

.panel h1 { font-size: clamp(26px, 3vw, 32px); max-width: none; }
.panel p { color: var(--ink-soft); font-size: 17px; }
.panel .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.panel .server { font-size: 14px; color: var(--ink-soft); }

.pulse {
  width: 72px; height: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  position: relative;
  overflow: hidden;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 999px;
  background: var(--accent);
  animation: slide 1.4s cubic-bezier(.45,.05,.55,.95) infinite alternate;
}
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(150%); }
}

[hidden] { display: none !important; }

/* ---- responsive -------------------------------------------------------------- */

@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { grid-template-columns: 1fr; }
  .chart-copy { gap: 24px; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-cta { max-width: 560px; }
  .insights { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px 20px; }
  .toc a { border-left: 0; padding: 4px 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  /* Tabs move to their own row under the wordmark and the button. */
  .topbar { padding-top: 14px; padding-bottom: 12px; flex-wrap: wrap; row-gap: 10px; }
  .tabs { order: 3; width: 100%; justify-content: space-between; gap: 12px; font-size: 15px; }
  .tabs a { padding: 4px 0; }
  .tabs a::after { bottom: -13px; }
  .band { scroll-margin-top: 128px; }
  .section { scroll-margin-top: 128px; }
  .insight { scroll-margin-top: 136px; }
  .band-head { grid-template-columns: 1fr; row-gap: 12px; }
  .band-lede, .band-actions { grid-column: 1; }
  .btn { padding: 11px 16px; font-size: 15px; }
  .btn-lg { padding: 16px 22px; font-size: 17px; }
  .section-head { flex-direction: column; gap: 10px; }
  .section-head .aside { white-space: normal; flex-wrap: wrap; gap: 8px 18px; }
  .row { padding: 0 18px; min-height: 76px; flex-wrap: wrap; row-gap: 4px; }
  .row-muted { width: 100%; min-width: 0; }
  .install { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card .shot { height: 150px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip a { padding: 30px 12px; border-bottom: 1px solid var(--line); }
  .strip a:nth-child(2n) { border-right: 0; }
  .strip a:nth-last-child(-n+2) { border-bottom: 0; }
  .row > span:first-child { white-space: normal; }
  .steps li { grid-template-columns: 36px 1fr; gap: 12px; }
  /* Stack the comparison table: one experience per block. */
  .delta thead { display: none; }
  .delta, .delta tbody, .delta tr, .delta td { display: block; width: 100%; }
  .delta tr { border-top: 1px solid var(--line-soft); padding: 16px 0; }
  .delta tr:last-child { border-bottom: 1px solid var(--line-soft); }
  .delta td { border: 0 !important; padding: 0; }
  .delta td:first-child { width: 100%; padding: 0 0 10px; }
  .delta td:first-child code { word-break: break-all; }
}
