/* "secession": a child theme on the Fluid base v2, after the Vienna
   Secession and the Wiener Werkstatte. Matte gold on near-black ink, square
   everything: a faint square grid behind the hero, checkerboard rules under
   the bar and around the dark bands, gold frame lines with a soft inner
   keyline and small corner squares on cards, the plate and the quote,
   clusters of small squares and concentric-circle medallions as the only
   ornament. Restrained: one gold, no gradients that are not metal.
   Dark is the primary look; light is warm ivory paper with black and gold,
   and follows the OS or <html data-theme>. The bar stays ink in both.
   Fonts: themes/fonts/secession.css (Poiret One for display, Josefin Sans
   for text and labels, Big Shoulders Display for tall capital numerals).
   Link after the base: fluid.min.css, then this file. Theme-private tokens
   are prefixed --sc-. Every ornament is CSS (gradients, or an SVG used as a
   mask so it takes the gold of the current scheme). */
@layer reset, tokens, base, layouts, components, themes, utilities;

@layer themes {

  /* ---------- Knobs ---------- */
  :root {
    --font-heading: "Poiret One", "Josefin Sans Variable", "Futura", "Century Gothic", "Avenir Next", sans-serif;
    --font-display: var(--font-heading);
    --font-body: "Josefin Sans Variable", "Futura", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --sc-font-tall: "Big Shoulders Display Variable", "Josefin Sans Variable", "Arial Narrow", sans-serif;
    --text-min: 1.125;
    --text-max: 1.3125;
    --weight-display: 400;
    --display-max: 9rem;
    --measure: 60ch;
    --radius-card: 0;
    --radius-control: 0;
    --border-width: 1px;
    --shadow-style: 0;
    --container-content: 78rem;
    --nav-tracking: 0.24em;
    --nav-tracking-min: 0.08em;
    --toc-font: var(--font-body);
    --toc-dock-font: var(--font-body);

    /* The metal. One gold for fills and ornament; text gets a lighter
       gilding on ink and a dark bronze on paper (both clear 4.5:1). */
    --sc-gold: #B8973F;
    --sc-gold-dk: #8C7230;
    --sc-ink: #0d0c0a;
    --sc-ivory: #EFE7D3;
    --accent: var(--sc-gold);
    --on-accent: var(--sc-ink);
    --accent-fill: var(--sc-gold);
    --on-accent-fill: var(--sc-ink);
    --accent-hover: #C9A84D;
    --accent-fill-hover: #C9A84D;
    --neutral-tint: oklch(50% 0.03 85);
    --shadow-color: oklch(10% 0.01 80);

    /* The inverse band, per scheme below (a band resolves light-dark() in
       its own dark scheme, so it cannot pick the light value itself). */
    --band-inverse: var(--sc-ink);

    /* Ornament as masks: they take whatever colour paints them. */
    --sc-medal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='30'%3E%3Cpath d='M0 15h12M36 15h12' stroke='%23000'/%3E%3Ccircle cx='24' cy='15' r='11.5' fill='none' stroke='%23000'/%3E%3Ccircle cx='24' cy='15' r='7.5' fill='none' stroke='%23000'/%3E%3Ccircle cx='24' cy='15' r='3.5'/%3E%3C/svg%3E");
    --sc-moser: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13'%3E%3Cpath d='M0 0h3v3H0zM5 0h3v3H5zM10 0h3v3h-3zM0 5h3v3H0zM10 5h3v3h-3zM0 10h3v3H0zM5 10h3v3H5zM10 10h3v3h-3z'/%3E%3C/svg%3E");
    --sc-rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23000'%3E%3Ccircle cx='32' cy='32' r='30.5'/%3E%3Ccircle cx='32' cy='32' r='24.5'/%3E%3Ccircle cx='32' cy='32' r='18.5'/%3E%3C/g%3E%3Ccircle cx='32' cy='32' r='9'/%3E%3C/svg%3E");
  }

  /* ---------- Colour roles, on the root and on every dark surface ---------- */
  :root,
  :is(.section, section)[data-bg="inverse"],
  .hero[data-theme="dark"],
  .site-footer[data-dark],
  .nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"] {
    --sc-gold-text: light-dark(#76591A, #D2B467);
    --sc-rule: light-dark(#B9A161, color-mix(in srgb, #B8973F 42%, #0d0c0a));
    --sc-rule-soft: light-dark(#D6C597, color-mix(in srgb, #B8973F 24%, #0d0c0a));
    --sc-frame: light-dark(#A2842F, #B8973F);
    --sc-grid: light-dark(oklch(55% 0.08 85 / 0.13), oklch(70% 0.1 85 / 0.09));

    --accent-ink: var(--sc-gold-text);
    --color-text: light-dark(#16130E, #EFE7D3);
    --color-text-muted: light-dark(#463F31, #CFC6B0);
    --color-text-subtle: light-dark(#564E3E, #ABA28B);
    --color-background: light-dark(#F3ECDC, #0d0c0a);
    --color-surface: light-dark(#EAE1CB, #15130f);
    --color-surface-raised: light-dark(#F9F5EA, #1e1b15);
    --color-border: var(--sc-rule);
    --color-border-subtle: var(--sc-rule-soft);
    --color-border-strong: var(--sc-frame);
    --accent-subtle: light-dark(#ECE0BE, #1d1912);
    --color-focus: var(--sc-gold-text);
    --color-selection: light-dark(#E2CF96, #4a3d1c);
  }

  /* The dark band and the inverse footer: ink on the paper page, a lifted
     ink on the ink page so the band still reads as a band. */
  :root[data-theme="dark"] { --band-inverse: #17140f; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --band-inverse: #17140f; }
  }

  /* The bar is ink in both schemes, a plaque over the page. */
  .nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"] {
    color-scheme: dark;
    --_dark-weight: 30;
  }
  :root[data-theme="dark"] :is(.nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"]),
  :root[data-theme="light"] :is(.nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"]) {
    color-scheme: dark;
    --_dark-weight: 30;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"]) {
      color-scheme: dark;
      --_dark-weight: 30;
    }
  }

  /* ---------- Type ---------- */
  body { font-weight: 400; font-feature-settings: "kern", "liga"; }
  :is(h1, h2, h3, .display, .hero__headline, .cta__title) {
    font-weight: 400;
    letter-spacing: 0.05em;
    text-wrap: balance;
  }
  :is(.hero__headline, .display) { line-height: 1.08; letter-spacing: 0.035em; }
  h2 { letter-spacing: 0.07em; line-height: 1.18; }
  h3 { letter-spacing: 0.08em; line-height: 1.25; }
  /* Poiret One has no italic: emphasis is gilding, not slant. */
  :is(h1, h2, h3, .display, .hero__headline, .cta__title) em {
    font-style: normal;
    color: var(--sc-gold-text);
  }
  h4, h5, h6 { font-family: var(--font-body); }
  strong, b { font-weight: 600; }

  /* The label voice: wide-tracked capitals in Josefin, gilded. */
  :where(.eyebrow, .plate, thead th, legend, dt, .toc__label) {
    font-weight: calc(500 + var(--_dark-weight));
    letter-spacing: 0.3em;
  }
  .eyebrow { color: var(--sc-gold-text); }
  .hero .eyebrow { max-inline-size: none; }
  .lede { font-weight: calc(400 + var(--_dark-weight)); color: var(--color-text-muted); }
  a { text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--sc-rule); }
  a:hover { text-decoration-color: currentColor; }
  ::selection { background: var(--color-selection); color: var(--color-text); }

  /* ---------- The bar: ink plaque, gold rule, checkerboard under it ---------- */
  .nav:not([data-variant="transparent"]) {
    --nav-bg: var(--sc-ink);
    --nav-ink: var(--sc-ivory);
    padding-block-end: calc(var(--space-s) + 12px);
    background-image:
      linear-gradient(var(--sc-gold), var(--sc-gold)),
      repeating-conic-gradient(var(--sc-gold) 0 25%, transparent 0 50%);
    background-size: 100% 1px, 12px 12px;
    background-position: 0 calc(100% - 12px), 0 100%;
    background-repeat: no-repeat, repeat-x;
  }
  .nav__brand {
    font-family: var(--font-heading);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  :is(.nav__link, .nav__dropdown-link) {
    font-size: var(--step--2);
    font-weight: 500;
    text-transform: uppercase;
  }
  .nav :is(.nav__link, .nav__dropdown-link):hover { color: #D2B467; }
  @supports selector(:popover-open) {
    @container nav (max-width: 40rem) {
      .nav[data-nav~="compact"] .nav__panel .nav__link { font-size: var(--step-0); }
    }
  }

  /* ---------- Buttons: gold leaf, square, tracked capitals ---------- */
  :is(button, .button), .nav__cta {
    font-family: var(--font-body);
    font-size: var(--step--2);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    border-radius: 0;
  }
  :is(button, .button):not([data-variant]), .nav__cta {
    background-image: linear-gradient(180deg, oklch(100% 0.02 90 / 0.16), transparent 45%, oklch(25% 0.05 80 / 0.12));
    box-shadow: inset 0 0 0 1px oklch(30% 0.05 80 / 0.35), 0 0 0 1px var(--sc-gold-dk);
  }
  :is(button, .button)[data-variant="outline"] {
    --_btn-color: var(--sc-gold-text);
    --_btn-color-hover: var(--color-text);
    --_btn-border: var(--sc-frame);
    --_btn-bg-hover: color-mix(in oklch, var(--sc-gold) 12%, transparent);
  }
  :is(button, .button):focus-visible, .nav__cta:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 4px;
  }

  /* ---------- Hero: the square grid, a framed plate ---------- */
  .hero:not([data-theme], [data-overlay]) {
    background-image:
      linear-gradient(var(--sc-grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--sc-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
  }
  .hero .eyebrow::before {
    content: "";
    display: inline-block;
    inline-size: 13px;
    block-size: 13px;
    margin-inline-end: 0.9em;
    vertical-align: -0.1em;
    background: currentColor;
    -webkit-mask: var(--sc-moser) center / 13px 13px no-repeat;
    mask: var(--sc-moser) center / 13px 13px no-repeat;
  }
  /* Poiret One has one hairline weight: the subheadline reads in Josefin. */
  :is(.hero__subheadline, .hero .lede) {
    max-inline-size: 36em;
    font-family: var(--font-body);
    font-weight: calc(400 + var(--_dark-weight));
    letter-spacing: 0.01em;
  }
  /* The plate comes in from the bleed and is framed: a gold line, ink
     between, a soft keyline, small gold squares in the corners. */
  .hero__plate { margin-inline: 0; }
  .hero__plate :is(img, video) {
    padding: 10px;
    border: 1px solid var(--sc-frame);
    background:
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 0 / 6px 6px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 0 / 6px 6px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 100% / 6px 6px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 100% / 6px 6px no-repeat,
      var(--color-background);
    box-shadow: inset 0 0 0 5px var(--color-background), inset 0 0 0 6px var(--sc-rule);
  }
  .hero__plate figcaption { margin-inline: 0; }
  .plate { color: var(--sc-gold-text); }

  /* ---------- Section heads: a double gold rule and a framed numeral ---------- */
  :is(.section__head, .features__header, .stats__header, .team__header, .testimonials__header) {
    border-block-start: 0;
    padding-block-start: calc(var(--space-m) + 5px);
    background:
      linear-gradient(var(--sc-frame), var(--sc-frame)) 0 0 / 100% 1px no-repeat,
      linear-gradient(var(--sc-rule-soft), var(--sc-rule-soft)) 0 4px / 100% 1px no-repeat;
  }
  :is(.section__head, .features__header, .stats__header, .team__header, .testimonials__header) h2 {
    font-size: var(--step-4);
  }
  .eyebrow:has(> .section__num) {
    display: flex;
    align-items: center;
    gap: 1.1em;
  }
  .section__num {
    display: inline-grid;
    place-items: center;
    inline-size: 2.6rem;
    block-size: 2.6rem;
    font-family: var(--sc-font-tall);
    font-size: 1.375rem;
    font-weight: calc(400 + var(--_dark-weight));
    letter-spacing: 0.04em;
    color: var(--sc-gold-text);
    border: 1px solid var(--sc-frame);
    box-shadow: inset 0 0 0 3px var(--color-background), inset 0 0 0 4px var(--sc-rule);
    padding-block-start: 0.08em;
  }
  :is(.features, .section[data-bg="tinted"], section[data-bg="tinted"]) .section__num {
    box-shadow: inset 0 0 0 3px var(--color-surface), inset 0 0 0 4px var(--sc-rule);
  }

  /* ---------- Cards: a gold frame with an inner keyline and corner squares ---------- */
  .card {
    --_card-bg: var(--color-surface);
    --_card-border: var(--sc-rule);
    --_card-pad: var(--space-m);
    --_card-rule: var(--sc-rule-soft);
    padding: 5px;
    box-shadow: inset 0 0 0 4px var(--_card-bg), inset 0 0 0 5px var(--sc-rule-soft);
  }
  .card::after {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 0 / 7px 7px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 0 / 7px 7px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 100% / 7px 7px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 100% / 7px 7px no-repeat;
  }
  .card__title { font-size: var(--step-1); letter-spacing: 0.06em; }
  .card__title a { text-decoration: none; }
  .card__title a:hover { color: var(--sc-gold-text); }
  .card__meta {
    font-family: var(--sc-font-tall);
    font-size: var(--step-0);
    font-weight: calc(400 + var(--_dark-weight));
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sc-gold-text);
  }

  /* ---------- Features: a frieze between gold rules, a medallion per panel ---------- */
  .features__grid {
    border-block: 1px solid var(--sc-frame);
    padding-block: var(--space-l);
    background:
      linear-gradient(var(--sc-rule-soft), var(--sc-rule-soft)) 0 4px / 100% 1px no-repeat,
      linear-gradient(var(--sc-rule-soft), var(--sc-rule-soft)) 0 calc(100% - 4px) / 100% 1px no-repeat;
  }
  .feature { position: relative; text-align: center; }
  .feature::before {
    content: "";
    display: block;
    inline-size: 56px;
    block-size: 56px;
    margin: 0 auto var(--space-s);
    background: var(--sc-gold);
    -webkit-mask: var(--sc-rings) center / contain no-repeat;
    mask: var(--sc-rings) center / contain no-repeat;
  }
  .feature__title { font-size: var(--step-1); letter-spacing: 0.1em; }
  .feature__description { margin-inline: auto; max-inline-size: 30em; }

  /* ---------- The dark band: checkerboard above and below ---------- */
  :is(.section, section)[data-bg="inverse"] {
    background-image:
      repeating-conic-gradient(var(--sc-gold) 0 25%, transparent 0 50%),
      repeating-conic-gradient(var(--sc-gold) 0 25%, transparent 0 50%);
    background-size: 12px 12px, 12px 12px;
    background-position: 0 0, 6px 100%;
    background-repeat: repeat-x;
  }
  .stat {
    border-block-start: 1px solid var(--sc-frame);
    padding-block-start: var(--space-m);
    position: relative;
  }
  .stat::before {
    content: "";
    position: absolute;
    inset-block-start: -4px;
    inset-inline-start: 0;
    inline-size: 7px;
    block-size: 7px;
    background: var(--sc-gold);
  }
  .stat__value {
    font-family: var(--sc-font-tall);
    font-size: var(--step-5);
    font-weight: calc(300 + var(--_dark-weight));
    letter-spacing: 0.04em;
    color: var(--sc-gold-text);
  }
  .stat__label { letter-spacing: 0.2em; text-transform: uppercase; font-size: var(--step--2); }

  /* ---------- Testimonial: the quote in a framed square ---------- */
  .testimonial {
    position: relative;
    border: 1px solid var(--sc-frame);
    padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
    box-shadow: inset 0 0 0 6px var(--color-background), inset 0 0 0 7px var(--sc-rule);
    background:
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 0 / 8px 8px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 0 / 8px 8px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 0 100% / 8px 8px no-repeat,
      linear-gradient(var(--sc-gold), var(--sc-gold)) 100% 100% / 8px 8px no-repeat;
  }
  .testimonial__quote p { font-weight: 400; letter-spacing: 0.03em; line-height: 1.35; }
  .testimonial__name { color: var(--sc-gold-text); }
  blockquote:not(.testimonial__quote) {
    font-family: var(--font-heading);
    border-inline-start: 1px solid var(--sc-frame);
    box-shadow: inset 4px 0 0 var(--color-background), inset 5px 0 0 var(--sc-rule-soft);
  }

  /* ---------- The gold band: leaf with an ink checkerboard edge ---------- */
  :is(.section, section)[data-bg="accent-strong"], .hero[data-theme="accent"] {
    background-image:
      repeating-conic-gradient(var(--sc-ink) 0 25%, transparent 0 50%),
      repeating-conic-gradient(var(--sc-ink) 0 25%, transparent 0 50%),
      linear-gradient(180deg, oklch(100% 0.02 90 / 0.14), transparent 40%, oklch(25% 0.05 80 / 0.12));
    background-size: 12px 12px, 12px 12px, 100% 100%;
    background-position: 0 0, 6px 100%, 0 0;
    background-repeat: repeat-x, repeat-x, no-repeat;
    --_btn-color: var(--sc-gold);
    --_btn-bg: var(--sc-ink);
    --_btn-bg-hover: #2a251b;
  }
  :is(.section, section)[data-bg="accent-strong"] :is(button, .button):not([data-variant]) {
    background-image: none;
    box-shadow: none;
  }
  :is(.section, section)[data-bg="accent-strong"] :is(button, .button)[data-variant="outline"] {
    --_btn-color: var(--sc-ink);
    --_btn-color-hover: var(--sc-ink);
    --_btn-border: var(--sc-ink);
    --_btn-bg-hover: oklch(20% 0.02 80 / 0.1);
  }
  :is(.section, section)[data-bg="accent-strong"] em { color: inherit; }

  /* ---------- Fields: square, ink on paper or paper on ink ---------- */
  :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="image"]), textarea, select) {
    border-radius: 0;
    font-family: var(--font-body);
  }

  /* ---------- Tables ---------- */
  th { color: var(--sc-gold-text); }
  th, td { border-block-end-color: var(--sc-rule-soft); }

  /* ---------- Footer: a row of medallions along its top ---------- */
  .site-footer {
    position: relative;
    border-block-start: 1px solid var(--sc-rule);
    padding-block-start: calc(var(--space-xl) + 30px);
  }
  .site-footer::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: var(--space-m);
    block-size: 30px;
    background: var(--sc-gold);
    -webkit-mask: var(--sc-medal) 0 0 / 48px 30px round;
    mask: var(--sc-medal) 0 0 / 48px 30px round;
    pointer-events: none;
  }
  .site-footer__title {
    font-family: var(--font-body);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sc-gold-text);
  }

  .skip-link { background: var(--sc-gold); color: var(--sc-ink); }

  /* ---------- Access ---------- */
  @media (prefers-contrast: more) {
    :root:root {
      --color-text-muted: var(--color-text);
      --color-text-subtle: var(--color-text);
      --sc-rule: var(--sc-frame);
      --sc-rule-soft: var(--sc-frame);
    }
  }
  @media (forced-colors: active) {
    .card::after, .site-footer::before, .feature::before, .stat::before, .hero .eyebrow::before { display: none; }
    .nav, :is(.section, section)[data-bg="inverse"], :is(.section, section)[data-bg="accent-strong"] { background-image: none; }
  }
}
