/* Refralo website. The app's own palette: warm ivory / deep ink, one ember accent, sage and
   ochre for passages. System fonts only (New York serif for titles where available). */

:root {
  color-scheme: light dark;
  --canvas: #F6F1E7;
  --surface: #FFFCF6;
  --well: #EFE8DA;
  --ink: #1D222B;
  --ink-2: #5A5F69;
  --line: #DDD4C3;
  --accent: #B9432A;
  --accent-press: #9E3820;
  --on-accent: #FFFFFF;
  --sage: #44703F;
  --dusk: #4F72A0;
  --ochre: #8A5F10;
  --plum: #845A8C;
  --glow-warm: rgba(233, 185, 142, 0.45);
  --glow-cool: rgba(201, 216, 194, 0.5);
  --shadow: 0 18px 40px rgba(60, 40, 20, 0.10);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --wrap: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #11141A;
    --surface: #1A1E26;
    --well: #0C0E13;
    --ink: #EEE8DC;
    --ink-2: #A9A397;
    --line: #2A2F3A;
    --accent: #FF8B6A;
    --accent-press: #FFA488;
    --on-accent: #1A0E0A;
    --sage: #8FBF8A;
    --dusk: #8FB0DA;
    --ochre: #E0B25A;
    --plum: #C39BCB;
    --glow-warm: rgba(122, 58, 38, 0.55);
    --glow-cool: rgba(34, 56, 47, 0.55);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font: 1.125rem/1.65 var(--sans);
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    url("staff.0e23b2ab0fcd.svg"),
    radial-gradient(60rem 36rem at 8% -6%, var(--glow-warm), transparent 70%),
    radial-gradient(60rem 40rem at 100% 105%, var(--glow-cool), transparent 70%);
  background-repeat: no-repeat;
  background-size: 100% 26rem, auto, auto;
  background-position: top 4rem center, 0 0, 0 0;
  background-attachment: scroll, fixed, fixed;
  overflow-wrap: break-word;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; padding-block: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 700 1.35rem/1 var(--serif); }
.brand img { width: 40px; height: 40px; }
.site-header nav ul, .site-footer nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; margin: 0; padding: 0; list-style: none; }
.site-header nav a {
  display: inline-block; padding: 0.45rem 0.8rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem;
}
.site-header nav a:hover { background: color-mix(in srgb, var(--well) 80%, transparent); }
.site-header nav a[aria-current="page"] { background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }

/* Type */
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem); margin: 0.2rem 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); margin: 0.2rem 0 1rem; }
h3 { font-size: 1.3rem; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }
.eyebrow { margin: 0; color: var(--accent); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.lead { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem); color: var(--ink-2); max-width: 40rem; }
.section-lead { color: var(--ink-2); max-width: 44rem; margin-bottom: 2rem; }
.fine, .note { color: var(--ink-2); font-size: 0.95rem; }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
kbd { display: inline-block; padding: 0.05rem 0.45rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); }

/* Buttons: one size for the pair, as in the app. */
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0.75rem; max-width: 38rem; margin: 1.6rem 0 1.2rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 3rem; padding: 0.7rem 1.4rem; border-radius: 1.5rem;
  font-weight: 650; font-size: 1.05rem; line-height: 1.3; text-decoration: none;
}
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-press); }
.button.quiet { background: color-mix(in srgb, var(--well) 70%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button.quiet:hover { background: var(--well); }
.text-link { font-weight: 600; }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4.5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.requirements { color: var(--ink-2); font-size: 0.98rem; max-width: 34rem; }
.hero-art { filter: drop-shadow(var(--shadow)); }

/* Practice illustration (inline SVG, coloured by the theme) */
.practice-art { display: block; width: 100%; }
.practice-art .card { fill: var(--surface); stroke: var(--line); }
.practice-art .art-title { font: 700 28px var(--serif); fill: var(--ink); }
.practice-art .art-meta { font: 15px var(--sans); fill: var(--ink-2); }
.practice-art .band { opacity: 0.85; }
.practice-art .band.sage { fill: var(--sage); }
.practice-art .band.dusk { fill: var(--dusk); }
.practice-art .band.ochre { fill: var(--ochre); }
.practice-art .band.plum { fill: var(--plum); }
.practice-art .band-label { font: 600 12px var(--sans); fill: var(--canvas); }
.practice-art .well { fill: var(--well); }
.practice-art .loop { fill: var(--ochre); opacity: 0.16; }
.practice-art .wave { fill: var(--ink-2); }
.practice-art .wave.in-loop { fill: var(--ink); }
.practice-art .playhead { stroke: var(--accent); stroke-width: 2; }
.practice-art .play { fill: var(--accent); }
.practice-art .on-accent { fill: var(--on-accent); }
.practice-art .pill { fill: var(--well); stroke: var(--line); }
.practice-art .pill-text { font: 600 14px var(--sans); fill: var(--ink); text-anchor: middle; }

/* Sections */
.band { padding: clamp(3rem, 6vw, 5rem) 0; background: color-mix(in srgb, var(--surface) 72%, transparent); border-block: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.features, .privacy-summary { padding: clamp(3rem, 6vw, 5rem) 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.step, .feature, .piece, .contact-card, .credit {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
}
.step p, .feature p { margin: 0; color: var(--ink-2); }
.step-number {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: 0.8rem;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-variant-numeric: tabular-nums;
}
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }

.pieces { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.piece { display: grid; gap: 1.2rem; grid-template-columns: minmax(7rem, 11rem) 1fr; align-items: start; }
@media (max-width: 30rem) { .piece { grid-template-columns: 1fr; } .piece .motif { max-width: 14rem; } }
.pieces > .fine { grid-column: 1 / -1; margin: 0.4rem 0 0; }
.piece h3 { margin-bottom: 0.15rem; }
.piece p { margin-bottom: 0.5rem; }
.piece-composer { color: var(--ink-2); }
.piece-meta { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 0.95rem; }
.motif { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.motif .staff { stroke: color-mix(in srgb, var(--ink-2) 55%, transparent); stroke-width: 1; }
.motif .contour { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.4; }
.motif .contour.ember { stroke: var(--accent); }
.motif .contour.sage { stroke: var(--sage); }
.motif .note.ember { fill: var(--accent); }
.motif .note.sage { fill: var(--sage); }
.passage-list { margin: 0.5rem 0; padding-left: 1.2rem; }

details { border-top: 1px solid var(--line); padding: 0.6rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
details > p { margin: 0.5rem 0 0.4rem; color: var(--ink); }

.split { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1.4fr; } }
.checks { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: 0.8rem; }
.checks li { position: relative; padding-left: 2rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 1.1rem; height: 0.6rem;
  border-left: 3px solid var(--sage); border-bottom: 3px solid var(--sage); transform: rotate(-45deg);
}

.closing-inner { text-align: center; display: grid; justify-items: center; }
.closing-inner .actions { width: 100%; }

/* Document pages */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.doc { display: grid; gap: 2rem; padding-bottom: 4rem; }
@media (min-width: 62rem) { .doc { grid-template-columns: 15rem minmax(0, 46rem); gap: 3.5rem; } .toc { position: sticky; top: 1.5rem; align-self: start; } }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: 0.35rem; }
.toc a { color: var(--ink-2); text-decoration: none; font-size: 0.98rem; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.prose { min-width: 0; }
.prose section { margin-bottom: 2.8rem; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.45rem; }
.callout { border-left: 4px solid var(--sage); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 12px 12px 0; }
.contact-card { margin-bottom: 2.8rem; }
.contact-card .email { font-weight: 700; font-size: 1.1em; }
.defs dt { font-weight: 700; margin-top: 1rem; }
.defs dd { margin: 0.2rem 0 0; }
.credit { margin-bottom: 1rem; }
.credit dl { margin: 0; }
.credit dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-top: 0.8rem; }
.credit dd { margin: 0.15rem 0 0; }
.shortcuts { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 1rem; }
.shortcuts caption { text-align: left; color: var(--ink-2); padding-bottom: 0.4rem; }
.shortcuts th, .shortcuts td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.not-found { padding-bottom: 6rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); padding: 2.2rem 0 2.6rem; font-size: 0.98rem; }
.footer-inner { display: grid; gap: 1rem; }
@media (min-width: 52rem) { .footer-inner { grid-template-columns: 1fr auto; } .footer-inner .fine { grid-column: 1 / -1; } }
.footer-brand p { margin: 0 0 0.3rem; }
.site-footer nav a { display: inline-block; padding: 0.3rem 0.6rem; color: var(--ink); }

@media (forced-colors: active) {
  .button { border: 2px solid ButtonText; }
  .step-number { border: 1px solid CanvasText; }
}

@media print {
  body { background: none; }
  .site-header nav, .toc, .actions, .skip-link { display: none; }
}

/* Private preview notice (preview builds only). */
.preview-banner { background: #5b3a00; color: #fff8ec; font-size: 0.95rem; }
.preview-banner p { margin: 0; padding: 0.6rem 0; }
.preview-banner strong { color: inherit; }
