/* ============================================================================
   RyTask landing page — styles built exclusively on the brand tokens
   (tokens.css). Flat fills, 1px hairlines, small radii, calm motion.
   ============================================================================ */

*,
*::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;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: var(--lh-body);
  color: var(--fg-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--track-mono);
}

.container {
  max-width: var(--container-page);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px); /* the one permitted blur: sticky top bar */
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: var(--w-display);
  font-size: 17px;
  letter-spacing: var(--track-display);
  color: var(--fg);
}

.nav-links {
  display: flex;
  gap: var(--space-5);
  margin-left: var(--space-4);
  flex: 1;
}

.nav-links a {
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: var(--fg-muted);
  padding: var(--space-1_5) 0;
}

.nav-links a:hover {
  color: var(--fg);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height-lg);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: var(--w-semibold);
  line-height: var(--lh-flat);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--fg-on-accent); /* yellow fills always take dark ink */
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-sm {
  height: var(--control-height);
  padding: 0 var(--space-3);
  font-size: var(--fs-sm);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

/* theme toggle: show the icon for the mode you'd switch TO */
.icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-sun { display: none; }
}

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

.hero {
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
}

.kicker {
  font-size: var(--fs-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--accent-fg);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-family: var(--font-brand);
  font-weight: var(--w-display);
  font-size: clamp(34px, 6vw, 58px);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
  color: var(--fg);
  margin: 0 auto;
  max-width: 880px;
}

.hero-sub {
  max-width: var(--container-prose);
  margin: var(--space-6) auto 0;
  font-size: 17px;
  color: var(--fg-muted);
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--fg-faint);
}

.hero-stats .mono {
  color: var(--fg);
  font-weight: var(--w-medium);
}

/* ---------------------------------------------------------------- app mockup */

.app-frame {
  max-width: 880px;
  margin: var(--space-12) auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: var(--fs-h3);
  font-weight: var(--w-semibold);
  color: var(--fg);
}

.app-tabs {
  display: inline-flex;
  gap: var(--space-1);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.app-tab {
  font-size: var(--fs-xs);
  font-weight: var(--w-medium);
  color: var(--fg-muted);
  padding: 3px var(--space-2);
  border-radius: var(--radius-xs);
}

.app-tab.is-active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-xs);
}

.app-new {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: var(--w-semibold);
  color: var(--fg-on-accent);
  background: var(--primary);
  border-radius: var(--radius-sm);
  padding: 5px var(--space-2);
  line-height: var(--lh-flat);
}

.app-colhead {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1_5) var(--space-4);
  font-size: var(--fs-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
}

.task-row {
  display: grid;
  grid-template-columns: 10px 52px 1fr auto 22px minmax(90px, 150px) 96px;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--row-height);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-fast) var(--ease-out);
}

.task-row:hover {
  background: var(--surface-hover);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  flex: none;
  display: inline-block;
}

.dot-progress { background: var(--status-progress); }
.dot-done { background: var(--status-done); }
.dot-todo {
  background: transparent;
  border: 2px solid var(--status-todo); /* backlog/todo = ring outline */
  width: 7px;
  height: 7px;
}

.task-id {
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}

.task-title {
  font-size: var(--fs-body);
  font-weight: var(--w-medium);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1_5);
  font-size: var(--fs-xs);
  font-weight: var(--w-medium);
  color: var(--fg-2);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-2);
  line-height: 1.3;
  white-space: nowrap;
}

.chip-label {
  color: var(--primary-soft-fg);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-fg);
  font-size: var(--fs-micro);
  font-weight: var(--w-bold);
  flex: none;
}

.avatar-xs {
  width: 15px;
  height: 15px;
  font-size: 9px;
}

/* the signature move: plan-vs-actual meter inside the row */
.meter {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--time-track-bg);
  overflow: visible;
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--time-actual);
}

.meter-fill-over {
  background: var(--time-over);
}

.meter-tick {
  position: absolute;
  top: -3px;
  left: 100%;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: var(--time-plan);
  transform: translateX(-1px);
}

.task-time {
  font-size: var(--fs-time);
  font-weight: var(--w-medium);
  color: var(--fg-2);
  text-align: right;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1_5);
}

.task-time-over {
  color: var(--time-over);
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--time-actual);
  animation: timer-pulse 2s var(--ease-in-out) infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

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

.app-footnote {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-time-sm);
  color: var(--fg-faint);
  background: var(--bg);
}

/* ---------------------------------------------------------------- sections */

.section {
  padding: var(--space-16) 0;
  border-top: 1px solid var(--border);
}

.section-alt {
  background: var(--surface);
}

.section-title {
  font-family: var(--font-ui);
  font-weight: var(--w-bold);
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-heading);
  color: var(--fg);
  max-width: 640px;
}

.section > .container > .section-title {
  margin-bottom: var(--space-8);
}

.section-sub {
  max-width: var(--container-prose);
  color: var(--fg-muted);
  margin: calc(-1 * var(--space-5)) 0 var(--space-8);
}

/* ---------------------------------------------------------------- grids & cards */

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--space-5);
}

.section-alt .card {
  background: var(--bg);
}

.card h3 {
  font-size: var(--fs-h3);
  font-weight: var(--w-semibold);
  line-height: var(--lh-heading);
  color: var(--fg);
  margin-bottom: var(--space-2);
}

.card p {
  font-size: var(--fs-body);
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------- split sections */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.split-flip .split-copy { order: 2; }
.split-flip .split-visual { order: 1; }

.split-copy p {
  margin-top: var(--space-4);
  color: var(--fg-muted);
  max-width: 480px;
}

.split-copy .section-title {
  margin-bottom: 0;
}

.split-copy em {
  font-style: normal;
  color: var(--fg);
  font-weight: var(--w-semibold);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.link-arrow {
  display: inline-block;
  margin-top: var(--space-5);
  font-weight: var(--w-semibold);
  font-size: var(--fs-body);
  color: var(--primary-text);
}

.link-arrow::after {
  content: " →";
}

/* ---------------------------------------------------------------- panels (demos) */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}

.section-alt .panel {
  background: var(--bg);
}

.panel-kicker {
  font-size: var(--fs-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: var(--space-4);
}

.panel-foot {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}

.report-row {
  display: grid;
  grid-template-columns: 96px 1fr 110px;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--row-height);
}

.report-name {
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meter-lg {
  height: 8px;
}

.meter-lg .meter-tick {
  top: -3px;
  height: 14px;
}

.report-time {
  font-size: var(--fs-time);
  font-weight: var(--w-medium);
  color: var(--fg-2);
  text-align: right;
}

.report-time-over {
  color: var(--time-over);
}

/* slack demo */
.slack-input {
  font-size: var(--fs-sm);
  color: var(--fg);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  overflow-x: auto;
  white-space: nowrap;
}

.slack-reply {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.section .slack-reply {
  background: var(--bg);
}

.slack-check {
  flex: none;
  margin-top: 2px;
  color: var(--success);
}

.slack-reply-title {
  font-size: var(--fs-body);
  font-weight: var(--w-semibold);
  color: var(--fg);
}

.slack-reply-title .mono {
  font-weight: var(--w-medium);
  color: var(--fg-faint);
  font-size: var(--fs-xs);
}

.slack-reply-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1_5);
  margin-top: var(--space-2);
}

/* ---------------------------------------------------------------- code blocks */

.codeblock {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.codeblock-wide {
  max-width: 760px;
}

.codeblock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}

.btn-copy {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: var(--w-semibold);
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px var(--space-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.btn-copy:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

.btn-copy.is-copied {
  color: var(--success-fg);
  border-color: var(--success);
}

.codeblock pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
}

.codeblock code {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  color: var(--fg);
}

.selfhost-note {
  margin-top: var(--space-5);
  font-size: var(--fs-body);
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------- final CTA */

.cta-band {
  background: var(--primary);
  border-top: none;
}

.cta-inner {
  text-align: center;
}

.cta-title {
  font-family: var(--font-brand);
  font-weight: var(--w-display);
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
  color: var(--fg-on-accent); /* dark ink on yellow, never white */
}

.cta-sub {
  margin: var(--space-4) auto 0;
  max-width: 560px;
  font-size: 16px;
  color: var(--fg-on-accent);
  opacity: 0.78;
}

.btn-ink {
  background: var(--fg-on-accent);
  color: var(--sun-100);
}

.btn-ink:hover {
  background: var(--stone-800);
}

.btn-ink-ghost {
  background: transparent;
  border-color: rgba(32, 29, 26, 0.45);
  color: var(--fg-on-accent);
}

.btn-ink-ghost:hover {
  background: rgba(32, 29, 26, 0.08);
}

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

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
}

.footer-brand p {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--fg-faint);
  max-width: 280px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-head {
  font-size: var(--fs-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: var(--space-1);
}

.footer-col a {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

.footer-col a:hover {
  color: var(--fg);
  text-decoration: none;
}

.footer-legal {
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}

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

.faq {
  margin-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-h3);
  font-weight: var(--w-semibold);
  line-height: var(--lh-heading);
  color: var(--fg);
}

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

.faq-item summary:hover { color: var(--fg-2); }

.faq-item summary:focus-visible {
  outline: 2px solid var(--border-strong);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

.faq-item summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: var(--space-1);
  border-right: 2px solid var(--fg-faint);
  border-bottom: 2px solid var(--fg-faint);
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-out);
}

.faq-item summary:hover::after { border-color: var(--fg-muted); }

.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-a {
  padding: 0 0 var(--space-5);
  max-width: 64ch;
}

.faq-a p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg-2);
}

.faq-a code {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-0_5) var(--space-1_5);
}

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

.js-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.js-reveal.is-visible,
.no-observer .js-reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .split-flip .split-copy { order: 1; }
  .split-flip .split-visual { order: 2; }

  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .grid-4,
  .grid-3 { grid-template-columns: 1fr; }

  .section { padding: var(--space-12) 0; }

  .hero { padding: var(--space-12) 0 var(--space-10); }

  .task-row {
    grid-template-columns: 10px 1fr 96px;
  }

  .task-id,
  .task-row .chip,
  .task-row .avatar,
  .task-row .meter {
    display: none;
  }

  .report-row {
    grid-template-columns: 80px 1fr 92px;
    gap: var(--space-2);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}
