/*
  Tote product page (totedesk.website).
  Tokens and values come from the Tote Website Figma file (Desktop 1440 and
  Mobile 375), which mirrors the app's own tokens. Atkinson Hyperlegible Next
  is self-hosted under the SIL Open Font License (assets/fonts/OFL.txt).
*/

@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); }

:root {
  --canvas: #eef2ee;
  --card: #ffffff;
  --raised: #f4f7f4;
  --border: #d9e1db;
  --border-strong: #b9c6bd;
  --text-primary: #17201b;
  --text-muted: #4f5c55;
  /* Darker than the app's faint grey so 13px captions pass 4.5:1 on the canvas (4.77:1). */
  --text-faint: #616d67;
  --accent: #1f6b4a;
  --accent-hover: #185a3d;
  --accent-soft: #dcebe2;
  --accent-text: #164a33;
  --on-accent: #ffffff;
  --sidebar: #1f4d3a;
  --sidebar-text: #eef4ef;
  --sidebar-muted: #b4cabd;
  --shell-top: #1b5a40;
  --shell-bottom: #06120c;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-float: 0 2px 6px rgba(20, 40, 30, 0.08), 0 16px 40px rgba(20, 40, 30, 0.18);
  --shadow-card: 0 1px 2px rgba(20, 40, 30, 0.05), 0 4px 16px rgba(20, 40, 30, 0.06);

  /* 120px gutters at 1440, 20px on a phone; content tops out at 1200px. */
  --gutter: clamp(20px, 8.34vw, 120px);
  --content: 1200px;

  --font: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

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

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img, svg { display: block; flex: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--card);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--accent-text);
  box-shadow: var(--shadow-card);
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Type scale: mobile values from Mobile 375, desktop values from Desktop 1440. */
.display-hero {
  font-size: clamp(40px, 2.3vw + 31px, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: clamp(-1.5px, -0.1vw, -1px);
  text-wrap: balance;
}
.display-h2 {
  font-size: clamp(30px, 1.45vw + 24.5px, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.8px;
  text-wrap: balance;
}
.display-h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.lead {
  font-size: clamp(17px, 0.45vw + 15.3px, 20px);
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}
.caption {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-faint);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 16px 24px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--card);
  color: var(--accent-text);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
}
.brand-logo { width: 36px; height: 40px; }
.brand-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.nav-links {
  display: flex;
  gap: 40px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--accent-text); }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 96px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  flex: 0 1 520px;
  min-width: 0;
}
.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: 8px;
}
.cta-center { align-items: center; text-align: center; }

.hero-mock {
  position: relative;
  flex: 0 0 616px;
  height: 500px;
}
.app-window {
  position: absolute;
  left: 16px;
  top: 20px;
  width: 600px;
  height: 460px;
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(to bottom, var(--shell-top), var(--shell-bottom));
  box-shadow: var(--shadow-float);
}
.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 128px;
  padding-top: 6px;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sidebar-text);
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--sidebar-muted);
}
.app-nav.is-active { background: var(--canvas); color: var(--accent-text); }

.find-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 0;
  min-width: 0;
  padding: 24px 22px 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--canvas);
}
.find-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: 17px;
  line-height: 1.55;
}
.caret { width: 1.5px; height: 18px; background: var(--accent); }
.find-count {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
}
.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.kind-tile {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--raised);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-muted);
}
.file-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}
.file-name,
.file-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.file-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-muted);
}
.file-open { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--accent-text); }

.filed-chip {
  position: absolute;
  left: -40px;
  top: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-float);
  white-space: nowrap;
}
.filed-check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}
.filed-text { display: flex; flex-direction: column; }
.filed-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.filed-where { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text-muted); }

/* Feature band */
.band {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 72px 64px;
  border-radius: var(--radius-xl);
  background: linear-gradient(159.88deg, var(--shell-top) 14.286%, var(--shell-bottom) 85.714%);
}
.band-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  color: var(--sidebar-text);
}
.band .lead { color: var(--sidebar-muted); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--sidebar);
  color: var(--sidebar-text);
}
.feature p { color: var(--sidebar-muted); }
.icon-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

/* Clean up and privacy */
.cleanup {
  display: flex;
  align-items: center;
  gap: 96px;
  padding-top: 120px;
  padding-bottom: 56px;
  scroll-margin-top: 24px;
}
.cleanup-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 560px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-float);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.suggestion {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--raised);
}
.suggestion-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}
.suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}
.suggestion-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.suggestion-note { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text-muted); }
.suggestion-action {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--accent-text);
}
.cleanup-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 0;
  min-width: 0;
}
.promises {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}
.promises li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 17px;
  line-height: 1.55;
}
.promise-check {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
}

/* Install */
.install { padding-top: 64px; scroll-margin-top: 24px; }
.install-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 72px 64px;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.install-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.checksum { max-width: 100%; overflow-wrap: anywhere; }
.checksum summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 8px;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.checksum code { display: block; font-family: var(--mono); font-size: 12px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--raised);
}
.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.step-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.step p { font-size: 15px; line-height: 1.5; color: var(--text-muted); }

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 48px;
  padding-bottom: 56px;
}
.brand-small { gap: 10px; }
.brand-small .brand-logo { width: 25px; height: 28px; }
.brand-small .brand-name { font-size: 15px; line-height: 1.3; letter-spacing: 0; }
.footer a:not(.brand) { color: var(--accent-text); font-weight: 600; }
.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Privacy and license pages */
.doc {
  max-width: calc(760px + 2 * var(--gutter));
  padding-top: 32px;
  padding-bottom: 48px;
}
.doc h1 { margin-bottom: 8px; }
.doc .updated { margin-bottom: 32px; }
.doc h2 {
  margin: 40px 0 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.doc p, .doc li { font-size: 17px; line-height: 1.6; color: var(--text-primary); }
.doc p + p,
.doc ul + p { margin-top: 12px; }
.doc p.caption { font-size: 13px; line-height: 1.4; color: var(--text-faint); }
.doc ul { list-style: disc; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.doc a { color: var(--accent-text); font-weight: 600; }
/* Paths and URLs have no spaces; let them wrap on a phone. */
.doc code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }
.doc .lead { color: var(--text-muted); }
.doc pre {
  margin: 16px 0 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Below 1200px there is no room for copy and mock side by side. */
@media (max-width: 1199px) {
  .hero { flex-direction: column; align-items: stretch; gap: 40px; padding-top: 24px; padding-bottom: 64px; }
  .hero-copy { flex: none; max-width: 640px; }
  .hero-mock { flex: none; width: 100%; max-width: 616px; margin-inline: auto; }
  .cleanup { flex-direction: column-reverse; align-items: stretch; gap: 32px; padding-top: 72px; }
  .cleanup-card { flex: none; width: 100%; max-width: 560px; margin-inline: auto; }
  .desktop-break { display: none; }
}

/* One column from here down, so features and steps become compact rows:
   the badge or number sits beside the text instead of above it. */
@media (max-width: 899px) {
  .feature-grid, .steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .feature,
  .step {
    display: grid;
    align-items: start;
    column-gap: 14px;
    row-gap: 4px;
    padding: 16px;
  }
  .feature { grid-template-columns: 44px minmax(0, 1fr); }
  .step { grid-template-columns: 32px minmax(0, 1fr); }

  .icon-badge { grid-row: span 2; width: 44px; height: 44px; border-radius: var(--radius-md); }
  .feature .display-h3 { font-size: 19px; line-height: 1.3; letter-spacing: 0; }
  .feature p { font-size: 15px; line-height: 1.5; }

  .step-number { grid-row: span 2; width: 32px; height: 32px; }
  .step-title { font-size: 17px; }
}

/* Phone layout, from Mobile 375. */
@media (max-width: 720px) {
  .nav { padding-block: 16px; }
  .nav-links { display: none; }

  .hero-copy .btn { width: 100%; }

  .hero-mock { height: 384px; max-width: 100%; }
  .app-window { left: 0; top: 0; width: 100%; height: 340px; padding: 10px; }
  .app-sidebar { display: none; }
  .find-screen { padding: 18px 14px 0; }
  .file-row.is-third { display: none; }
  .filed-chip { left: 16px; top: 312px; }

  .hero { padding-bottom: 48px; }

  .band { gap: 24px; padding: 32px 16px; }
  .band-heading { padding-inline: 4px; }

  .cleanup { padding-top: 56px; padding-bottom: 32px; }
  .cleanup-card { padding: 20px 16px; }
  .suggestion { padding: 14px 12px; gap: 10px; }
  .suggestion-icon { display: none; }

  .install { padding-top: 32px; }
  .install-card { padding: 32px 16px; gap: 24px; }
  .install-head { gap: 12px; padding-inline: 4px; }
  .install-head .btn { width: 100%; }

  .footer { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 40px; padding-bottom: 32px; }
  .footer-meta { align-items: flex-start; }
  .doc { padding-top: 16px; }
}

/* Extra-small phones: keep the chip inside the screen. */
@media (max-width: 359px) {
  .filed-chip { left: 8px; right: 8px; padding-right: 14px; }
  .filed-name, .filed-where { overflow: hidden; text-overflow: ellipsis; }
  .filed-text { min-width: 0; }
}
