@import url('/fonts/fonts.css');

/* ---------------------------------------------------------------- tokens */

:root {
  --paper: #e7e2d6;
  --card: #f4f1ea;
  --card-sunk: #efe9dd;
  --line: #ddd6c6;
  --line-dashed: #d2cbbb;

  --ink: #1a1a1a;
  --ink-soft: #4a463d;
  --ink-muted: #6b6455;

  /* --ink-faint is a DARK-BACKGROUND token only: 4.57:1 on --ink, 4.91:1 on --panel,
     but just 2.95:1 on --paper, which fails WCAG AA. Faint text on the paper and card
     backgrounds uses --ink-faint-light instead (4.81:1 on paper, 5.51:1 on card). */
  --ink-faint: #8a8271;
  --ink-faint-light: #676054;

  --on-dark: #f4f1ea;
  --on-dark-muted: #c9c2b2;
  --panel: #131210;
  --panel-line: #333;

  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 28px;

  --shell: 1080px;
  --gutter: 32px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  /* Anchored sections shouldn't tuck under the top edge. */
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  color: #555;
}

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

/* Visible focus for keyboard users, suppressed for mouse clicks. */
:focus-visible {
  outline: 2.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* On the ink-coloured surfaces an --ink outline is invisible against the background,
   so flip it. Applied to .slab too, defensively, in case it ever gains a link. */
.contact-card :focus-visible,
.slab :focus-visible {
  outline-color: var(--on-dark);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--on-dark);
  padding: 12px 20px;
  border-radius: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  color: var(--on-dark);
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.scribble {
  font-family: 'Caveat', 'Bradley Hand', cursive;
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------- nav */

.site-header {
  padding-block: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  /* Negative margin keeps the visual spacing while giving the link a ~45px tap target. */
  padding-block: 12px;
  margin-block: -12px;
}

/* ---------------------------------------------------------------- button */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--radius-sm);
  padding: 12px 22px 12px 18px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.btn:hover {
  background: #333;
  color: var(--on-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(26, 26, 26, 0.6);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  flex: none;
}

.btn-label {
  text-align: left;
  line-height: 1.15;
}

.btn-label small {
  display: block;
  font-size: 10px;
  color: var(--on-dark-muted);
  letter-spacing: 0.04em;
}

.btn-label strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.btn-pill {
  font-size: 14px;
  font-weight: 600;
  background: var(--ink);
  color: var(--on-dark);
  padding: 12px 20px;
  border-radius: 22px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-pill:hover {
  background: #333;
  color: var(--on-dark);
  transform: translateY(-1px);
}

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

.hero {
  padding-block: 64px 40px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 10px 0 20px;
}

.hero p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 460px;
  margin: 0 0 32px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--ink-faint-light);
}

/* --------------------------------------------------------- phone mockup */

.phone-stage {
  display: flex;
  justify-content: center;
}

.phone {
  width: 280px;
  height: 580px;
  background: #000;
  border-radius: 44px;
  padding: 9px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.5), 0 0 0 2px #222;
  transform: rotate(2deg);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--card);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #000;
  border-radius: 13px;
  z-index: 5;
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 44px 18px 12px;
  border-bottom: 1px solid #e2dbca;
}

.phone-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card-sunk);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}

.phone-avatar img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.phone-thread {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: 16px 16px 5px 16px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.bubble-fennec {
  align-self: flex-start;
  max-width: 92%;
  background: var(--card-sunk);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  padding: 11px 12px;
}

.bubble-fennec > p {
  font-size: 12px;
  margin: 0 0 8px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.task-row + .task-row {
  border-top: 1px solid var(--line);
}

.task-box {
  width: 14px;
  height: 14px;
  border: 2px solid #b8b0a0;
  border-radius: 5px;
  flex: none;
}

.task-text {
  font-size: 11px;
}

.task-tag {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-faint-light);
  text-transform: uppercase;
  white-space: nowrap;
}

.phone-composer {
  padding: 8px 12px 20px;
  border-top: 1px solid #e2dbca;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-input {
  flex: 1;
  height: 36px;
  background: var(--card-sunk);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  font-size: 11px;
  color: var(--ink-faint-light);
}

.phone-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

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

.section {
  padding-block: 56px;
}

.section h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 6px 0 36px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card-grid + .card-grid {
  margin-top: 20px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px -22px rgba(26, 26, 26, 0.55);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

.card-quiet {
  background: var(--card-sunk);
  border: 1px solid var(--line);
  padding: 24px 28px;
}

.card-quiet h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.card-quiet p {
  font-size: 13px;
  line-height: 1.5;
}

.card-art {
  height: 34px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
  padding: 4px 9px;
}

/* -------------------------------------------------------------- waveform */

.wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
}

.wave span {
  width: 5px;
  background: var(--ink);
  border-radius: 3px;
  animation: wave 1s ease-in-out infinite;
}

.wave-dark span {
  background: var(--on-dark);
  width: 4px;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.32);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ------------------------------------------------------------- platforms */

.slab {
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.slab h2 {
  font-size: clamp(26px, 3.4vw, 32px);
  color: var(--on-dark);
  margin: 6px 0 16px;
}

.slab .scribble {
  color: var(--ink-faint);
  font-size: 22px;
}

.platform-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.platform-list div {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.platform-list dt {
  font-size: 13px;
  font-weight: 700;
  width: 74px;
  flex: none;
}

.platform-list dd {
  font-size: 14px;
  color: var(--on-dark-muted);
  line-height: 1.5;
  margin: 0;
}

.device-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.device-watch {
  width: 96px;
  height: 118px;
  background: var(--panel);
  border: 2px solid var(--panel-line);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  flex: none;
}

.device-watch .scribble {
  font-size: 13px;
  color: var(--ink-faint);
}

.device-mac {
  width: 150px;
  height: 96px;
  background: var(--panel);
  border: 2px solid var(--panel-line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: none;
}

.mac-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-line span:first-child {
  width: 10px;
  height: 10px;
  border: 1.5px solid #3a3630;
  border-radius: 3px;
  flex: none;
}

.mac-line span:last-child {
  height: 4px;
  background: #2a2722;
  border-radius: 2px;
}

.mac-hotkey {
  margin-top: auto;
  height: 18px;
  border: 1px solid #3a3630;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------- faq */

.faq {
  display: grid;
  gap: 10px;
  /* Capped for readability, but centred so the leftover width reads as margin rather
     than a column that stopped short of the other full-width sections. */
  max-width: 780px;
  margin-inline: auto;
}

.faq details {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 0 22px;
  transition: background 0.2s var(--ease);
}

.faq details[open] {
  background: var(--card-sunk);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: color 0.15s var(--ease);
}

.faq details:not([open]):hover {
  background: var(--card-sunk);
}

.faq summary:hover::after {
  border-color: var(--ink);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-faint-light);
  border-bottom: 2px solid var(--ink-faint-light);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s var(--ease);
  flex: none;
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.faq p {
  margin: 0;
  padding: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ----------------------------------------------------------- closing cta */

.closing {
  padding: 24px 0 72px;
  text-align: center;
}

.closing img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.closing h2 {
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 12px 0 6px;
}

.closing .scribble {
  font-size: 22px;
  margin-bottom: 28px;
}

.closing-actions {
  display: flex;
  justify-content: center;
}

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

.site-footer {
  border-top: 1px dashed var(--line-dashed);
  margin-top: 56px;
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-faint-light);
}

.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink-faint-light);
  padding-block: 12px;
  margin-block: -12px;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------ prose page */

.prose-head {
  /* Matches .prose so the h1 and the body copy share a left edge. Both elements
     also carry .shell, whose wider max-width would otherwise win on the header. */
  max-width: 720px;
  padding-block: 24px 8px;
}

.prose-head h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
}

.prose-meta {
  font-size: 13px;
  color: var(--ink-faint-light);
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-faint-light);
  padding-top: 4px;
}

.breadcrumb a {
  color: var(--ink-faint-light);
}

.breadcrumb a:hover {
  color: var(--ink);
}

.prose {
  max-width: 720px;
  padding-block: 24px 48px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.prose h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 44px 0 12px;
  scroll-margin-top: 24px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 8px;
}

.prose p,
.prose li {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 0 0 18px;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-dashed);
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
}

.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--line-dashed);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

.table-scroll table {
  min-width: 520px;
  margin-bottom: 0;
}

.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 15px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-warn {
  background: #f7ecd7;
  border-color: #e0c99a;
  /* 3.53:1 against the callout background, clearing the 3:1 non-text minimum. */
  border-left-color: #a17525;
}

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 14px;
}

.toc p {
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  margin-bottom: 5px;
  break-inside: avoid;
}

/* ------------------------------------------------------------ support ui */

.contact-card {
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
}

.contact-card h2 {
  color: var(--on-dark);
  font-size: 22px;
  margin: 0 0 8px;
}

.contact-card p {
  color: var(--on-dark-muted);
  margin: 0 0 20px;
  font-size: 15px;
}

.mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--on-dark);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.mail-btn:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------- scroll reveal */

/* Only applied once JS confirms support — no JS means content is simply visible. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Cards in a row enter together; a small stagger makes it read as deliberate. */
.js-reveal .card-grid > .reveal:nth-child(2) {
  transition-delay: 70ms;
}

.js-reveal .card-grid > .reveal:nth-child(3) {
  transition-delay: 140ms;
}

/* The waveform loops forever, so keep it paused until its section is on screen. */
.js-reveal .reveal .wave span {
  animation-play-state: paused;
}

.js-reveal .reveal.is-in .wave span {
  animation-play-state: running;
}

/* Chat bubbles cascade in once, to demonstrate "it files as you talk". */
.js-reveal .phone-thread > * {
  opacity: 0;
  animation: bubble-in 0.5s var(--ease) forwards;
}

.js-reveal .phone-thread > *:nth-child(1) {
  animation-delay: 0.2s;
}

.js-reveal .phone-thread > *:nth-child(2) {
  animation-delay: 0.6s;
}

.js-reveal .phone-thread .task-row {
  opacity: 0;
  animation: bubble-in 0.35s var(--ease) forwards;
}

.js-reveal .phone-thread .task-row:nth-of-type(1) {
  animation-delay: 0.82s;
}

.js-reveal .phone-thread .task-row:nth-of-type(2) {
  animation-delay: 0.94s;
}

.js-reveal .phone-thread .task-row:nth-of-type(3) {
  animation-delay: 1.06s;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 900px) {
  :root {
    --gutter: 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-block: 36px 24px;
    gap: 40px;
  }

  .hero p {
    max-width: none;
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Three cards in two columns leave the last one stranded beside an empty cell,
     so let it run the full width instead. */
  .card-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .slab {
    grid-template-columns: 1fr;
    padding: 34px 28px;
    gap: 32px;
  }
}

@media (max-width: 620px) {
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 20px;
  }

  .site-nav {
    gap: 18px;
    width: 100%;
    margin-left: 0;
  }

  .site-nav .btn-pill {
    margin-left: auto;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 40px;
  }

  .phone {
    transform: rotate(1deg) scale(0.92);
  }

  .toc ol {
    columns: 1;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-card {
    padding: 26px 22px;
  }
}

/* Sites that hide nav links on tiny screens keep the download CTA visible. */
@media (max-width: 400px) {
  .site-nav a:not(.btn-pill) {
    display: none;
  }
}

/* --------------------------------------------------------- reduced motion */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js-reveal .reveal,
  .js-reveal .phone-thread > *,
  .js-reveal .phone-thread .task-row {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ------------------------------------------------------------------ print */

@media print {
  .site-header,
  .site-nav,
  .closing-actions,
  .contact-card .mail-btn {
    display: none;
  }

  body {
    background: #fff;
  }

  .prose {
    max-width: none;
  }
}
