/* TaskSpark, page shell styles — app-system aligned.
   Tokens come from tokens.css. This file defines page patterns:
   hero, sections, doc layout, feature catalogue, downloads, changelog, FAQ, contact, CTA. */

/* --- Page hero --- */
.page-hero {
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--border);
}
.page-hero .kicker { margin-bottom: 18px; }
.page-hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 6.2vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 20ch;
  margin-bottom: 36px;
  color: var(--text);
}
.page-hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.page-hero .lede {
  font-family: var(--sans);
  font-size: clamp(16px, 1.25vw, 19px);
  color: var(--text2);
  max-width: 56ch;
  line-height: 1.55;
}
.page-hero .meta-row {
  margin-top: 32px;
  display: flex; flex-wrap: wrap; gap: 28px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
}
.page-hero .meta-row span strong {
  color: var(--text); font-weight: 600;
  letter-spacing: 0.04em;
}

/* Hero badge (small pill above or beside titles) */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--accent-l); color: var(--accent);
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  border-radius: 99px;
  letter-spacing: 0.01em;
}
.hero-badge .spark-dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--accent);
}

/* --- Generic section rhythm --- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}
.section.alt { background: var(--surface2); }
.section.surface { background: var(--surface); }
.section.accent { background: var(--accent-l); border-bottom-color: transparent; }

.section-head { margin-bottom: 56px; max-width: 780px; }
.section-head .kicker { margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-head h2 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--display);
}
.section-head .sub {
  margin-top: 16px;
  color: var(--text2);
  font-size: 17px;
  line-height: 1.6;
  max-width: 60ch;
}

/* --- Sidenav + doc layout (Docs, Privacy, Terms, Changelog, Features) --- */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 72px;
  align-items: start;
}
.doc-side {
  position: sticky; top: 88px;
  font-family: var(--sans); font-size: 13px;
  display: flex; flex-direction: column; gap: 2px;
}
.doc-side h4 {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text3);
  margin: 16px 0 8px;
}
.doc-side h4:first-child { margin-top: 0; }
.doc-side a {
  padding: 6px 10px;
  color: var(--text2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: color .15s, background .15s;
}
.doc-side a:hover { color: var(--text); background: var(--surface2); }
.doc-side a.active {
  color: var(--accent); background: var(--accent-l);
  font-weight: 600;
}
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 40px; }
  .doc-side {
    position: static; flex-direction: row; flex-wrap: wrap;
    gap: 4px; border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  .doc-side h4 { width: 100%; margin-top: 8px; }
}

/* --- Prose block (Docs, Privacy, Terms) --- */
.prose {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  max-width: 68ch;
}
.prose h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
  color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose h2 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.prose h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 18px; letter-spacing: -0.005em;
  margin: 28px 0 8px;
  color: var(--text);
}
.prose p + p { margin-top: 12px; }
.prose strong { font-weight: 600; color: var(--text); }
.prose em { font-style: italic; color: var(--accent); }
.prose ul, .prose ol { margin: 12px 0 18px 22px; }
.prose li { margin-bottom: 6px; color: var(--text2); }
.prose li strong { color: var(--text); }
.prose code {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface2); padding: 2px 7px;
  border-radius: var(--radius-sm); color: var(--text);
  border: 1px solid var(--border);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  font-weight: 500;
}
.prose a:hover {
  color: var(--accent-h);
  border-bottom-color: var(--accent-h);
}
.prose blockquote {
  margin: 24px 0; padding: 16px 22px;
  background: var(--surface2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text2);
  font-size: 17px;
}

/* --- Feature catalogue (Features page) --- */
.cat-group {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
}
.cat-group:last-child { border-bottom: 1px solid var(--border); }
.cat-group-head h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
}
.cat-group-head h3 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.cat-group-head .kicker { margin-bottom: 10px; }
.cat-group-head .cat-desc {
  margin-top: 14px; font-family: var(--sans);
  font-size: 15px; color: var(--text2);
  line-height: 1.55; max-width: 36ch;
  padding-left: 0; border-left: 0;
}
.cat-group-head .count {
  margin-top: 14px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text3);
}
.cat-list { display: flex; flex-direction: column; }
.cat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.cat-row:first-child { border-top: 1px solid var(--border); }
.cat-num {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; color: var(--text3);
  min-width: 30px;
}
.cat-name {
  font-family: var(--sans); font-size: 16px;
  font-weight: 600; color: var(--text);
}
.cat-name em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.cat-desc {
  font-size: 14px; color: var(--text2);
  line-height: 1.55;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  max-width: 52ch;
}

/* Feature tags — mirror app badges */
.cat-tag {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px;
  white-space: nowrap; font-weight: 500;
}
.cat-tag.core   { background: var(--accent-l); color: var(--accent); }
.cat-tag.view   { background: var(--blue-l);   color: var(--blue); }
.cat-tag.toggle { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.cat-tag.power  { background: #f1eaf8;         color: #6b48a8; }
.cat-tag.new    { background: var(--accent);   color: #fff; }
.cat-tag.early  { background: var(--amber-l);  color: var(--amber); }
.cat-tag.beta   { background: var(--amber-l);  color: var(--amber); }

/* --- Tag legend (top of Features page) --- */
.tag-legend-section { padding-top: 32px; padding-bottom: 12px; }
.tag-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.tag-legend-head { margin-bottom: 20px; }
.tag-legend-head .kicker { margin-bottom: 6px; }
.tag-legend-head h4 {
  font-family: var(--sans); font-weight: 700;
  font-size: 18px; letter-spacing: -0.005em;
  color: var(--text); margin-bottom: 4px;
}
.tag-legend-head p {
  font-family: var(--sans); font-size: 14px;
  color: var(--text2); margin: 0; line-height: 1.55;
  max-width: 62ch;
}
.tag-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 40px; margin: 0;
}
.tag-legend-grid > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px; align-items: start;
}
.tag-legend-grid dt { margin: 2px 0 0; }
.tag-legend-grid dt .cat-tag { display: inline-block; }
.tag-legend-grid dd {
  font-family: var(--sans); font-size: 14px;
  line-height: 1.5; color: var(--text2); margin: 0;
}
.tag-legend-grid dd strong { color: var(--text); font-weight: 600; }
@media (max-width: 900px) {
  .tag-legend-grid { grid-template-columns: 1fr; gap: 12px 0; }
}
@media (max-width: 820px) {
  .cat-group { grid-template-columns: 1fr; gap: 20px; }
  .cat-row { grid-template-columns: auto 1fr; }
  .cat-desc { grid-column: 1 / -1; padding-left: 54px; border-left: 0; }
  .cat-tag { grid-column: 2; justify-self: start; }
}

/* --- Download page --- */
.dl-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px; align-items: start;
}
.dl-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.dl-main .kicker { margin-bottom: 18px; }
.dl-main h2 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 14px; color: var(--text);
}
.dl-main h2 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.dl-main p {
  color: var(--text2); font-size: 15px;
  max-width: 46ch; line-height: 1.55; margin-bottom: 28px;
}
.dl-main .dl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  border-radius: var(--radius);
  transition: background .15s;
}
.dl-main .dl-btn:hover { background: var(--accent-h); color: #fff; }
.dl-specs {
  margin-top: 28px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
}
.dl-specs strong {
  display: block; font-family: var(--sans);
  font-size: 14px; font-weight: 600;
  color: var(--text); text-transform: none;
  letter-spacing: 0.01em; margin-top: 4px;
}
.dl-web {
  background: var(--accent-l);
  border: 1px solid transparent;
  padding: 36px;
  border-radius: var(--radius-lg);
}
.dl-web h3 {
  font-family: var(--sans); font-weight: 700;
  font-size: 22px; letter-spacing: -0.01em;
  margin-bottom: 10px; color: var(--text);
}
.dl-web h3 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.dl-web p {
  font-size: 14px; color: var(--text2);
  line-height: 1.55; margin-bottom: 20px;
}

/* --- Step blocks (Download + Docs) --- */
.steps {
  display: grid; gap: 0;
  border-top: 1px solid var(--border);
}
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.step-num {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-l);
  width: 40px; height: 40px;
  border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.step-body h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 17px; letter-spacing: -0.005em;
  margin-bottom: 6px; color: var(--text);
}
.step-body p {
  font-size: 15px; color: var(--text2);
  line-height: 1.55; max-width: 56ch;
}

/* --- Changelog entries --- */
.log-entry {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}
.log-entry:first-child { border-top: 1px solid var(--border); }
.log-entry.highlight .log-meta .tag {
  background: var(--accent); color: #fff;
}
.log-meta .ver {
  font-family: var(--sans); font-weight: 700;
  font-size: 26px; letter-spacing: -0.015em;
  color: var(--text);
}
.log-meta .ver em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.log-meta .date {
  margin-top: 6px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
}
.log-meta .tag {
  display: inline-block; margin-top: 12px;
  padding: 3px 10px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--surface2); color: var(--text2);
  border-radius: 99px;
}
.log-body h3 {
  font-family: var(--sans); font-weight: 700;
  font-size: 20px; letter-spacing: -0.01em;
  margin-bottom: 14px; color: var(--text);
}
.log-body h3 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.log-body .log-section { margin-top: 20px; }
.log-body .log-section:first-child { margin-top: 0; }
.log-body .log-section h4 {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 10px;
  font-weight: 500;
}
.log-body ul {
  list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.log-body li {
  font-size: 14px; color: var(--text);
  padding-left: 18px; position: relative;
  line-height: 1.5;
}
.log-body li::before {
  content: ""; position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--accent-l);
  border: 1.5px solid var(--accent);
  box-sizing: border-box;
}
.log-body li strong { font-weight: 600; color: var(--text); }
@media (max-width: 820px) {
  .log-entry { grid-template-columns: 1fr; gap: 18px; }
}

/* --- FAQ disclosure --- */
.faq-list {
  border-top: 1px solid var(--border);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left;
  padding: 20px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  font-family: var(--sans);
  font-size: 16px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.faq-q:hover { color: var(--accent); }
.faq-q .plus {
  font-family: var(--mono); font-size: 18px;
  color: var(--text3); transition: transform .2s, color .2s;
}
.faq-item.open .faq-q .plus {
  transform: rotate(45deg); color: var(--accent);
}
.faq-a {
  display: none;
  padding: 0 0 24px;
  font-size: 15px; color: var(--text2);
  line-height: 1.6; max-width: 70ch;
}
.faq-item.open .faq-a { display: block; }
.faq-a p + p { margin-top: 10px; }

/* --- Contact form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: start;
}
.contact-copy h2 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 20px; color: var(--text);
}
.contact-copy h2 em {
  font-style: italic; color: var(--accent);
  font-weight: 500; font-family: var(--display);
}
.contact-copy p {
  font-size: 16px; color: var(--text2);
  line-height: 1.6; margin-bottom: 14px;
  max-width: 42ch;
}
.contact-direct {
  margin-top: 32px; padding: 24px;
  background: var(--accent-l);
  border-radius: var(--radius-lg);
}
.contact-direct .kicker { margin-bottom: 8px; }
.contact-direct .email {
  font-family: var(--sans);
  font-size: 18px; font-weight: 600;
  color: var(--text); letter-spacing: -0.005em;
}
.contact-direct .email a {
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
}
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 18px;
}
.field label {
  font-family: var(--sans);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text2);
}
.field input, .field textarea, .field select {
  font-family: var(--sans); font-size: 14px;
  padding: 11px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 400;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field textarea { min-height: 120px; resize: vertical; }
@media (max-width: 820px) {
  .contact-grid, .dl-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* --- Mini CTA block (bottom of sub-pages) --- */
.mini-cta {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: var(--surface2);
}
.mini-cta h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 0 auto 18px;
  color: var(--text);
}
.mini-cta h2 em { font-style: italic; color: var(--accent); }
.mini-cta p {
  color: var(--text2); margin-bottom: 28px;
  max-width: 48ch; margin-inline: auto;
  font-size: 16px;
}
.mini-cta .actions {
  display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
}

/* --- Task-card preview (used on hero, download, etc.) --- */
.task-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 10px;
}
.task-preview-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
}
.tp-dots { display: inline-flex; gap: 5px; }
.tp-dots span {
  width: 9px; height: 9px; border-radius: 99px;
  background: var(--border2);
}
.tp-card {
  display: flex; align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.tp-card.priority-high   { border-left: 3.5px solid var(--red); }
.tp-card.priority-medium { border-left: 3.5px solid var(--amber); }
.tp-card.priority-low    { border-left: 3.5px solid var(--blue); }
.tp-card:hover { border-color: var(--border2); }
.tp-check {
  display: flex; align-items: center;
  padding: 12px 6px 12px 12px;
}
.tp-check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-radius: 6px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.tp-check-box.checked {
  background: var(--accent); border-color: var(--accent);
}
.tp-body {
  flex: 1; padding: 11px 8px 11px 4px; min-width: 0;
}
.tp-title {
  font-family: var(--sans);
  font-size: 14px; font-weight: 600;
  color: var(--text); line-height: 1.35;
  margin-bottom: 4px;
}
.tp-title.done {
  color: var(--text3);
  text-decoration: line-through;
}
.tp-meta {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap;
}
.tp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}
.tp-badge.high   { background: var(--red-l);    color: var(--red); }
.tp-badge.medium { background: var(--amber-l);  color: var(--amber); }
.tp-badge.low    { background: var(--blue-l);   color: var(--blue); }
.tp-badge.today  { background: var(--amber-l);  color: var(--amber); font-weight: 700; }
.tp-badge.over   { background: var(--red-l);    color: var(--red); font-weight: 700; }
.tp-badge.due    { background: var(--surface2); color: var(--text3); }
.tp-badge.tag    { color: #fff; font-weight: 500; }
.tp-badge.time   { background: var(--accent-l); color: var(--accent); font-family: var(--mono); font-size: 10px; }

/* Optional bottom stats strip in the preview */
.tp-stats {
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px;
  color: var(--text3); letter-spacing: 0.02em;
}
.tp-stats strong {
  color: var(--text); font-weight: 600;
  margin-left: 4px;
}

/* Responsive hero guard */
@media (max-width: 820px) {
  .page-hero { padding: 56px 0 40px; }
  .section { padding: 64px 0; }
}
