/* The refresh's design system: one set of colours, type, spacing, corners and motion, and the shared
   components built from them. Every name starts with dh- so it never clashes with the older style sheets
   while pages move over one by one (plan: phases 1 to 4).
   Fonts: Space Grotesk (headings) and DM Sans (text), served from /assets like the style sheets
   (src/client/fonts, SIL Open Font License); assets/client-files.js fills in their addresses below.
   Every text colour pair used below passes WCAG AA; tests/design-system.test.js measures them. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/dm-sans-latin.fdfefae5.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/dm-sans-latin-ext.aec4f297.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/assets/space-grotesk-latin.a73ca249.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/assets/space-grotesk-latin-ext.f24b4493.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Colours (master plan, "Colour and type system") */
  --dh-ink: #0B1A16;          /* text; primary buttons on light */
  --dh-on-block: #26332F;     /* secondary text on Mint, Lilac and Amber tiles */
  --dh-muted: #4A5A55;        /* secondary text on white and Soft */
  --dh-forest: #1F5F4F;       /* brand: logo, links, icons, selected borders, button hover */
  --dh-deep: #0E2A23;         /* hero block, dark tiles, steps band, highlighted plan, footer */
  --dh-mint: #2EE6A6;         /* block colour; buttons and highlights on Deep forest */
  --dh-lilac: #CDBEFF;        /* second block colour */
  --dh-amber: #FFC84A;        /* trial and upgrade only, always with Ink text */
  --dh-amber-tint: #FFF4DC;   /* notices */
  --dh-soft: #F4F6F1;         /* neutral tiles, quiet panels */
  --dh-mint-tint: #E6F7F0;    /* selected options, success notes */
  --dh-fog: #B9CCC4;          /* secondary text on Deep forest */
  --dh-leaf: #147A5C;         /* savings and positive numbers */
  --dh-line: #E3E8E3;         /* dividers and card borders (decoration only) */
  --dh-field: #6F817B;        /* input, select and checkbox borders */
  --dh-error: #B3261E;
  --dh-white: #FFFFFF;

  /* Type */
  --dh-font-display: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
  --dh-font-text: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --dh-size-display: clamp(44px, 6vw + 12px, 88px);
  --dh-size-heading: clamp(36px, 3vw + 16px, 56px);
  --dh-size-subheading: clamp(22px, 1vw + 16px, 28px);
  --dh-size-body: 18px;
  --dh-size-small: 15px;
  --dh-size-caption: 13px;

  /* Spacing steps: 4 8 12 16 24 32 48 64 96 128 */
  --dh-s1: 4px; --dh-s2: 8px; --dh-s3: 12px; --dh-s4: 16px; --dh-s5: 24px;
  --dh-s6: 32px; --dh-s7: 48px; --dh-s8: 64px; --dh-s9: 96px; --dh-s10: 128px;
  --dh-section: clamp(64px, 8vw, 128px);
  --dh-gutter: clamp(16px, 3vw, 32px);
  --dh-width: 1280px;

  /* Corners: fields and chips, tiles and cards, full-width blocks, buttons */
  --dh-r-field: 12px; --dh-r-tile: 28px; --dh-r-block: 36px; --dh-r-pill: 999px;

  /* Motion */
  --dh-fast: 200ms;
  --dh-enter: 400ms;
  --dh-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Type ---------- */
.dh { font-family: var(--dh-font-text); font-size: var(--dh-size-body); line-height: 1.6; color: var(--dh-ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.dh-display, .dh-heading, .dh-subheading { font-family: var(--dh-font-display); font-weight: 700; margin: 0; text-wrap: balance; }
.dh-display { font-size: var(--dh-size-display); line-height: .98; letter-spacing: -.04em; }
.dh-heading { font-size: var(--dh-size-heading); line-height: 1.02; letter-spacing: -.035em; }
.dh-subheading { font-size: var(--dh-size-subheading); line-height: 1.1; letter-spacing: -.02em; }
.dh-lead { font-size: 20px; line-height: 1.55; color: var(--dh-muted); max-width: 60ch; }
.dh-small { font-size: var(--dh-size-small); line-height: 1.5; }
.dh-caption { font-size: var(--dh-size-caption); font-weight: 600; line-height: 1.4; }
.dh-muted { color: var(--dh-muted); }
.dh-accent { color: var(--dh-mint); }
.dh-num { font-variant-numeric: tabular-nums; }
.dh a:not([class]) { color: var(--dh-forest); text-underline-offset: .18em; }
.dh-dark a:not([class]) { color: var(--dh-mint); }

/* ---------- Layout ---------- */
.dh-wrap { max-width: var(--dh-width); margin: 0 auto; padding: 0 var(--dh-gutter); box-sizing: border-box; }
.dh-section { padding-top: var(--dh-section); }
.dh-stack { display: flex; flex-direction: column; gap: var(--dh-s5); }
.dh-block { margin: 0 var(--dh-s4); border-radius: var(--dh-r-block); overflow: hidden; }
.dh-dark { background: var(--dh-deep); color: var(--dh-white); }
.dh-dark .dh-muted, .dh-dark .dh-lead { color: var(--dh-fog); }
.dh-on-mint { background: var(--dh-mint); color: var(--dh-ink); }
.dh-on-mint .dh-muted, .dh-on-mint .dh-lead { color: var(--dh-on-block); }

/* ---------- Focus (one ring everywhere: Mint with an Ink edge, visible on light and dark) ---------- */
.dh :focus-visible { outline: 3px solid var(--dh-mint); outline-offset: 2px; box-shadow: 0 0 0 5px var(--dh-ink); border-radius: inherit; }
.dh-dark :focus-visible { box-shadow: none; }

/* ---------- Buttons ---------- */
.dh-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--dh-s2); min-height: 56px; padding: 0 28px; border: 0; border-radius: var(--dh-r-pill); font: 600 17px/1.2 var(--dh-font-text); text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform var(--dh-fast) var(--dh-ease), background-color var(--dh-fast) var(--dh-ease), color var(--dh-fast) var(--dh-ease); }
.dh-btn:hover { transform: translateY(-1px); }
.dh-btn:active { transform: translateY(0); }
.dh-btn[disabled], .dh-btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.dh-btn-sm { min-height: 48px; padding: 0 22px; font-size: 16px; }
.dh-btn-ink { background: var(--dh-ink); color: var(--dh-white); }
.dh-btn-ink:hover { background: var(--dh-forest); }
.dh-btn-mint { background: var(--dh-mint); color: var(--dh-ink); }
.dh-btn-mint:hover { background: var(--dh-white); }
.dh-btn-ghost { background: var(--dh-white); color: var(--dh-ink); box-shadow: inset 0 0 0 1.5px var(--dh-ink); }
.dh-btn-ghost:hover { background: var(--dh-soft); }
.dh-btn-amber { background: var(--dh-amber); color: var(--dh-ink); }
.dh-btn-amber:hover { background: #FFD776; }
.dh-btn-text { background: none; color: var(--dh-ink); padding: 0 var(--dh-s3); }
.dh-btn-block { width: 100%; }

/* ---------- Name-claim field: "digifierhub.com/" + the name + the button, in one pill ---------- */
.dh-claim { display: flex; align-items: center; gap: var(--dh-s2); max-width: 600px; padding: 6px; background: var(--dh-white); border-radius: var(--dh-r-pill); box-shadow: inset 0 0 0 1.5px var(--dh-field); box-sizing: border-box; }
.dh-dark .dh-claim { box-shadow: none; }
.dh-claim:focus-within { box-shadow: 0 0 0 3px var(--dh-mint), inset 0 0 0 1.5px var(--dh-ink); }
.dh-claim-pre { padding-left: 20px; color: var(--dh-muted); font-size: 17px; white-space: nowrap; }
.dh-claim input { flex: 1; min-width: 0; height: 52px; border: 0; outline: none; background: transparent; font: 400 17px var(--dh-font-text); color: var(--dh-ink); }
.dh-claim input:focus-visible { outline: none; box-shadow: none; } /* the pill around it shows the focus */
.dh-claim .dh-btn { min-height: 52px; }
.dh-claim-note { font-size: var(--dh-size-small); }
.dh-claim-status { margin-top: var(--dh-s2); font-size: var(--dh-size-small); font-weight: 600; }
.dh-claim-status:empty { display: none; }
.dh-claim-status[data-state="free"] { color: var(--dh-leaf); }
.dh-claim-status[data-state="taken"] { color: var(--dh-error); }
.dh-dark .dh-claim-status[data-state="free"] { color: var(--dh-mint); }
.dh-dark .dh-claim-status[data-state="taken"] { color: var(--dh-amber); }
.dh-on-mint .dh-claim-status[data-state] { color: var(--dh-ink); }
.dh-claim-use { margin-left: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

/* ---------- Fields ---------- */
.dh-field { display: flex; flex-direction: column; gap: 6px; }
.dh-field label { font-size: var(--dh-size-small); font-weight: 600; }
.dh-field input, .dh-field select, .dh-field textarea { min-height: 52px; padding: 0 16px; border: 1.5px solid var(--dh-field); border-radius: var(--dh-r-field); background: var(--dh-white); font: 400 17px var(--dh-font-text); color: var(--dh-ink); box-sizing: border-box; }
.dh-field textarea { padding: 14px 16px; min-height: 120px; line-height: 1.5; }
.dh-field input:focus, .dh-field select:focus, .dh-field textarea:focus { outline: none; border-color: var(--dh-ink); border-radius: var(--dh-r-field); box-shadow: 0 0 0 3px var(--dh-mint); }
.dh-field .dh-hint { font-size: var(--dh-size-caption); font-weight: 400; color: var(--dh-muted); }
.dh-field.dh-invalid input, .dh-field.dh-invalid select, .dh-field.dh-invalid textarea { border-color: var(--dh-error); }
.dh-field .dh-error { font-size: var(--dh-size-caption); font-weight: 600; color: var(--dh-error); }

/* ---------- Bento grid and tiles ---------- */
.dh-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(280px, auto); gap: var(--dh-s4); }
.dh-span-2 { grid-column: span 2; }
.dh-tall { grid-row: span 2; }
.dh-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--dh-s3); padding: var(--dh-s6); border-radius: var(--dh-r-tile); background: var(--dh-soft); color: var(--dh-ink); transition: transform 250ms var(--dh-ease), background-color var(--dh-fast) var(--dh-ease); }
.dh-tile:hover { transform: scale(1.015); }
.dh-tile p { margin: 0; }
.dh-tile-mint { background: var(--dh-mint); }
.dh-tile-lilac { background: var(--dh-lilac); }
.dh-tile-amber { background: var(--dh-amber); }
.dh-tile-white { background: var(--dh-white); box-shadow: inset 0 0 0 1.5px var(--dh-line); }
.dh-tile-deep { background: var(--dh-deep); color: var(--dh-white); }
.dh-tile-mint .dh-muted, .dh-tile-lilac .dh-muted, .dh-tile-amber .dh-muted { color: var(--dh-on-block); }
.dh-tile-deep .dh-muted { color: var(--dh-fog); }
@media (max-width: 960px) { .dh-bento { grid-template-columns: minmax(0, 1fr); } .dh-span-2, .dh-tall { grid-column: auto; grid-row: auto; } }

/* ---------- Cards (plans, templates, products) ---------- */
.dh-card { display: flex; flex-direction: column; gap: var(--dh-s4); padding: var(--dh-s6); border-radius: var(--dh-r-tile); background: var(--dh-white); box-shadow: inset 0 0 0 1.5px var(--dh-line); }
.dh-card-deep { background: var(--dh-deep); color: var(--dh-white); box-shadow: none; }
.dh-card-deep .dh-muted { color: var(--dh-fog); }
.dh-choice { position: relative; cursor: pointer; }
.dh-choice input { position: absolute; opacity: 0; pointer-events: none; }
.dh-choice:has(input:checked) { background: var(--dh-mint-tint); box-shadow: inset 0 0 0 2px var(--dh-ink); }
.dh-choice:has(input:focus-visible) { outline: 3px solid var(--dh-mint); outline-offset: 2px; }

/* ---------- Badges, chips and notices ---------- */
.dh-badge { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; padding: 4px 12px; border-radius: var(--dh-r-pill); background: var(--dh-ink); color: var(--dh-white); font: 600 var(--dh-size-caption)/1.4 var(--dh-font-text); }
.dh-dark .dh-badge, .dh-card-deep .dh-badge { background: var(--dh-mint); color: var(--dh-ink); }
.dh-eyebrow { display: inline-flex; align-items: center; gap: var(--dh-s2); font-size: 14px; font-weight: 600; color: var(--dh-forest); }
.dh-dark .dh-eyebrow { color: var(--dh-mint); }
.dh-notice { display: flex; gap: var(--dh-s3); align-items: flex-start; padding: var(--dh-s4) var(--dh-s5); border-radius: var(--dh-r-field); background: var(--dh-mint-tint); color: var(--dh-ink); font-size: var(--dh-size-small); }
.dh-notice-amber { background: var(--dh-amber-tint); }
.dh-notice svg { flex: none; margin-top: 2px; }

/* ---------- FAQ rows ---------- */
.dh-faq details { border-top: 1.5px solid var(--dh-line); padding: 22px 0; }
.dh-faq details:last-child { border-bottom: 1.5px solid var(--dh-line); }
.dh-faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--dh-s4); list-style: none; cursor: pointer; font: 600 22px/1.25 var(--dh-font-display); letter-spacing: -.01em; }
.dh-faq summary::-webkit-details-marker { display: none; }
.dh-faq summary::after { content: '+'; font-size: 28px; line-height: 1; transition: transform var(--dh-fast) var(--dh-ease); }
.dh-faq details[open] summary::after { transform: rotate(45deg); }
.dh-faq details > :not(summary) { margin: var(--dh-s3) 0 0; color: var(--dh-muted); max-width: 65ch; }

/* ---------- Site header (views/site-chrome.js): logo, links, Log in and the Ink sign-up button.
   On public pages it is a floating glass pill that tightens once the page is scrolled (.dh-scrolled, set by
   client/js/site-menus.js), with a Mint highlight that glides between the links (.dh-head-glide, added by the
   same script; without it each link lights up on its own). The members' area and log-in pages use it too.
   Below 960px the links move into the menu sheet; below 560px the sign-up button does too. ---------- */
.dh-head { position: sticky; top: 0; z-index: 40; background: var(--dh-white); box-shadow: 0 1px 0 var(--dh-line); }
.dh-head-in { display: flex; align-items: center; gap: var(--dh-s5); height: 76px; }
.dh-head-logo { display: flex; flex: none; border-radius: var(--dh-r-field); }
.dh-head-logo svg { display: block; width: 156px; height: auto; }
.dh-head-nav { position: relative; display: flex; align-items: center; gap: var(--dh-s1); margin: 0 auto; }
.dh .dh-head-nav a, .dh-head-login { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--dh-r-pill); font-size: 16px; font-weight: 500; color: var(--dh-ink); text-decoration: none; white-space: nowrap; transition: background-color var(--dh-fast) var(--dh-ease); }
.dh .dh-head-nav a:hover, .dh-head-login:hover { background: var(--dh-soft); }
.dh .dh-head-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -2px 0 var(--dh-mint); border-radius: 0; }
.dh-head-login { font-weight: 600; }
.dh-head-acts { display: flex; align-items: center; gap: var(--dh-s2); flex: none; }
.dh-head .uchip > summary, .dh-head .uchip .mn a, .dh-head .uchip .mn button { font-family: var(--dh-font-text); }
/* On the narrowest phones the account button is the picture alone, so the menu button keeps its room. */
@media (max-width: 379px) { .dh-head .uchip .nm { display: none; } .dh-head .uchip > summary { padding-right: 8px; } }

/* The public pill. Glass is white at low opacity over whatever scrolls under it, never tinted. */
.dh-head:not(.dh-app-head) { --pill-w: min(1216px, calc(100% - 2 * var(--dh-s4))); padding-top: var(--dh-s3); background: none; box-shadow: none; pointer-events: none; }
/* The glass sits on a layer behind the pill's contents, so the pill itself has no blur or transform and the
   phone menu sheet inside it can still be fixed to the window. */
.dh-head:not(.dh-app-head) .dh-head-in { position: relative; isolation: isolate; pointer-events: auto; box-sizing: border-box; width: var(--pill-w); max-width: none; height: 64px; margin: 0 auto; padding: 0 var(--dh-s2) 0 var(--dh-s5);
  transition: width 420ms var(--dh-ease), height 420ms var(--dh-ease); }
.dh-head:not(.dh-app-head) .dh-head-in::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: var(--dh-r-pill);
  background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(11, 26, 22, .07), 0 6px 20px rgba(11, 26, 22, .05);
  transition: background-color 300ms var(--dh-ease), box-shadow 300ms var(--dh-ease); }
.dh-head.dh-scrolled .dh-head-in { width: min(1080px, calc(100% - 2 * var(--dh-s4))); height: 58px; }
.dh-head.dh-scrolled .dh-head-in::before { background: rgba(255, 255, 255, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(11, 26, 22, .08), 0 14px 36px rgba(11, 26, 22, .14); }
.dh-head:not(.dh-app-head) .dh-head-logo svg { width: 144px; }
.dh-head:not(.dh-app-head) .dh-head-nav a[aria-current="page"] { box-shadow: none; border-radius: var(--dh-r-pill); }
.dh-head:not(.dh-app-head) .dh-head-nav a[aria-current="page"]::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--dh-forest); }
/* The gliding highlight: one Mint-tint pill that slides to the link under the pointer or keyboard focus. */
.dh-head-glide { position: absolute; left: 0; top: 50%; z-index: 0; height: 44px; width: var(--glide-w, 0); margin-top: -22px; border-radius: var(--dh-r-pill); background: var(--dh-mint-tint); opacity: 0; transform: translateX(var(--glide-x, 0)); pointer-events: none;
  transition: transform 340ms cubic-bezier(.3, 1.3, .5, 1), width 340ms cubic-bezier(.3, 1.3, .5, 1), opacity 200ms var(--dh-ease); }
.dh-head-nav.dh-gliding .dh-head-glide { opacity: 1; }
.dh-head-nav.dh-glide-ready a:hover { background: none; }
/* The sign-up button: an arrow that nudges forward on hover; the button presses in on click. */
.dh-head-cta::after { content: '\2192' / ''; display: inline-block; margin-left: 2px; transition: transform var(--dh-fast) var(--dh-ease); }
.dh-head-cta:hover::after { transform: translateX(3px); }
.dh-head-cta:active { transform: scale(.97); }
/* The two signal dots in the logo light up in turn when the logo is pointed at. */
.dh-head-logo svg g g rect { transform-box: fill-box; transform-origin: center; }
.dh-head-logo:hover svg g g rect { animation: dh-signal 600ms var(--dh-ease) both; }
.dh-head-logo:hover svg g g rect + rect { animation-delay: 90ms; }
@keyframes dh-signal { 40% { transform: scale(1.45); } }
/* The pill drops in once when a page opens (only with the site script, see .dh-motion below). */
.dh-motion .dh-head:not(.dh-app-head) .dh-head-in { animation: dh-pill-in 520ms var(--dh-ease) backwards; }
@keyframes dh-pill-in { from { opacity: 0; transform: translateY(-10px); } }

/* The phone menu: a round button whose two lines turn into an X, opening a glass sheet under the pill. */
.dh-menu { display: none; flex: none; }
.dh-menu > summary { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--dh-r-pill); background: var(--dh-soft); color: var(--dh-ink); list-style: none; cursor: pointer; }
.dh-menu > summary::-webkit-details-marker { display: none; }
.dh-menu-icon path { transform-box: view-box; transform-origin: 12px 12px; transition: transform 260ms var(--dh-ease); }
.dh-menu[open] .dh-menu-icon path:first-child { transform: rotate(45deg) translateY(4px); }
.dh-menu[open] .dh-menu-icon path:last-child { transform: rotate(-45deg) translateY(-4px); }
.dh-menu-sheet { position: fixed; left: var(--dh-s3); right: var(--dh-s3); top: 84px; max-height: calc(100dvh - 96px); z-index: 39; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--dh-s6); padding: var(--dh-s4) var(--dh-s5) var(--dh-s5); border-radius: var(--dh-r-tile); overflow-y: auto;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(11, 26, 22, .07), 0 24px 60px rgba(11, 26, 22, .2); }
.dh-menu-nav { display: flex; flex-direction: column; }
.dh .dh-menu-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1.5px solid var(--dh-line); font: 700 26px/1.1 var(--dh-font-display); letter-spacing: -.02em; color: var(--dh-ink); text-decoration: none; }
.dh .dh-menu-nav a::after { content: '\2192' / ''; font-size: 22px; color: var(--dh-forest); }
.dh .dh-menu-nav a[aria-current="page"] { color: var(--dh-forest); }
.dh-menu-acts { display: flex; flex-direction: column; gap: var(--dh-s3); }
.dh-menu-acts .dh-btn { box-sizing: border-box; width: 100%; }
.dh-motion .dh-menu[open] .dh-menu-sheet { animation: dh-sheet-in 320ms var(--dh-ease) both; transform-origin: top center; }
.dh-motion .dh-menu[open] :is(.dh-menu-nav a, .dh-menu-acts) { animation: dh-item-in 360ms var(--dh-ease) both; }
.dh-motion .dh-menu[open] .dh-menu-nav a:nth-child(2) { animation-delay: 40ms; }
.dh-motion .dh-menu[open] .dh-menu-nav a:nth-child(3) { animation-delay: 80ms; }
.dh-motion .dh-menu[open] .dh-menu-nav a:nth-child(4) { animation-delay: 120ms; }
.dh-motion .dh-menu[open] .dh-menu-nav a:nth-child(5) { animation-delay: 160ms; }
.dh-motion .dh-menu[open] .dh-menu-acts { animation-delay: 200ms; }
@keyframes dh-sheet-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes dh-item-in { from { opacity: 0; transform: translateY(8px); } }

/* No blur in this browser, or the visitor asks for less see-through: a solid white pill and sheet. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dh-head:not(.dh-app-head) .dh-head-in::before, .dh-menu-sheet { background: var(--dh-white); }
}
@media (prefers-reduced-transparency: reduce) {
  .dh-head:not(.dh-app-head) .dh-head-in::before, .dh-menu-sheet { background: var(--dh-white); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (max-width: 959px) {
  .dh-head-in { height: 64px; gap: var(--dh-s3); }
  .dh-head:not(.dh-app-head) { padding-top: var(--dh-s2); }
  .dh-head:not(.dh-app-head) .dh-head-in, .dh-head.dh-scrolled .dh-head-in { width: calc(100% - 2 * var(--dh-s3)); height: 60px; padding: 0 var(--dh-s2) 0 var(--dh-s4); }
  .dh-head-logo svg, .dh-head:not(.dh-app-head) .dh-head-logo svg { width: 128px; }
  .dh-menu-sheet { top: 76px; }
  .dh-head-nav { display: none; }
  .dh-head-acts { margin-left: auto; }
  .dh-menu { display: block; }
  html:has(.dh-menu[open]) { overflow: hidden; }
}
@media (max-width: 559px) {
  .dh-head-cta { display: none; }
  .dh-head-login { padding: 0 10px; }
}

/* ---------- Site footer: a Deep forest block with the brand, three link columns and the copyright ---------- */
.dh-foot { margin: var(--dh-section) 0 0; padding: 0 0 var(--dh-s4); text-align: left; font-size: 16px; color: var(--dh-fog); }
.dh-foot-block { padding: var(--dh-s8) 0 var(--dh-s6); color: var(--dh-fog); }
.dh-foot-in { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: var(--dh-s7) var(--dh-s6); }
.dh-foot-logo { display: inline-flex; border-radius: var(--dh-r-field); }
.dh-foot-logo svg { display: block; width: 168px; height: auto; }
.dh-foot-tag { margin: var(--dh-s5) 0 var(--dh-s4); font: 600 24px/1.25 var(--dh-font-display); letter-spacing: -.01em; color: var(--dh-white); max-width: 22ch; }
.dh-foot-reach { display: flex; align-items: center; flex-wrap: wrap; gap: var(--dh-s4); margin: 0; }
.dh-foot .dh-foot-col a, .dh-foot .dh-foot-logo, .dh-foot .dh-foot-ig { color: inherit; text-decoration: none; }
.dh-foot .dh-foot-mail { color: var(--dh-mint); font-weight: 600; text-decoration: none; }
.dh-foot .dh-foot-ig { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--dh-r-pill); box-shadow: inset 0 0 0 1.5px #2B4A41; color: var(--dh-white); }
.dh-foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--dh-s1); }
.dh-foot-col h2 { margin: 0 0 var(--dh-s2); font: 700 16px/1.4 var(--dh-font-text); color: var(--dh-white); }
.dh-foot .dh-foot-col a { display: inline-flex; align-items: center; min-height: 40px; }
.dh-foot .dh-foot-col a:hover { color: var(--dh-white); text-decoration: underline; text-underline-offset: .2em; }
.dh-foot .dh-foot-mail:hover { text-decoration: underline; text-underline-offset: .2em; }
.dh-foot .dh-foot-ig:hover { color: var(--dh-mint); }
.dh-foot-bot { margin: var(--dh-s7) 0 0; padding-top: var(--dh-s5); border-top: 1px solid #2B4A41; font-size: 14px; }
@media (max-width: 860px) { .dh-foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dh-foot-brand { grid-column: 1 / -1; } }
@media (max-width: 340px) { .dh-foot-in { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Members' area and log-in pages (views/portal/layout.js): the same pill (Card Studio phase 1), with
   the dashboard's pages in the middle and the account button, Log out or a Help centre link on the right. A pill
   without middle links keeps its actions on the right. ---------- */
.dh-head-logo + .dh-head-acts { margin-left: auto; }
.dh-app-out { margin: 0; }
.dh-skip { position: absolute; left: var(--dh-s3); top: -80px; z-index: 100; padding: var(--dh-s3) 18px; border-radius: var(--dh-r-field); background: var(--dh-ink); color: var(--dh-white); font: 700 16px var(--dh-font-text); text-decoration: none; }
.dh-skip:focus { top: var(--dh-s3); outline: 3px solid var(--dh-mint); outline-offset: 2px; }

/* ---------- The site's fonts for anything outside a .dh part (the public pages are rebuilt; the members' area
   is not yet), and room under the sticky header for links to a part of a page. Phases 3 and 4 rebuild the
   members' area, and its lines here go with it ---------- */
:is(body.dh-site, body.dh-members) { font-family: var(--dh-font-text); }
:is(body.dh-site, body.dh-members) :is(h1, h2, h3) { font-family: var(--dh-font-display); }
:is(body.dh-site, body.dh-members) :is(input, select, textarea, button, .btn) { font-family: inherit; }
body.dh-site [id] { scroll-margin-top: 100px; }
/* Field borders in the members' area at 3:1 against white (they were the decoration line colour). */
body.dh-members :is(input, select, textarea) { border-color: var(--dh-field); }

/* ---------- Entrance motion: parts marked .dh-reveal rise into place as they scroll into view.
   Only when the site script has set .dh-motion on <html>, so without the script nothing is ever hidden. ---------- */
.dh-motion .dh-reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dh-enter) var(--dh-ease), transform var(--dh-enter) var(--dh-ease); }
.dh-motion .dh-reveal.dh-in { opacity: 1; transform: none; }

/* Everything that moves stands still for people who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  .dh-btn, .dh-tile, .dh-reveal, .dh-faq summary::after, .dh .dh-head-nav a, .dh-head-login { transition: none; }
  .dh-btn:hover, .dh-tile:hover { transform: none; }
  .dh-motion .dh-reveal { opacity: 1; transform: none; }
  .dh-head-in, .dh-head-in::before, .dh-head-glide, .dh-head-cta::after, .dh-menu-icon path { transition: none !important; }
  .dh-head-in, .dh-head-logo svg g g rect, .dh-menu-sheet, .dh-menu-nav a, .dh-menu-acts { animation: none !important; }
  .dh-head-cta:hover::after { transform: none; }
}
