/* SortGlass: a photographic, black-canvas foundation for every page.
   The homepage adds assets/css/home.css. No web fonts or frameworks.
   App screenshots retain their own interface; the site stays quiet. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #000000;
  --bg-2: #0d0f0e;
  --surface: #151816;
  --surface-2: #1c201d;
  --text: #f4f3ef;
  --text-2: #c2c6c0;
  --text-3: #a1aaa1;
  --line: rgba(244, 243, 239, 0.18);
  --line-2: rgba(244, 243, 239, 0.3);
  --control-line: #79847b;

  /* Retained names keep existing components compatible with the palette. */
  --cyan: #98c4a2;
  --violet: #c1aad0;
  --amber: #ddb783;
  --spectrum: var(--cyan);

  --link: #8cc7ff;
  --focus: #8cc7ff;
  --button: #2a6fdb;
  --button-hover: #2763c4;
  /* Vivid refractions with broad, continuous transitions and matching ends. */
  --spectrum-stops: #38d6ff 0%, #527dff 17%, #ac5dff 34%, #ff5ab5 50%, #ff9c45 65%, #ffe16b 76%, #4edbd1 88%, #38d6ff 100%;
  --heart: #e9a0b0;
  --trash: #f4998d;
  --star: #e5c471;

  --glass: var(--surface);
  --glass-solid: var(--surface);
  --glass-line: var(--line);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.3, 0.5, 1);

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(88px, 13vw, 168px);
  --nav-h: 60px;

  --r-xl: 8px;
  --r-l: 6px;
  --r-m: 4px;
  --r-s: 4px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
b, strong { font-weight: 600; color: var(--text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 6px var(--bg);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-s);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.icon {
  width: 1.15em; height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon .fill, .icon.fill { fill: currentColor; stroke: none; }

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

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Compatibility helpers: neutral type and a quiet editorial rule. */
.micro-ca {
  --ca-shift: 0;
  --ca-strength: 0;
  --ca: 0 0 transparent;
  text-shadow: none;
}

.prism {
  position: relative;
  display: inline-block;
  width: 32px; height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--spectrum-stops)) 0 0 / 180% 100% no-repeat;
  box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .22);
  flex: none;
}
.prism::before, .prism::after {
  content: "";
  position: absolute;
  /* Identical geometry and inherited phase keep both blooms on the rod. */
  inset: 0;
  border-radius: inherit;
  background: inherit;
  pointer-events: none;
}
.prism::before { filter: blur(5px); opacity: .55; }
.prism::after { filter: blur(1.6px); opacity: .48; }
@media (prefers-reduced-motion: no-preference) {
  .prism { animation: prism-flow 10s ease-in-out infinite alternate; animation-play-state: paused; }
  html:not(.is-page-hidden) .prism.is-motion-visible { animation-play-state: running; }
}
@keyframes prism-flow { to { background-position: 100% 0; } }

/* App tab-title typography, adapted to readable section sizes. */
.title, .tab-title {
  font-family: var(--font);
  font-weight: 700;
}
.tab-title { letter-spacing: 1.5px; text-transform: uppercase; }

.display {
  font-size: clamp(2.6rem, 6.6vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.title {
  font-size: clamp(2.1rem, 4.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: 1.5px;
}

.lede {
  max-width: 34em;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
}

.fineprint {
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.55;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
.status-now::before { background: var(--cyan); }
.status-dev::before { background: var(--amber); }
.status-planned::before { background: var(--violet); }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-s);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Buttons and links ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-s);
  background: var(--button);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s var(--ease-out);
}
.button:hover { background: var(--button-hover); text-decoration: none; }
.button:active { transform: scale(0.97); }
.button-quiet {
  background: transparent;
  border-color: var(--control-line);
  color: var(--text);
}
.button-quiet:hover { background: var(--bg-2); }
.nav-download { border-radius: 999px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.link-arrow .icon { transition: transform 0.25s var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(3px); }
.link-arrow:hover { text-decoration: underline; }

.store-badge {
  display: inline-block;
  border-radius: 10px;
  line-height: 0;
}
.store-badge img { width: 150px; height: 50px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav.is-scrolled,
.nav.is-open {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.no-js .nav { position: static; background: var(--bg); border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); text-decoration: underline; }

.nav-download { min-height: 44px; padding: 6px 16px; font-size: 0.875rem; }
.nav-download .icon { width: 16px; height: 16px; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  margin-right: -10px;
  border: 0;
  border-radius: var(--r-s);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav.is-open .nav-toggle .icon-open { display: none; }
.nav.is-open .nav-toggle .icon-close { display: block; }

@media (max-width: 1040px) {
  .nav-inner { gap: 12px; }
  .js .nav-toggle { display: inline-flex; }
  .js .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    z-index: 1;
    min-height: calc(100vh - var(--nav-h));
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
  }
  .js .nav-menu[hidden] { display: none; }
  .js .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav-links a {
    display: flex;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 1.125rem;
    color: var(--text);
  }
  .no-js .nav { height: auto; }
  .no-js .nav-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .no-js .nav-links { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .nav-inner { gap: 8px; }
  .nav-download { padding: 6px 12px; }
  .nav-download .icon { display: none; }
}
@media (min-width: 1041px) {
  .nav-menu[hidden] { display: block; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .lede { margin-top: 20px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

/* ---------- Quiet surface (legacy utility name) ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
}


/* ---------- Screen frame for real app screenshots ---------- */
.screen {
  position: relative;
  width: min(100%, 318px);
  padding: 9px;
  border-radius: 46px;
  background: #050608;
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.screen-glass {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 37px;
  background: #000;
  aspect-ratio: 640 / 1388;
}
.screen-glass > img,
.screen-glass > video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.screen::after { content: none; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  --footer-ink: #808080;
  padding: 56px 0 64px;
  border-top: 1px solid var(--line);
  color: var(--footer-ink);
  font-size: 0.875rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding-bottom: 28px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 6px; list-style: none; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--footer-ink);
  text-decoration: none;
}
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--text-2); text-decoration: underline; }
.footer-links a[aria-current="page"] { text-decoration: underline; }
.footer-legal { display: grid; gap: 10px; max-width: 70em; line-height: 1.55; }
.footer-legal a { color: inherit; }
.footer-legal a:hover, .footer-legal a:focus-visible { color: var(--text-2); }

/* ================================================================
   DOCUMENT PAGES (guide, support, privacy, accessibility)
   ================================================================ */
.page-head {
  padding: clamp(48px, 8vw, 112px) 0 clamp(32px, 5vw, 56px);
}
.page-head h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.page-head .lede { margin-top: 20px; }
.page-head .updated { margin-top: 16px; color: var(--text-3); font-size: 0.9375rem; }

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding-bottom: var(--section);
}
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
}
.toc p { margin-bottom: 10px; color: var(--text-3); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; }
.toc ol { list-style: none; border-left: 1px solid var(--line); }
.toc a {
  position: relative;
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover { color: var(--text); border-left-color: var(--text-2); }
.toc a[aria-current="location"] {
  color: var(--text);
  border-left-color: transparent;
  background: var(--bg-2);
  font-weight: 600;
}
.toc a[aria-current="location"]::before {
  content: "";
  position: absolute;
  left: -2px; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--spectrum-stops));
}

.doc { max-width: 720px; }
.doc > section { padding-top: 8px; margin-bottom: 56px; }
.doc h2 {
  margin-bottom: 18px;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing: -0.018em;
  line-height: 1.18;
}
.doc h3 { margin: 28px 0 8px; font-family: var(--font); font-weight: 700; font-size: 1.1875rem; letter-spacing: .02em; }
.doc h2.tab-title { letter-spacing: 1.5px; }
.doc p, .doc li { color: var(--text-2); }
.doc p + p { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 1.3em; margin-top: 12px; }
.doc li { margin: 8px 0; padding-left: 4px; }
.doc li::marker { color: var(--text-3); }
.doc ul > li > a:only-child { display: inline-block; padding: 3px 0; }
.doc .guide-figure {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin: 28px 0;
}
.doc .guide-figure .screen { width: 210px; flex: none; padding: 7px; border-radius: 34px; }
.doc .guide-figure .screen-glass { border-radius: 27px; }
.doc .guide-figure .screen-glass img { position: static; }
.doc .guide-figure .screen-glass video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc .guide-figure figcaption { color: var(--text-3); font-size: 0.875rem; }
.doc kbd {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  font: inherit;
  font-size: 0.875em;
  color: var(--text);
}
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: var(--r-m);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}
.callout p { color: var(--text-2); }
.callout b { color: var(--text); }

/* Used on both the homepage and Support. */
.faq { max-width: 860px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 20px 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 20px; height: 20px; color: var(--text-2); transition: transform 0.3s var(--ease-out); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details > div { padding: 0 0 24px; color: var(--text-2); max-width: 44em; }
.faq details > div p + p { margin-top: 12px; }

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px 28px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-l);
  margin-bottom: 56px;
}
.contact-card img { width: 72px; height: 72px; border-radius: 17px; }
.contact-card h2 { margin: 0 0 6px; font-size: 1.5rem; }
.contact-card p { color: var(--text-2); }
.contact-card .cta-row { grid-column: 1 / -1; margin-top: 0; }

/* Privacy and accessibility documents keep their own numbered structure. */
.legal { max-width: 760px; padding: clamp(48px, 8vw, 104px) 0 var(--section); }
.legal h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.legal .updated { color: var(--text-3); margin-bottom: 28px; }
.legal h2 { margin: 44px 0 14px; font-size: 1.5rem; letter-spacing: -0.02em; }
.legal p, .legal li { color: var(--text-2); }
.legal p + p { margin-top: 14px; }
.legal ul { padding-left: 1.3em; margin: 12px 0 14px; }
.legal li { margin: 8px 0; }
.legal address { margin-top: 14px; font-style: normal; color: var(--text-2); }
.legal a { overflow-wrap: anywhere; }

.not-found { padding: clamp(80px, 16vw, 200px) 0; text-align: center; }
.not-found .lede { margin: 18px auto 0; }
.not-found .cta-row { justify-content: center; }

/* ================================================================
   RESPONSIVE (shared and document pages)
   ================================================================ */
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 24px; }
  .toc li { break-inside: avoid; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .contact-card { grid-template-columns: 1fr; }
  .doc .guide-figure { flex-direction: column; }
  .toc ol { columns: 1; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-links { margin-left: -8px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .glass { border: 1px solid CanvasText; }
  .button { border-color: ButtonText; }
  .prism, .status::before { background: CanvasText; }
  .prism::before, .prism::after { display: none; }
  .toc a[aria-current="location"] { border-left-color: Highlight; }
  .toc a[aria-current="location"]::before { background: Highlight; }
  :focus-visible { outline-color: Highlight; box-shadow: none; }
}

/* ---------- Print ---------- */
@media print {
  .prism { display: none; }
  :root {
    color-scheme: light;
    --bg: #fff;
    --bg-2: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --text: #000;
    --text-2: #000;
    --text-3: #333;
    --link: #000;
    --line: #ccc;
    --line-2: #999;
  }
  body { background: #fff; color: #000; }
  .nav, .footer, .toc, .skip-link { display: none !important; }
  .doc p, .doc li, .legal p, .legal li, .lede { color: #000; }
  a { color: #000; }
  .micro-ca { --ca: 0 0 transparent; }
}
