/* ===========================================================
   Pixel.Noted — site styles (matches the NotedSuite redesign)
   Calm, low-noise, ADHD-friendly. One message at a time.
   Light = ink on warm paper; dark = dusk-lake navy + coral.
   Theme follows the visitor's system (prefers-color-scheme).
   =========================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light palette (default) */
  --bg:         #faf9f7;
  --bg-soft:    #f2efe9;
  --text:       #10162e;
  --text-dim:   #565e78;
  --accent:     #ff8a6b;
  --accent-deep:#bc431f;
  --accent-2:   #ffd2a8;
  --card:       #ffffff;
  --card-line:  rgba(16, 22, 46, 0.10);
  --chip-bg:    #ffffff;
  --shot-shadow: rgba(16, 22, 46, 0.18);
  --header-bg:  rgba(250, 249, 247, 0.85);
  --nav-bg:     rgba(250, 249, 247, 0.97);

  --radius: 18px;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0e1326;
    --bg-soft:    #141a32;
    --text:       #f2f4fb;
    --text-dim:   #aeb6cf;
    --accent:     #ff8a6b;
    --accent-deep:#ff9d80;
    --accent-2:   #ffd2a8;
    --card:       #141a32;
    --card-line:  rgba(255, 255, 255, 0.14);
    --chip-bg:    #141a32;
    --shot-shadow: rgba(0, 0, 0, 0.5);
    --header-bg:  rgba(14, 19, 38, 0.82);
    --nav-bg:     rgba(14, 19, 38, 0.96);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

h1, h2, h3 { font-family: var(--font-display); }

/* ---------- SITE HEADER (matches notedsuite.app) ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 0.9rem 1.25rem;
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
  background: transparent;
}
.site-header.is-solid {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--card-line), 0 10px 30px rgba(16, 22, 46, 0.06);
  padding: 0.6rem 1.25rem;
}
.header-inner {
  /* Full-bleed: wordmark hugs the left window edge, hamburger the right,
     at every window size. */
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--accent-deep); }

/* Nav is always a slide-in drawer behind the hamburger (right side) */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100svh;
  width: min(78vw, 320px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 5.5rem 2rem 2rem;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--card-line);
  box-shadow: -20px 0 50px rgba(16, 22, 46, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: -1; /* below the toggle button */
}
.site-nav.is-open { transform: translateX(0); }
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.9rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(16, 22, 46, 0.07);
}
.site-nav a:hover { color: var(--text); }
.site-nav { overflow-y: auto; }
.nav-heading {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 1.6rem 0 0.3rem;
}
.nav-heading:first-child { margin-top: 0; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(5.5rem, 10vw, 7rem) 1.25rem 2.5rem;
  text-align: center;
}
.hero img {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  box-shadow: 0 16px 40px rgba(16, 22, 46, 0.25);
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 1.25rem 0 0.5rem;
}
.hero h1 .suite { color: var(--accent-deep); }
.hero .tag {
  color: var(--text-dim);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  margin: 0 auto;
  max-width: 34ch;
}

/* ---------- BADGE / CTA NOTE (matches tab.noted) ---------- */
.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-dim);
  border: 1px solid var(--card-line);
  font-size: 1rem;
  font-weight: 600;
  cursor: default;
}
.badge-pending .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.cta-note {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- FEATURE BANDS ---------- */
.feature-band { padding: clamp(2.5rem, 6vw, 3.5rem) 1.25rem; }
.feature-band--alt { background: var(--bg-soft); }
.feature-band-inner { max-width: 640px; margin: 0 auto; }
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.6rem;
}
.feature-band h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.feature-band p { color: var(--text-dim); margin: 0 0 0.5rem; }
.feature-band p.detail { font-size: 0.9rem; opacity: 0.85; }

/* ---------- FEATURE GRID (pointer-tracked glow) ---------- */
.feature-grid {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 3.5rem) 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.feature-grid-item {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  box-shadow: 0 4px 14px rgba(16, 22, 46, 0.04);
}
.feature-grid-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 138, 107, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.feature-grid-item:hover::before { opacity: 1; }

/* ---------- PRICING BLOCK ---------- */
.pricing-block {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 3.5rem) 1.25rem 4rem;
  text-align: center;
}
.pricing-block .price-label {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
.pricing-block .price-line { color: var(--text-dim); margin: 0 0 0.5rem; }

/* ---------- BUTTONS / BADGE ---------- */
.btn {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1a0f0a;
  font-weight: 600;
  text-decoration: none;
}
.btn.disabled {
  background: var(--chip-bg);
  color: var(--text-dim);
  border: 1px solid var(--card-line);
  cursor: default;
}

/* ---------- SCREENSHOTS ---------- */
.shots {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  display: grid;
  gap: 1.5rem;
}
.shot { text-align: center; }
.shot img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--card-line);
  box-shadow: 0 24px 60px var(--shot-shadow);
}
.shot .cap { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.75rem; }

/* ---------- FEATURE CARDS (pointer-tracked glow) ---------- */
.features {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.feature {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(16, 22, 46, 0.05);
}
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 138, 107, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.feature:hover::before { opacity: 1; }
.feature h3 { margin: 0 0 0.4rem; font-size: 1.1rem; font-weight: 700; }
.feature p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

/* ---------- SIMPLE CONTENT PAGES (help) ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(5.5rem, 10vw, 7rem) 1.25rem clamp(3rem, 8vw, 6rem);
}
.page a.back { color: var(--accent-deep); text-decoration: none; font-size: 0.95rem; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 1rem 0 0.25rem; letter-spacing: -0.02em; }
.page .updated { color: var(--text-dim); margin: 0 0 2rem; font-size: 0.9rem; }
.page h2 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.page h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; color: var(--text); }
.page p, .page li { color: var(--text-dim); }
.page a { color: var(--accent-deep); }
.page-wide { max-width: 900px; }

.page code {
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  color: var(--text);
  white-space: nowrap;
}

/* Wide tables scroll inside their own container on small screens */
.page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.75rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.page th, .page td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--card-line);
  font-size: 0.95rem;
}
.page th { color: var(--text); font-weight: 600; }
.page td { color: var(--text-dim); }

/* ---------- FAQ (app landing page) ---------- */
.faq-block {
  max-width: 760px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}
.faq-block h2 {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  text-align: center;
  margin: 0 0 1.5rem;
}
.faq-block details {
  border-bottom: 1px solid var(--card-line);
  padding: 0.9rem 0.25rem;
}
.faq-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #10162e;
  font-weight: 700;
  font-size: 1rem;
  line-height: 24px;
  text-align: center;
}
.faq-block details[open] summary::before { content: "−"; }
.faq-block summary:hover { color: var(--accent-deep); }
.faq-block details[open] summary { color: var(--accent-deep); }
.faq-block details p {
  color: var(--text-dim);
  margin: 0.6rem 0 0.2rem calc(24px + 0.75rem);
  line-height: 1.6;
}
.faq-block code {
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  color: var(--text);
  white-space: nowrap;
}
.faq-more {
  text-align: center;
  margin: 1.75rem 0 0;
}
.faq-more a { color: var(--accent-deep); }

/* ---------- HELP SEARCH ---------- */
.help-search { margin: 1.75rem 0 0; }
.search-pill {
  position: relative;
  max-width: 560px;
  /* room for the circle to overhang the pill's right edge */
  padding-right: 14px;
}
.search-pill input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  height: 52px;
  padding: 0 68px 0 1.4rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 2px 10px rgba(16, 22, 46, 0.08);
}
.search-pill input[type="search"]:focus {
  border-color: var(--accent);
}
.search-pill input[type="search"]::placeholder {
  color: var(--text-dim);
}
.search-btn {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #10162e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 22, 46, 0.15);
}
.search-btn:hover { background: var(--accent-2); }
.search-btn:active { transform: translateY(-50%) scale(0.96); }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 14px;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 22, 46, 0.18);
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}
.search-results[hidden] { display: none; }
.search-results li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.search-results li:hover,
.search-results li.active { background: var(--bg-soft); }
.search-results .result-title { font-size: 0.95rem; }
.search-results .result-context { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.search-results .search-empty { cursor: default; color: var(--text-dim); font-size: 0.9rem; }
.search-results .search-empty:hover { background: none; }
.page h2, .page h3 { scroll-margin-top: 90px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- HELP / TOC ---------- */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0 3rem;
}
.toc h2 { margin: 0 0 0.75rem; }
.toc ul { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: 0.5rem; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.back-to-top { display: inline-block; margin: 0 0 2.5rem; font-size: 0.9rem; }

@media (max-width: 640px) {
  .toc ul { columns: 1; }
}

/* ---------- FLOATING BACK TO TOP ---------- */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  color: var(--accent-deep);
  border: 1px solid var(--card-line);
  box-shadow: 0 6px 18px rgba(16, 22, 46, 0.18);
  text-decoration: none;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--bg-soft); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--card-line);
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
footer a { color: var(--text-dim); text-decoration: none; margin: 0 0.6rem; }
footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .feature::before,
  .site-header, .site-nav, .nav-toggle span { transition: none; }
}
