/* ==========================================================================
   Dawn Studio — legal & support pages
   Used by: privacy.html, terms.html, support.html, delete-account.html
   Self-contained on purpose (does not depend on css/site.css).
   Colours and fonts mirror css/site.css ("Midnight Collage").
   ========================================================================== */

:root {
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --border: #2a2a2f;
  --text: #efeae2;
  --muted: rgba(239, 234, 226, 0.68);
  --faint: rgba(239, 234, 226, 0.45);
  --accent: #ff8a4c;
  --accent-soft: rgba(255, 90, 31, 0.12);

  /* Placeholder highlight: deliberately loud so unfilled fields can't ship unnoticed */
  --ph-bg: #ffd447;
  --ph-text: #17130a;

  --serif: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --serif-em: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 24px;
  --article: 720px;
  --toc: 220px;
  --radius: 10px;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: rgba(77, 163, 255, 0.35);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border-radius: 6px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Shell ---------- */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.logo {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
  color: var(--text);
}

.logo em {
  font-style: italic;
}

.site-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a,
.mono-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  border-bottom: 1px solid var(--text);
}

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--text);
}

.copyright {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

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

.page {
  padding-top: 64px;
}

.layout {
  display: block;
}

.layout--toc {
  display: block;
}

/* Small screens: title → contents → article, all in one column */
.layout--toc > .page-head,
.layout--toc > .toc {
  max-width: var(--article);
  margin-left: auto;
  margin-right: auto;
}

/* Wide screens: sticky contents in a left column, title + article on the right */
@media (min-width: 1080px) {
  .layout--toc {
    display: grid;
    grid-template-columns: var(--toc) minmax(0, var(--article));
    grid-template-rows: auto 1fr;
    column-gap: 72px;
    justify-content: center;
    align-items: start;
  }

  .layout--toc > .page-head {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    margin-right: 0;
  }

  .layout--toc > .toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin: 0;
  }

  .layout--toc > .article {
    grid-column: 2;
    grid-row: 2;
  }
}

.article {
  max-width: var(--article);
  margin: 0 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.layout--toc .article {
  margin: 0;
}

@media (max-width: 1079px) {
  .layout--toc .article {
    margin: 0 auto;
  }
}

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

.page-head {
  margin-bottom: 40px;
}

.eyebrow {
  display: block;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--text);
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 1.04;
}

h1 em,
h2 em {
  font-style: italic;
}

.lede {
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}

.meta {
  margin: 24px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.meta .ph {
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Typography in articles ---------- */

.article h2 {
  margin: 72px 0 18px;
  font-size: clamp(30px, 4vw, 38px);
  line-height: 1.15;
  scroll-margin-top: 24px;
}

.article h2:first-child {
  margin-top: 0;
}

.article h3 {
  margin: 40px 0 10px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  scroll-margin-top: 24px;
}

.article h4 {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.article p,
.article ul,
.article ol,
.article dl {
  margin: 0 0 18px;
}

.article ul,
.article ol {
  padding-left: 1.3em;
}

.article li {
  margin: 0 0 8px;
}

.article li::marker {
  color: var(--faint);
}

.article strong {
  font-weight: 600;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 15px;
}

ol.alpha {
  list-style: none;
  padding-left: 0;
}

ol.alpha li {
  display: grid;
  grid-template-columns: 2.1em 1fr;
}

ol.alpha .letter {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  padding-top: 0.2em;
}

/* Heading anchors */

.anchor {
  margin-left: 0.4em;
  font-family: var(--mono);
  font-size: 0.55em;
  font-weight: 400;
  color: var(--faint);
  text-decoration: none;
  opacity: 0;
  vertical-align: 0.2em;
  transition: opacity 0.15s ease;
}

h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.article h4 {
  scroll-margin-top: 24px;
}

/* Key–value facts (company details etc.) */

.facts {
  display: grid;
  grid-template-columns: minmax(140px, 30%) 1fr;
  margin: 20px 0 24px;
  border-top: 1px solid var(--border);
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.facts dt {
  padding-right: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
  }

  .facts dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .facts dd {
    padding-top: 2px;
  }
}

.anchor:hover {
  color: var(--accent);
}

@media (hover: none) {
  .anchor {
    opacity: 0.6;
  }
}

/* ---------- Placeholders (must be replaced before launch) ---------- */

.ph {
  display: inline;
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-family: var(--mono);
  font-size: 0.82em;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

a .ph,
a.ph {
  text-decoration: none;
}

/* ---------- Components ---------- */

.toc {
  margin: 0 0 48px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc-title {
  margin: 0 0 12px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li {
  margin: 0;
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 2.1em 1fr;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 0.25em;
  color: var(--faint);
}

.toc a:hover {
  color: var(--text);
}

@media (max-width: 1079px) {
  .toc ol {
    columns: 2;
    column-gap: 24px;
  }

  .toc li {
    break-inside: avoid;
  }
}

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

@media (min-width: 1080px) {
  .toc {
    position: sticky;
    top: 32px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    scrollbar-width: thin;
  }
}

.callout {
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: block;
  margin: 0 0 10px;
}

.summary-box {
  margin: 0 0 56px;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.summary-box h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.summary-box ul {
  margin: 0;
}

.summary-box li:last-child {
  margin-bottom: 0;
}

/* Template block for per-app notices */

.template-block {
  position: relative;
  margin: 32px 0;
  padding: 26px 24px 20px;
  border: 2px dashed var(--ph-bg);
  border-radius: var(--radius);
  background: rgba(255, 212, 71, 0.04);
}

.template-label {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.template-block h3 {
  margin-top: 0;
}

.template-block dl {
  display: grid;
  grid-template-columns: minmax(150px, 34%) 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.template-block dt,
.template-block dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.6;
}

.template-block dt {
  padding-right: 16px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .template-block dl {
    grid-template-columns: 1fr;
  }

  .template-block dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .template-block dd {
    padding-top: 0;
  }
}

/* Tables: scroll horizontally on small screens */

.table-wrap {
  margin: 24px 0 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap:focus-visible {
  outline-offset: 2px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

table.narrow {
  min-width: 480px;
}

caption {
  padding: 14px 16px 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
  color: var(--text);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

td ul {
  margin: 0;
  padding-left: 1.1em;
}

td li {
  margin: 0 0 4px;
}

.scroll-hint {
  display: none;
  margin: -16px 0 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 720px) {
  .scroll-hint {
    display: block;
  }
}

/* Steps & cards */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0 !important;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding-left: 44px;
  margin-bottom: 14px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.path {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.4em;
  white-space: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 36px;
}

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

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin-top: 0 !important;
}

.card > :last-child {
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.button:hover {
  text-decoration: none;
  background: #ffffff;
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.button--ghost:hover {
  background: var(--surface-2);
}

.contact-card {
  display: grid;
  gap: 4px;
  margin: 24px 0 32px;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.contact-card .button {
  justify-self: start;
  margin-top: 16px;
}

.contact-card p {
  margin: 0;
}

/* FAQ (details / summary) */

.faq {
  margin: 24px 0 40px;
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 24px;
}

.faq summary {
  position: relative;
  display: block;
  padding: 20px 44px 20px 0;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
}

.faq details[open] > summary::after {
  content: "\2212";
}

.faq summary h3 {
  display: inline;
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.faq summary:hover h3 {
  color: var(--accent);
}

.faq .answer {
  padding: 0 0 22px;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

.faq .answer h4:first-child {
  margin-top: 0;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0 !important;
}

.quick-links li {
  margin: 0;
}

.quick-links a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.quick-links a:hover {
  color: var(--text);
  border-color: var(--muted);
}

.legal-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0 !important;
}

@media (max-width: 640px) {
  .legal-links {
    grid-template-columns: 1fr;
  }
}

.legal-links li {
  margin: 0;
}

.legal-links a {
  display: block;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.legal-links a:hover {
  border-color: var(--muted);
}

.legal-links span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 16.5px;
  }

  .page {
    padding-top: 44px;
  }

  .site-header .container {
    min-height: 64px;
    gap: 16px;
  }

  .logo {
    font-size: 21px;
  }

  .site-nav ul {
    gap: 16px;
  }

  .site-nav a {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .article h2 {
    margin-top: 56px;
  }

  .summary-box,
  .contact-card {
    padding: 22px 20px;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .site-nav ul {
    gap: 12px;
  }

  .site-nav a {
    letter-spacing: 0.06em;
  }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --border: #bbbbbb;
    --text: #000000;
    --muted: #333333;
    --faint: #555555;
    --accent: #000000;
    color-scheme: light;
  }

  @page {
    margin: 18mm 16mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  .skip-link,
  .site-nav,
  .toc,
  .anchor,
  .scroll-hint,
  .quick-links,
  .footer-links,
  .button {
    display: none !important;
  }

  .site-header,
  .site-footer {
    border-color: #bbb;
  }

  .site-footer {
    margin-top: 32px;
    padding: 12px 0 0;
  }

  .page {
    padding-top: 20px;
  }

  .layout--toc {
    display: block;
  }

  .article {
    max-width: none;
  }

  h1 {
    font-size: 30pt;
  }

  .article h2 {
    margin-top: 28pt;
    font-size: 18pt;
    break-after: avoid;
  }

  .article h3 {
    break-after: avoid;
  }

  a {
    color: #000;
  }

  .article a[href^="http"]::after,
  .article a[href^="mailto"]::after {
    content: " <" attr(href) ">";
    font-size: 0.85em;
    word-break: break-all;
  }

  .table-wrap {
    overflow: visible;
    border-color: #bbb;
  }

  table {
    min-width: 0 !important;
    font-size: 9.5pt;
  }

  thead th {
    background: #f0f0f0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tr,
  .callout,
  .card,
  .template-block {
    break-inside: avoid;
  }

  .ph,
  .template-label {
    background: #ffe680 !important;
    color: #000 !important;
    outline: 1px solid #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .template-block {
    border-color: #000;
  }

  .faq details > .answer {
    display: block;
  }

  .faq details::details-content {
    content-visibility: visible;
    display: block;
  }

  .faq summary::after {
    content: none;
  }
}

/* ---------- Midnight Collage alignment (matches css/site.css) ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.logo__mark {
  width: 32px;
  height: auto;
  flex: none;
}

h1,
h2 {
  font-weight: 600;
  letter-spacing: -0.03em;
}

h1 em,
h2 em,
.logo em {
  font-family: var(--serif-em);
  font-weight: 400;
  letter-spacing: -0.01em;
}
