/* ==========================================================================
   My Trusted GP — design tokens
   THE single edit point for the site's look. Change a token, the site follows.
   Light theme in :root; dark theme via [data-theme="dark"] or system setting.
   ========================================================================== */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/newsreader-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/newsreader-italic-latin.woff2') format('woff2');
}

:root {
  /* colour — brand blues (from the logo) + cool ink neutrals */
  --ground: #FBFDFF;
  --bg-top: #E9F2FA;          /* the calm gradient starts here */
  --ink: #14181F;
  --ink-2: #39414C;
  --muted: #5D6875;
  --faint: #8C99A7;
  --line: #DFE7EE;
  --tint: #E4EFFB;
  --tint-2: #D7E8FE;
  --blue: #0053B3;
  --blue-mid: #2A5CB3;
  --blue-deep: #185FA5;
  --navy: #042C53;
  --sky: #85B7EB;
  --footer-link: #B5D4F4;
  --card-shadow: rgba(4, 44, 83, 0.10);
  --notice-bg: #FBF0D9;
  --notice-text: #7A5310;
  --eyebrow-title-color: #042C53;

  /* calm icon hues (Smartraveller-inspired, muted): disc tint + glyph ink pairs.
     Icons only — callouts and everything else stay neutral. */
  --hue-rose-bg: #F7EAE5;   --hue-rose-ink: #BC6A55;
  --hue-teal-bg: #E1F5EE;   --hue-teal-ink: #2F9E86;
  --hue-blue-bg: #E4EFFB;   --hue-blue-ink: #2E6CB8;
  --hue-ochre-bg: #FAF0DC;  --hue-ochre-ink: #B58230;
  --hue-peri-bg: #ECEEFB;   --hue-peri-ink: #5B6FC0;
  --hue-green-bg: #EDF3DE;  --hue-green-ink: #5C8A3A;

  /* card + neutral callout surfaces */
  --card-bg: #FFFFFF;
  --callout-bg: #F2F6FB;
  --callout-line: #DCE6F0;
  --callout-edge: #9DBEE6;

  /* type roles */
  --serif-weight: 400;   /* nudged heavier in dark mode so serif text stays crisp */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;

  /* scale — header, content and footer all share ONE column width so nothing looks mismatched */
  --col: 58rem;
  --radius: 12px;
  --pad-page: clamp(1.25rem, 5vw, 2.5rem);

  color-scheme: light;
}

[data-theme="dark"] {
  --ground: #10171F;
  --bg-top: #13202E;
  --ink: #F2F6FB;
  --ink-2: #DCE5EF;
  --muted: #AAB8C8;
  --faint: #8296AB;
  --line: #2A3B4D;
  --tint: #182A42;
  --tint-2: #1F3557;
  --blue: #8CBAF5;
  --blue-mid: #8CBAF5;
  --blue-deep: #A8CBF7;
  --serif-weight: 450;
  --navy: #071D33;
  --sky: #85B7EB;
  --footer-link: #9CC4F5;
  --card-shadow: rgba(0, 0, 0, 0.4);
  --notice-bg: #2C2312;
  --notice-text: #E3BE79;
  --eyebrow-title-color: #9CC4F5;
  --hue-rose-bg: #33221D;   --hue-rose-ink: #D99C88;
  --hue-teal-bg: #14312A;   --hue-teal-ink: #6FC7AE;
  --hue-blue-bg: #182A42;   --hue-blue-ink: #8CBAF5;
  --hue-ochre-bg: #322809;  --hue-ochre-ink: #D9AE62;
  --hue-peri-bg: #222741;   --hue-peri-ink: #A5B2E9;
  --hue-green-bg: #22301A;  --hue-green-ink: #9CC46F;
  --card-bg: #16222E;
  --callout-bg: #16222E;
  --callout-line: #2A3B4D;
  --callout-edge: #3E5C7F;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10171F;
    --bg-top: #13202E;
    --ink: #F2F6FB;
    --ink-2: #DCE5EF;
    --muted: #AAB8C8;
    --faint: #8296AB;
    --line: #2A3B4D;
    --tint: #182A42;
    --tint-2: #1F3557;
    --blue: #8CBAF5;
    --blue-mid: #8CBAF5;
    --blue-deep: #A8CBF7;
    --serif-weight: 450;
    --navy: #071D33;
    --sky: #85B7EB;
    --footer-link: #9CC4F5;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --notice-bg: #2C2312;
    --notice-text: #E3BE79;
    --eyebrow-title-color: #9CC4F5;
    --hue-rose-bg: #33221D;   --hue-rose-ink: #D99C88;
    --hue-teal-bg: #14312A;   --hue-teal-ink: #6FC7AE;
    --hue-blue-bg: #182A42;   --hue-blue-ink: #8CBAF5;
    --hue-ochre-bg: #322809;  --hue-ochre-ink: #D9AE62;
    --hue-peri-bg: #222741;   --hue-peri-ink: #A5B2E9;
    --hue-green-bg: #22301A;  --hue-green-ink: #9CC46F;
    --card-bg: #16222E;
    --callout-bg: #16222E;
    --callout-line: #2A3B4D;
    --callout-edge: #3E5C7F;
    color-scheme: dark;
  }
}

/* dark mode: same logo, colours flipped by filter (black text -> white, blue stays blue).
   The white PNG in the archive is the OLD logo design — do not use it. */
.logo-dark { display: none; }
[data-theme="dark"] .brand img { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img { filter: invert(1) hue-rotate(180deg); }
}

/* ==========================================================================
   base
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--ground);
  background-image: linear-gradient(180deg, var(--bg-top), var(--ground) 30rem);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: var(--col); margin: 0 auto; padding: 0 var(--pad-page); }

/* the lowercase typewriter eyebrow — a signature of this site */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-transform: lowercase;
  margin: 0 0 0.9rem;
}

/* everything Ahmed "says" is serif */
.voice { font-family: var(--serif); font-weight: var(--serif-weight); }

/* section-title eyebrow — for named sections like "health guides", "from the blog" */
.eyebrow-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--eyebrow-title-color);
  text-align: left;
  margin: 0 0 1rem;
}

/* ==========================================================================
   header + nav
   ========================================================================== */

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ground);
}

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

.construction-banner {
  background: var(--notice-bg);
  border-bottom: 1px solid var(--line);
}
.construction-banner p {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0.5rem var(--pad-page);
  font-size: 0.84rem;
  color: var(--notice-text);
  text-align: center;
}
.site-header .bar {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.35rem var(--pad-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { height: 54px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 1.1rem; }

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  font-size: 1.05rem;
  color: var(--muted);
}
.site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav a:hover { color: var(--blue); text-decoration: none; }

.theme-toggle {
  background: none;
  border: none;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  color: var(--faint);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--blue); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: block; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink-2);
  cursor: pointer;
}

/* ==========================================================================
   homepage
   ========================================================================== */

.hero { padding: 2.8rem 0 0; }
.hero-row { display: flex; gap: 1.6rem; align-items: flex-start; }
.hero-text { flex: 1; }

h1.greeting {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.25rem);
  font-weight: 500;
  line-height: 1.32;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.hero .lede {
  font-family: var(--serif);
  font-weight: var(--serif-weight);
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.hero-links { font-size: 0.95rem; }
.hero-links .dot { color: var(--faint); margin: 0 0.7rem; }
.hero-links .quiet { color: var(--muted); }

.portrait {
  flex: 0 0 136px;
  width: 136px; height: 136px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tint-2);
}

section.home-block { border-top: 1px solid var(--line); margin-top: 2.1rem; padding-top: 1.7rem; }

/* service cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  padding: 0;
  margin: 0 auto;
  max-width: 33rem;   /* keeps the square cards compact, grid centred */
  list-style: none;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* calm hue pairs — set a .hue-* class on the card / s-icon; icons pick up the pair */
.hue-rose  { --icon-bg: var(--hue-rose-bg);  --icon-ink: var(--hue-rose-ink); }
.hue-teal  { --icon-bg: var(--hue-teal-bg);  --icon-ink: var(--hue-teal-ink); }
.hue-blue  { --icon-bg: var(--hue-blue-bg);  --icon-ink: var(--hue-blue-ink); }
.hue-ochre { --icon-bg: var(--hue-ochre-bg); --icon-ink: var(--hue-ochre-ink); }
.hue-peri  { --icon-bg: var(--hue-peri-bg);  --icon-ink: var(--hue-peri-ink); }
.hue-green { --icon-bg: var(--hue-green-bg); --icon-ink: var(--hue-green-ink); }

/* the line-art PNG is used as a stencil (mask); its colour comes from the hue token,
   so icons recolour themselves in dark mode — no second set of image files */
.icon-tint {
  display: block;
  background-color: var(--icon-ink, var(--blue-deep));
  -webkit-mask: var(--icon-url) center / contain no-repeat;
          mask: var(--icon-url) center / contain no-repeat;
}
.icon-disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--icon-bg, var(--tint));
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .icon-tint { width: 38px; height: 38px; }
.card p { font-size: 0.88rem; font-weight: 600; margin: 0.6rem 0 0; color: var(--ink); }
a.card-link { color: inherit; }
a.card-link:hover { text-decoration: none; }
a.card-link:hover .card {
  transform: translateY(-3px) rotate(-0.5deg);
  box-shadow: 0 6px 18px var(--card-shadow);
}
.after-cards { font-size: 0.9rem; color: var(--faint); margin: 0.9rem 0 0; }

/* big guide cards (health guides hub) */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.guide-card {
  background: var(--tint);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  height: 100%;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.guide-card.muted { opacity: 0.68; }
.guide-icon { color: var(--blue); display: inline-flex; margin-bottom: 0.7rem; }
.guide-icon svg { width: 30px; height: 30px; display: block; }
.guide-card h3 { font-family: var(--serif); font-size: 1.08rem; font-weight: 500; margin: 0 0 0.4rem; color: var(--ink); }
.guide-card p { font-family: var(--sans); font-size: 0.86rem; line-height: 1.55; color: var(--muted); margin: 0; }
.guide-card .tag { display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--faint); text-transform: lowercase; margin-top: 0.7rem; }
a.guide-card-link { color: inherit; display: block; }
a.guide-card-link:hover { text-decoration: none; }
a.guide-card-link:hover .guide-card { transform: translateY(-3px) rotate(-0.3deg); box-shadow: 0 8px 22px var(--card-shadow); }

/* article list (homepage + articles hub) */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a, .article-list .soon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0;
}
.article-list a { color: inherit; }
.article-list a:hover { text-decoration: none; }
.article-list a:hover .t { color: var(--blue); }
.article-list .t { font-family: var(--serif); font-weight: var(--serif-weight); font-size: 1.1rem; line-height: 1.45; }
.article-list .d { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); white-space: nowrap; text-transform: lowercase; }
.article-list .soon .t { color: var(--faint); }
.more-link { font-size: 0.95rem; margin: 1rem 0 0; }

/* the single tinted teaser */
.teaser {
  background: var(--tint);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 2.1rem 0 2.4rem;
}
.teaser .eyebrow { color: var(--blue-deep); margin-bottom: 0.5rem; }
.teaser p { font-family: var(--serif); font-weight: var(--serif-weight); font-size: 1.05rem; line-height: 1.7; color: var(--ink-2); margin: 0; }

/* ==========================================================================
   article pages
   ========================================================================== */

.article { padding: 2.6rem 0 1rem; }
.article h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}
.article h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 2.1rem 0 0.7rem;
}
.article h3 { font-size: 1.05rem; font-weight: 600; margin: 1.6rem 0 0.45rem; }
.article p, .article li {
  font-family: var(--serif);
  font-weight: var(--serif-weight);
  font-size: 1.12rem;
  line-height: 1.8;
  color: var(--ink-2);
}
.article ul, .article ol { padding-left: 1.35rem; }
.article strong { color: var(--ink); }

/* neutral callout — ONE quiet style, no severity colour coding (decision 2026-07-05).
   .keypoints opens every article; .callout is the same box for ad-hoc asides. */
.keypoints,
.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-line);
  border-left: 3px solid var(--callout-edge);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin: 1.3rem 0 1.5rem;
}
.keypoints .eyebrow,
.callout .eyebrow { color: var(--blue-deep); margin-bottom: 0.45rem; }
.keypoints ul, .callout ul { margin: 0; padding-left: 1.15rem; }
.keypoints li, .callout li { font-family: var(--sans); font-size: 0.95rem; line-height: 1.7; color: var(--ink); }
.callout > p { margin: 0; }

.author-strip {
  border-top: 1px solid var(--line);
  margin-top: 2.4rem;
  padding: 1.1rem 0;
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.author-strip img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.author-strip .who { font-size: 0.92rem; font-weight: 600; margin: 0; }
.author-strip .disclaimer { font-size: 0.84rem; color: var(--muted); margin: 0.15rem 0 0; line-height: 1.5; }

.prevnext {
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}
.prevnext .back { color: var(--muted); }

/* about page: credential logos */
.credential-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}
.credential-logos img {
  height: 54px;
  width: auto;
  border-radius: 6px;
}
[data-theme="dark"] .credential-logos img {
  background: #fff;
  padding: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .credential-logos img { background: #fff; padding: 4px; }
}

/* contact form (on the about page) */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.4rem 0 2rem;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--tint);
}
.btn-primary {
  align-self: flex-start;
  font: inherit;
  font-size: 0.95rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: transform 0.18s ease;
}
[data-theme="dark"] .btn-primary { color: #08111c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #08111c; }
}
.btn-primary:hover { transform: translateY(-1px); }

.form-status {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin: 1.4rem 0 0;
  border: 1px solid transparent;
}
.form-status.is-ok {
  color: #0f7a4d;
  background: rgba(16, 122, 77, 0.1);
  border-color: rgba(16, 122, 77, 0.3);
}
.form-status.is-err {
  color: #b3261e;
  background: rgba(179, 38, 30, 0.1);
  border-color: rgba(179, 38, 30, 0.3);
}
[data-theme="dark"] .form-status.is-ok { color: #6ee7a8; }
[data-theme="dark"] .form-status.is-err { color: #ff9e97; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-status.is-ok { color: #6ee7a8; }
  :root:not([data-theme="light"]) .form-status.is-err { color: #ff9e97; }
}

.practice-details { margin-top: 1.5rem; }

/* services page: icon + text rows */
.service-list { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.service-list li {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}
.service-list .s-icon {
  flex: 0 0 56px;
  width: 56px; height: 56px;
  background: var(--icon-bg, var(--tint));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-list .s-icon .icon-tint { width: 34px; height: 34px; }
.service-list h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
}
.service-list p { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.6; }

/* science vs: myth list */
.myth-list { list-style: none; padding: 0; margin: 1.6rem 0 0; counter-reset: myth; }
.myth-list li {
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}
.myth-list li::before {
  counter-increment: myth;
  content: counter(myth);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--blue);
  min-width: 1.4rem;
}
.myth-list .myth {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}
.myth-list .verdict { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--faint); text-transform: lowercase; margin-top: 0.35rem; font-style: normal; }

/* ==========================================================================
   footer
   ========================================================================== */

.site-footer {
  background: var(--navy);
  color: var(--sky);
  margin-top: 2rem;
}
.site-footer .inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.8rem var(--pad-page) 1.2rem;
  font-size: 0.84rem;
  line-height: 1.75;
}
.site-footer a { color: var(--footer-link); }

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.2rem;
}
.footer-head {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--footer-link);
  margin: 0 0 0.35rem;
}
.footer-cols p { margin: 0; }

.site-footer .footer-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.8;
  margin: 0 0 0.9rem;
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.76rem;
  opacity: 0.9;
}
.footer-base .theme-toggle { color: var(--footer-link); }
.footer-base .theme-toggle:hover { color: #fff; }

/* ==========================================================================
   motion — one gentle load reveal; honest hovers only
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(10px); }
.js .reveal { animation: rise 0.55s ease forwards; }
.js .reveal:nth-child(2) { animation-delay: 0.08s; }
.js .reveal:nth-child(3) { animation-delay: 0.16s; }
.js .reveal:nth-child(4) { animation-delay: 0.24s; }
.js .reveal:nth-child(5) { animation-delay: 0.32s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .js .reveal { opacity: 1; transform: none; animation: none; }
  .card, a.card-link:hover .card { transition: none; transform: none; box-shadow: none; }
  .guide-card, a.guide-card-link:hover .guide-card { transition: none; transform: none; box-shadow: none; }
}

/* ==========================================================================
   mobile
   ========================================================================== */

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem var(--pad-page) 1rem;
    gap: 0.75rem;
    z-index: 10;
  }
  .site-header { position: relative; }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 1.1rem; }
  .brand img { height: 44px; }

  .hero-row { flex-direction: column-reverse; align-items: center; }
  .portrait { width: 116px; height: 116px; flex-basis: auto; }
  .hero-text { width: 100%; }

  .cards { grid-template-columns: repeat(2, 1fr); }
  .guide-cards { grid-template-columns: 1fr; }

  .article-list a, .article-list .soon { flex-direction: column; gap: 0.15rem; }

  .footer-cols { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ==========================================================================
   Guides — the six pillars hub (guides.html)
   Circular hub on wide screens; a two-column card grid on narrow screens.
   Every colour comes from a token: pillar rings reuse the calm hue-inks.
   ========================================================================== */

.pillar-subnote {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--faint);
  margin: 0.6rem 0 0;
}
.pillar-hub-title { display: none; }   /* shown only in the mobile card layout */

.pillar-hub {
  position: relative;
  z-index: 2;               /* keep hover tooltips above the content below the hub */
  width: 100%;
  max-width: 600px;
  margin: 2.6rem auto 1rem;
  aspect-ratio: 1 / 1;
}
.pillar-spokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pillar-spokes circle,
.pillar-spokes line { stroke: var(--line); fill: none; }

.pillar-centre {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 6px 20px var(--card-shadow);
  border: 1px solid var(--blue-deep);
  z-index: 3;
}
.pillar-centre span {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(0.62rem, 1.7vw, 0.82rem);
  line-height: 1.25;
  padding: 0 0.4rem;
}

.pillar {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34%;
  max-width: 132px;
  aspect-ratio: 1;
  display: block;
  z-index: 4;
}
.pillar,
.pillar:hover { text-decoration: none; }

.pillar-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2.5px solid var(--pillar-ink, var(--line));
  box-shadow: 0 4px 14px var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.4rem;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-width 0.18s ease;
}
.pillar-disc svg {
  width: 30%;
  max-width: 34px;
  height: auto;
  stroke: var(--pillar-ink, var(--blue));
  color: var(--pillar-ink, var(--blue));
}
.pillar-label {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(0.52rem, 1.5vw, 0.68rem);
  line-height: 1.15;
  color: var(--ink-2);
}
.pillar:hover .pillar-disc,
.pillar:focus-visible .pillar-disc {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 26px var(--card-shadow);
  border-width: 3px;
}
.pillar:focus-visible { outline: none; }
.pillar:focus-visible .pillar-disc { outline: 3px solid var(--blue); outline-offset: 3px; }

/* pillar hues — reuse the calm hue-ink tokens (auto light/dark) */
.hue-pillar-teal { --pillar-ink: var(--hue-teal-ink); }
.hue-pillar-sky  { --pillar-ink: var(--hue-blue-ink); }
.hue-pillar-deep { --pillar-ink: var(--blue-deep); }

/* node placement — hexagon, radius 40% from centre */
.pos-nutrition { left: 50%;    top: 10%; }
.pos-activity  { left: 84.64%; top: 30%; }
.pos-sleep     { left: 84.64%; top: 70%; }
.pos-stress    { left: 50%;    top: 90%; }
.pos-social    { left: 15.36%; top: 70%; }
.pos-substance { left: 15.36%; top: 30%; }

/* hover / focus tooltip */
.pillar-tip {
  position: absolute;
  z-index: 9;
  width: 170px;
  padding: 0.6rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--card-shadow);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.pillar:hover .pillar-tip,
.pillar:focus-visible .pillar-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.pillar-tip strong {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.tip-top .pillar-tip    { bottom: calc(100% + 8px); left: 50%; margin-left: -85px; }
.tip-bottom .pillar-tip { top: calc(100% + 8px);    left: 50%; margin-left: -85px; }
.tip-left .pillar-tip   { right: calc(100% + 8px);  top: 50%;  margin-top: -32px; }
.tip-right .pillar-tip  { left: calc(100% + 8px);   top: 50%;  margin-top: -32px; }

.pillar-footnote {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
  max-width: 36rem;
  margin: 0.5rem auto 0;
}

/* --- narrow screens: circle collapses to a card grid, tips always shown --- */
@media (max-width: 600px) {
  .pillar-hub {
    max-width: none;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 1.4rem;
  }
  .pillar-spokes,
  .pillar-centre { display: none; }
  .pillar-hub-title {
    display: block;
    text-align: center;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--eyebrow-title-color);
    margin: 1.6rem 0 0;
  }
  /* the whole pillar becomes a self-contained card; contents flow inside it */
  .pillar {
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 2.5px solid var(--pillar-ink, var(--line));
    border-radius: var(--radius);
    box-shadow: 0 4px 14px var(--card-shadow);
    padding: 1.1rem 0.8rem 1.2rem;
  }
  .pillar-disc {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    aspect-ratio: auto;
    width: auto;
    height: auto;
    padding: 0;
    gap: 0.45rem;
  }
  .pillar-disc svg { width: 30px; }
  .pillar-label { font-size: 0.72rem; }
  .pillar-tip {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    width: auto;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    text-align: center;
    pointer-events: auto;
  }
  /* neutralise the desktop placement offsets (equal specificity, later in source) */
  .tip-top .pillar-tip,
  .tip-bottom .pillar-tip,
  .tip-left .pillar-tip,
  .tip-right .pillar-tip {
    position: static;
    inset: auto;
    margin: 0;
  }
  .pillar-tip strong { display: none; }
  .pillar:hover .pillar-disc,
  .pillar:focus-visible .pillar-disc {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pillar-disc,
  .pillar-tip { transition: none; }
}
