/* WorkNook site — palette taken from the app's own colour assets
   (Colors.xcassets), so the pages and the product agree:
   BlueAccent #1A73E6 / #4DA3FF · AppBackground #F6F7FA / #0F1115
   Base #FCFCFE / #1C1F26 · Raised #FFFFFF / #252830                        */

:root {
  --ground: #F6F7FA;
  --surface: #FFFFFF;
  --ink: #12151F;          /* near-black, biased navy — pure #000 is harsh in long text */
  --muted: #5A6274;        /* slate carrying the ground's hue, not a default grey */
  --faint: #858DA0;
  --rule: #E1E5EC;
  --accent: #1A73E6;
  --accent-soft: #EAF1FD;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1115;
    --surface: #1C1F26;
    --ink: #F2F4F8;
    --muted: #A2AAB9;
    --faint: #7B8496;
    --rule: #2A2F3A;
    --accent: #4DA3FF;
    --accent-soft: #182739;
  }
}

:root[data-theme="dark"] {
  --ground: #0F1115;
  --surface: #1C1F26;
  --ink: #F2F4F8;
  --muted: #A2AAB9;
  --faint: #7B8496;
  --rule: #2A2F3A;
  --accent: #4DA3FF;
  --accent-soft: #182739;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: min(100% - 3rem, 66rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 5rem) 4rem;
}

/* Type roles: Plex Sans carries structure, the serif carries reading,
   Plex Mono carries anything that is data rather than prose.            */
h1, h2, h3, .brand, .index-label, nav, footer, .eyebrow, .card h3 {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.brand {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
.brand a { color: inherit; text-decoration: none; }

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0 0 .75rem;
}

.updated {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8125rem;
  color: var(--faint);
  margin: 0 0 2rem;
}

.intro {
  font-size: 1.1875rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}

.masthead { border-bottom: 1px solid var(--rule); padding-bottom: 2.5rem; }

/* Wide screens get the index beside the text; narrow ones get it above,
   where it still works as a jump list.                                  */
.body-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 2.5rem;
  align-items: start;
}
@media (min-width: 60rem) {
  .body-grid { grid-template-columns: 15rem minmax(0, 1fr); }
  .index { position: sticky; top: 2.5rem; }
}

.index-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 .75rem;
}
.index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.index a {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: .9375rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid var(--rule);
  padding-left: .75rem;
  display: block;
}
.index a:hover, .index a:focus-visible { color: var(--accent); border-left-color: var(--accent); }

main { max-width: 64ch; display: grid; gap: 2.25rem; }
main section { scroll-margin-top: 2rem; }

h2 {
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .5rem;
}
h2 .anchor { color: inherit; text-decoration: none; }
h2 .anchor:hover::after,
h2 .anchor:focus-visible::after { content: " #"; color: var(--accent); }

main p { margin: 0; }

a { color: var(--accent); }
a:focus-visible, .index a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Support page */
.eyebrow {
  font-size: .75rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 .75rem;
}
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.25rem 1.375rem;
}
.card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .375rem; }
.card p { margin: 0; font-size: .9375rem; color: var(--muted); }

.contact {
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.5rem 1.625rem;
  margin: 0;
}
.contact p { margin: 0; }
.contact .address {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.0625rem;
}

dl.faq { display: grid; gap: 1.75rem; margin: 0; max-width: 64ch; }
dl.faq dt { font-family: "IBM Plex Sans", sans-serif; font-weight: 600; margin-bottom: .375rem; }
dl.faq dd { margin: 0; color: var(--muted); }

footer {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: .875rem;
  color: var(--faint);
  display: grid;
  gap: .4rem;
}
footer a { color: var(--muted); }
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

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