/* SimpleTextPad — judgestudios.com
   One stylesheet for all three pages. Colours are the app's own theme
   (Sources/SimpleTextPad/Theme.swift), so the site and the app match. */

:root {
  --bg: #1e1e1e;
  --chrome: #252526;
  --raised: #232325;
  --tab-active: #3a3a3c;
  --line: #313134;
  --line-soft: #2a2a2c;
  --text: #e8e8e8;
  --dim: #9a9a9e;
  --accent: #ff8a2b;
  --accent-soft: rgba(255, 138, 43, 0.12);
  --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --measure: 42rem;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #ffa864; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #1a1a1a;
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 20;
}
.skip:focus { left: 0; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--line-soft); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(37, 37, 38, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img { width: 26px; height: 26px; border-radius: 6px; }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.4rem;
  font-size: 0.95rem;
}
.site-nav a { color: var(--dim); text-decoration: none; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

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

.hero { padding: 4.5rem 0 3.5rem; text-align: center; }

.hero img.app-icon {
  width: 104px;
  height: 104px;
  border-radius: 23px;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  font-weight: 650;
}

.tagline {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  color: var(--dim);
  margin: 0 auto 2rem;
  max-width: 34rem;
}

.cta-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.35rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button-primary { background: var(--accent); color: #1a1200; }
.button-primary:hover { background: #ffa04f; color: #1a1200; }
.button-secondary { border-color: var(--line); color: var(--text); }
.button-secondary:hover { border-color: var(--dim); color: var(--text); background: rgba(255, 255, 255, 0.04); }
.button svg { width: 18px; height: 18px; flex: none; }

.requirements {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--dim);
  font-family: var(--mono);
}

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

figure.shot { margin: 3rem 0 0; }

.window {
  max-width: 54rem;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  font-size: 13px;
}

.window-chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--chrome);
  padding: 6px 10px;
  border-bottom: 1px solid #161617;
}

.lights { display: flex; gap: 6px; padding: 0 8px 0 2px; flex: none; }
.lights span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.lights span:nth-child(1) { background: #ff5f57; }
.lights span:nth-child(2) { background: #febc2e; }
.lights span:nth-child(3) { background: #28c840; }

.mock-tabs { display: flex; gap: 1px; min-width: 0; overflow: hidden; }

.mock-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  min-width: 96px;
  max-width: 170px;
  border-radius: 6px;
  color: var(--dim);
  white-space: nowrap;
}
.mock-tab.is-active { background: var(--tab-active); color: var(--text); }
.mock-tab .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(154, 154, 158, 0.55);
  flex: none;
}
.mock-tab.is-active .dot { background: var(--accent); }
.mock-tab .x { margin-left: auto; opacity: 0.55; font-size: 11px; }
.mock-tab .label { overflow: hidden; text-overflow: ellipsis; }

.mock-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  color: var(--dim);
  padding-right: 4px;
  flex: none;
}

.mock-editor {
  margin: 0;
  padding: 1.5rem 1.4rem;
  min-height: 15rem;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
}
.mock-editor .caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
}

.mock-status {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--chrome);
  border-top: 1px solid #161617;
  padding: 0 12px;
  height: 26px;
  font-size: 11px;
  color: var(--dim);
}
.mock-status .push { margin-left: auto; }

figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--dim);
}

/* ---------- headings and text ---------- */

h2 {
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 620;
}

h3 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 + h3 { margin-top: 1.5rem; }

p { margin: 0 0 1.1rem; }

.lede { font-size: 1.1rem; color: var(--dim); }

.section-intro { max-width: var(--measure); margin: 0 auto 2.5rem; text-align: center; }
.section-intro p { color: var(--dim); margin-bottom: 0; }

ul, ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin-bottom: 0.45rem; }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.5rem 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.1em 0.38em;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--raised);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.15em 0.45em;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- feature grid ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.card {
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.card p { margin: 0; color: var(--dim); font-size: 0.95rem; }

.card .marker {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: 0.9rem;
}

/* ---------- callout ---------- */

.callout {
  background: var(--accent-soft);
  border: 1px solid rgba(255, 138, 43, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 0 0 1.5rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent); }

.note {
  background: var(--raised);
  border-left: 3px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 0 0 1.5rem;
  color: var(--dim);
  font-size: 0.95rem;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th { color: var(--dim); font-weight: 550; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
td:last-child, th:last-child { padding-right: 0; }

/* ---------- interior pages (help, privacy) ---------- */

/* The title block on a subpage, sized down from the hero's h1 and aligned
   with the content below it rather than centred like the home page. */
.page-head { padding: 3.5rem 0 2.5rem; }
.page-head h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 0.6rem;
}
.page-head .lede { max-width: var(--measure); margin-bottom: 0; }
.page-head .updated { margin-bottom: 0; }

.page-body { padding-bottom: 4rem; }

.help-layout {
  display: grid;
  gap: 3rem;
  grid-template-columns: 14rem minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 56rem) {
  .help-layout { grid-template-columns: 1fr; gap: 2rem; }
  .toc { position: static !important; }
}

.toc {
  position: sticky;
  top: 5rem;
  font-size: 0.92rem;
  border-left: 1px solid var(--line-soft);
  padding-left: 1rem;
}
.toc h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 0.7rem;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.35rem; }
.toc a { color: var(--dim); text-decoration: none; }
.toc a:hover { color: var(--text); }

.help-body > section {
  padding: 0;
  border: 0;
  margin-bottom: 3rem;
  scroll-margin-top: 5rem;
}
.help-body > section > h2 { margin-bottom: 0.9rem; }

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

details {
  border-bottom: 1px solid var(--line-soft);
  padding: 1rem 0;
}
details summary {
  cursor: pointer;
  font-weight: 550;
  list-style: none;
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+";
  color: var(--accent);
  font-family: var(--mono);
  flex: none;
}
details[open] summary::before { content: "–"; }
details > *:not(summary) { margin-top: 0.8rem; color: var(--dim); }
details p:last-child { margin-bottom: 0; }

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

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--chrome);
  padding: 2.5rem 0;
  font-size: 0.9rem;
  color: var(--dim);
}
.site-footer .wrap {
  display: flex;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

.updated { font-family: var(--mono); font-size: 0.85rem; color: var(--dim); }

/* ---------- print (the privacy policy gets printed and filed) ---------- */

@media print {
  :root { --text: #111; --dim: #444; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .site-footer, .toc, .cta-row, .skip { display: none; }
  a { color: #111; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  section { padding: 0.5rem 0; border: 0; }
  .callout, .note { border: 1px solid #999; background: none; }
}
