/* Editorial: after instalanding.ai's highlighter-markup-page (MIT). A printed page on
   warm paper with grain: Source Serif 4 for everything read, JetBrains Mono for labels and
   figures, hairline rules and footnote numbers, and a real highlighter (<mark>, colour on a
   roughened ::before behind the text, one --color property) used sparingly as the accent.
   Palette is Flexoki's paper and ink; the pen is yellow.
   Suits solicitors, accountants, consultants, restaurants, wineries, bookshops. */

:root[data-theme="editorial"] {
  /* motion below the hero (see base.css) */
  --reveal-y: 18px; --nav-lift: 0 3px 0 var(--bg), 0 4px 0 var(--ink), 0 12px 24px -16px rgb(0 0 0 / 0.25); --hero-in: wipe; --reveal-in: slide;
  --bg: #fffcf0;
  --bg-soft: #f2f0e5;
  --surface: #fffcf0;
  --ink: #100f0f;
  --ink-2: #343331;
  --muted: #66655f;
  --line: #d3d0c4;
  --accent: #af3029;
  --primary: #100f0f;
  --primary-ink: #fffcf0;
  --glass: rgb(255 252 240 / 0.94);
  --glass-border: #100f0f;
  --hl: hsl(51 96% 60%);
  --rule: #100f0f;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --display-weight: 600;
  --display-tracking: -0.022em;
  --display-leading: 1.04;

  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-pill: 2px;
  --shadow: none;
  --card-border: 0;

  --slab-bg: #100f0f;
  --slab-ink: #fffcf0;
  --footer-bg: #100f0f;
  --footer-ink: #fffcf0;

  /* placeholders: tinted paper under a halftone screen */
  --halftone: radial-gradient(circle, rgb(16 15 15 / 0.2) 0.9px, transparent 1.5px) 0 0 / 6px 6px;
  --ph-1: var(--halftone), linear-gradient(150deg, #ece7d3, #d9d2b7);
  --ph-2: var(--halftone), linear-gradient(150deg, #f1dc8a, #e3c04c);
  --ph-3: var(--halftone), linear-gradient(150deg, #cfdcb4, #a9bd7c);
  --ph-4: var(--halftone), linear-gradient(150deg, #efc7ac, #dc9a6f);
  --ph-5: var(--halftone), linear-gradient(150deg, #bfdcd6, #8fc2b9);
  --ph-6: var(--halftone), linear-gradient(150deg, #e4b9b2, #c98378);

  /* two grains: a faint one for the sheet, a stronger one for the pen */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .06 0 0 0 0 .06 0 0 0 0 .06 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pen-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --rough: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='r' x='-5%25' y='-20%25' width='110%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05 .12' numOctaves='3' seed='4' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='5'/%3E%3C/filter%3E%3C/svg%3E#r");

  & body { background: var(--bg) var(--grain); }
  & ::selection { background: var(--hl); color: var(--ink); }
  & body { font-size: 18px; line-height: 1.65; }
  & h1, & h2, & h3, & h4 { font-optical-sizing: auto; }
  & h2 { font-size: clamp(30px, 4vw, 52px); }
  & h3 { font-size: 24px; }
  & :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 0; }
  & .lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); }

  /* ---------- the highlighter ---------- */
  & mark, & .ed-mark {
    --color: var(--hl);
    position: relative; isolation: isolate; display: inline-block;
    max-width: calc(100% - 1ch); padding: 0.05em 0.15em;
    background: none; color: var(--ink);
  }
  & mark::before, & .ed-mark::before {
    content: ""; position: absolute; z-index: -1;
    left: -0.25ch; top: -0.12em; width: calc(100% + 1ch); height: calc(100% + 0.24em);
    border-radius: 3px 2px 18px 3px / 3px 2px 12px 3px;
    background: var(--pen-grain), var(--color);
    background-blend-mode: multiply;
    opacity: 0.88;
    box-shadow:
      inset 0 -2px 3px color-mix(in srgb, var(--color), #000 30%),
      inset 0 2px 4px color-mix(in srgb, var(--color), #000 20%);
    box-shadow:
      inset 0 -2px 3px hsl(from var(--color) h s calc(l - 20)),
      inset 0 2px 4px hsl(from var(--color) h s calc(l - 20) / 0.7);
    filter: var(--rough);
  }
  /* where the pen rested a beat too long */
  & mark::after, & .ed-mark::after {
    content: ""; position: absolute; z-index: -1;
    right: -0.75ch; top: 28%; width: 0.7em; height: 0.55em;
    background: radial-gradient(closest-side, var(--color), transparent);
    opacity: 0.8; transform: rotate(-14deg); pointer-events: none;
  }

  /* section labels read as footnote markers */
  & .eyebrow { color: var(--accent); font-weight: 500; letter-spacing: 0.1em; }
  & .eyebrow::before { content: "§\00a0"; }
  & .ed-kicker { color: var(--ink); font-weight: 500; }
  & .ed-kicker::before { content: none; }

  /* ---------- buttons, pills ---------- */
  & .btn { height: 46px; font: 500 13px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
  & .btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--ink); }
  & .btn-primary:hover { background: var(--accent); border-color: var(--accent); transform: none; }
  & .btn-ghost { border-color: var(--ink); background: transparent; }
  & .btn-ghost:hover { background: var(--hl); color: var(--ink); border-color: var(--ink); transform: none; }
  & .pill { background: transparent; border: 1px solid var(--ink); border-radius: 2px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; color: var(--ink); }
  & .card { border-radius: 0; background: transparent; }

  /* ---------- nav: the running head, ruled twice ---------- */
  & .nav { background: var(--glass); border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 var(--bg), 0 4px 0 var(--ink); }
  & .brand-mark { border-radius: 0; background: var(--ink); color: var(--bg); font: italic 600 18px/1 var(--font-display); }
  & .brand-name { font-weight: 700; letter-spacing: -0.015em; }
  & .nav-links a { font: 500 12px/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
  & .nav-links a:hover { background: var(--hl); color: var(--ink); }
  & .nav-phone { color: var(--ink); }
  & .nav-menu summary { border-radius: 0; border-color: var(--ink); }
  & .nav-menu ul { background: var(--bg); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
  & .nav-menu a:hover { background: var(--hl); }

  /* ---------- signature hero ---------- */
  & .ed-hero { padding-block: clamp(20px, 3vw, 36px) clamp(48px, 7vw, 96px); }
  & .ed-dateline {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px;
    margin: 0 0 clamp(28px, 4vw, 52px); padding: 8px 0;
    border-top: 4px double var(--ink); border-bottom: 1px solid var(--ink);
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  }
  & .ed-dateline a { text-decoration: none; }
  & .ed-dateline a:hover { background: var(--hl); }
  & .ed-grid { display: grid; gap: 40px; }
  & .ed-main h1 { font-size: clamp(42px, 7.2vw, 100px); line-height: 0.98; letter-spacing: -0.03em; max-width: 15ch; }
  & .ed-main .lead { margin-top: 26px; max-width: 46ch; }
  & .ed-dropcap::first-letter {
    float: left; margin: 0.08em 0.1em 0 0;
    font: 600 4.1em/0.78 var(--font-display); color: var(--ink);
  }
  & .ed-fig { margin: 40px 0 0; }
  & .ed-fig .hero-media { aspect-ratio: 3 / 2; outline: 1px solid var(--ink); outline-offset: 5px; }
  & .ed-fig figcaption { margin-top: 14px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

  & .ed-side { display: grid; gap: 28px; align-content: start; padding-top: 28px; border-top: 1px solid var(--ink); }
  & .ed-block { margin: 0; }
  & .ed-label {
    margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--ink);
    font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  }
  & .ed-notes { display: grid; gap: 10px; counter-reset: none; }
  & .ed-notes li { display: flex; align-items: baseline; gap: 8px; }
  & .ed-notes sup { flex: none; width: 1.4em; font-size: 11px; font-weight: 500; color: var(--accent); }
  & .ed-note-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; text-decoration: none; }
  & .ed-note-name:hover { background: var(--hl); }
  & .ed-leader { flex: 1; min-width: 12px; align-self: end; margin-bottom: 0.35em; border-bottom: 1px dotted var(--muted); }
  & .ed-note-price { flex: none; font-size: 14px; }
  & .ed-hours { margin: 0; }
  & .ed-hours div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--muted); font-size: 16px; }
  & .ed-hours dt { font-weight: 400; }
  & .ed-hours dd { margin: 0; font-size: 13px; text-align: right; }
  & .ed-hours .closed dd { color: var(--muted); }
  & .ed-pull blockquote { margin: 0; }
  & .ed-pull blockquote p { margin: 0; font-size: 21px; font-style: italic; line-height: 1.35; letter-spacing: -0.01em; }
  & .ed-pull blockquote p::before { content: "\201C"; display: block; height: 0.5em; font: 600 56px/1 var(--font-display); color: var(--accent); }
  & .ed-pull figcaption { margin-top: 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  & .ed-pull figcaption::before { content: "\2014\00a0"; }

  @media (min-width: 960px) {
    & .ed-grid { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 0; }
    & .ed-grid.ed-solo { grid-template-columns: minmax(0, 1fr); }
    & .ed-main { padding-right: clamp(28px, 4vw, 56px); }
    & .ed-side { padding: 4px 0 0 clamp(24px, 3vw, 40px); border-top: 0; border-left: 1px solid var(--ink); }
  }

  /* ---------- sections: printed on one sheet, bands tinted a shade ---------- */
  & main > .section:nth-of-type(even) { background: rgb(16 15 15 / 0.035); }
  & .section-head { position: relative; padding-top: 24px; border-top: 3px solid currentColor; }
  & .section-head::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 1px solid currentColor; }

  & .highlights { border-block: 1px solid var(--ink); }
  & .marquee-track { font: italic 400 19px/1.4 var(--font-display); letter-spacing: 0; text-transform: none; color: var(--ink); }
  & .marquee-track li::after { content: "\00a7"; font-style: normal; color: var(--accent); }

  & .group-title { border-top: 1px solid var(--ink); font-style: italic; font-weight: 500; }
  & .services-grid { gap: 28px 40px; }
  & .service { padding: 16px 0 0; border-top: 1px solid var(--ink); gap: 10px; }
  & .index { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
  & .service-name { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
  & .service-desc { font-size: 16px; }
  & .service-foot { border-top: 1px dotted var(--muted); }
  & .price { font-size: 18px; font-weight: 500; }

  & .about-media, & .gallery-item, & .hero-media { border-radius: 0; outline: 1px solid var(--ink); outline-offset: 5px; }
  & .ph-label { background: var(--bg); color: var(--ink); border-radius: 0; border: 1px solid var(--ink); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
  & .about-copy h2 + p::first-letter { float: left; margin: 0.08em 0.1em 0 0; font: 600 3.6em/0.78 var(--font-display); }
  & .stat { border-top: 1px solid var(--ink); }
  & .stat dt { font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
  & .stat dd { font: 600 38px/1.1 var(--font-display); letter-spacing: -0.02em; }
  & .gallery-grid { gap: 22px; }

  & .reviews-grid { gap: 32px 40px; }
  & .review { padding: 16px 0 0; border-top: 1px solid var(--ink); }
  & .review blockquote p { margin: 0; font-size: 20px; font-style: italic; line-height: 1.45; }
  & .review-author { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }

  & .pricing-slab { border-radius: 0; outline: 1px solid var(--ink); outline-offset: 5px; background: var(--slab-bg) var(--grain); }
  & .pricing-slab .eyebrow { color: var(--hl); opacity: 1; }
  & .pricing-slab .lead { color: inherit; opacity: 0.8; }
  & .plan { border-radius: 0; border-color: rgb(255 252 240 / 0.4); }
  & .plan.featured { background: var(--bg); color: var(--ink); }
  & .plan-flag { background: var(--hl); color: var(--ink); border-color: var(--hl); }
  & .plan-price .mono { font: 600 44px/1 var(--font-display); letter-spacing: -0.02em; }
  & .plan-features li::before { content: "\2014"; color: var(--accent); }
  & .plan:not(.featured) .plan-features li::before { color: var(--hl); }
  & .plan:not(.featured) .btn-ghost { border-color: var(--bg); }
  & .plan:not(.featured) .btn-ghost:hover { background: var(--hl); color: var(--ink); border-color: var(--hl); }

  & .faq-item summary { justify-content: flex-start; gap: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
  & .faq-grid { counter-reset: q; }
  & .faq-item summary::before {
    counter-increment: q; content: counter(q); flex: none; width: 2.4em; align-self: flex-start; padding-top: 0.5em;
    font: 500 11px/1 var(--font-mono); color: var(--accent);
  }
  & .faq-item summary::after { margin-left: auto; padding-left: 16px; }
  & .faq-item, & .faq-item:first-child { border-color: var(--ink); }
  & .faq-item:not(:first-child) { border-top: 0; }
  & .faq-item p { font-size: 17px; padding-left: 2.4em; }

  & .chips .pill { padding: 8px 16px; font-size: 12px; }
  & .chips .pill:hover { background: var(--hl); }

  & .visit-card { border: 1px solid var(--ink); background: var(--bg); }
  & .hours caption { font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
  & .hours th, & .hours td { border-bottom: 1px dotted var(--muted); }
  & .hours td { font-size: 14px; }
  & .map { border-radius: 0; outline: 1px solid var(--ink); outline-offset: 5px; background: var(--bg-soft); }
  & .map iframe { filter: sepia(0.35) saturate(0.75) contrast(0.95); }

  & .form { border: 1px solid var(--ink); background: var(--bg); }
  & .field label { font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
  & .field input, & .field textarea {
    border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; padding-inline: 2px;
    font-family: var(--font-body);
  }
  & .field input:focus, & .field textarea:focus { background: rgb(255 226 74 / 0.22); outline: 2px solid var(--accent); outline-offset: 2px; }
  & .contact-direct a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

  /* ---------- new layouts: the printed menu, the pull quote, the newspaper columns ---------- */
  /* services "menu": the group title centred like a menu's course heading */
  & .services-menu .group-title { border-top: 0; padding-top: 0; margin-bottom: 28px; text-align: center; font-size: clamp(26px, 3vw, 38px); }
  & .menu-name { font-size: clamp(21px, 2vw, 25px); font-weight: 600; letter-spacing: -0.015em; }
  & .menu-leader { border-bottom: 2px dotted var(--muted); opacity: 1; }
  & .menu-price { font-size: 16px; font-weight: 500; }
  & .menu-desc { font-size: 17px; }
  & .menu-foot { margin-top: 20px; text-align: center; }

  /* reviews "pullquote": the opening quote mark, then the highlighter on the phrase */
  & .pull blockquote p { font-style: italic; font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
  & .pull blockquote p::before { content: "\201C"; display: block; height: 0.5em; margin-bottom: 0.2em; font: 600 1.7em/1 var(--font-display); font-style: normal; color: var(--accent); }
  & .pull .stars { font-size: 14px; }
  & .footnotes { border-top-color: var(--ink); }
  & .footnotes > li::before { font-size: 11px; letter-spacing: 0.1em; color: var(--accent); }
  & .footnotes > li::before { content: counter(fn) "\00a0\2014"; }
  & .footnotes blockquote p { margin: 0; font-size: 19px; font-style: italic; line-height: 1.45; }

  /* faq "columns": justified newspaper text, the first question dropped */
  & .faq-paper dt { letter-spacing: -0.01em; }
  & .faq-paper dd { font-size: 17px; color: var(--ink); }
  & .faq-paper > div:first-child dt::first-letter { float: left; margin: 0.08em 0.1em 0 0; font: 600 3.6em/0.78 var(--font-display); }
  @media (min-width: 700px) {
    & .faq-paper { column-rule: 1px solid var(--ink); text-align: justify; hyphens: auto; }
  }

  /* footer: the colophon, reversed out */
  & .footer-card { border-radius: 0; background: var(--footer-bg) var(--grain); outline: 1px solid var(--ink); outline-offset: 5px; }
  & .footer-name { font: 600 28px/1.15 var(--font-display); letter-spacing: -0.02em; }
  & .footer-title { color: var(--hl); opacity: 1; letter-spacing: 0.14em; }
  & .footer .btn-primary { background: var(--bg); color: var(--ink); border-color: var(--bg); margin-top: 14px; }
  & .footer .btn-primary:hover { background: var(--hl); border-color: var(--hl); }
  & .footer-base { font: 400 12px/1.5 var(--font-mono); letter-spacing: 0.06em; }
  & .wordmark {
    display: block; margin: 32px 0 -0.16em;
    font: italic 400 clamp(52px, 12vw, 190px)/0.9 var(--font-display); letter-spacing: -0.04em; white-space: nowrap;
    color: transparent; -webkit-text-stroke: 1px rgb(255 252 240 / 0.38);
    user-select: none;
  }

  & .callbar { background: var(--glass); border-top: 1px solid var(--ink); box-shadow: 0 -3px 0 var(--bg), 0 -4px 0 var(--ink); }

  /* ---------- motion: the pen goes over the eyebrow, the page settles in ---------- */
  @media (prefers-reduced-motion: no-preference) {
    &:not([data-motion="none"]) {
      & .ed-mark::before { animation: ed-sweep 0.6s 0.05s cubic-bezier(0.5, 0, 0.2, 1) both; }
      & .ed-mark::after { animation: ed-blot 0.25s 0.6s ease-out both; }
      & .btn-ghost, & .btn-primary { transition: background-color 0.2s ease, color 0.2s ease; }
    }
    &[data-motion="showpiece"]:not(.mo) {
      & .ed-main h1 { animation: ed-rise 0.8s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
      & .ed-main .lead { animation: ed-rise 0.8s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
      & .ed-main .actions { animation: ed-rise 0.8s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
      & .ed-side { animation: ed-rise 0.9s 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
    }
  }
}

@keyframes ed-sweep { from { clip-path: inset(-20% 100% -20% -10%); } to { clip-path: inset(-20% -10% -20% -10%); } }
@keyframes ed-blot { from { opacity: 0; scale: 0.3; } to { opacity: 0.8; scale: 1; } }
@keyframes ed-rise { from { opacity: 0; transform: translateY(18px); } }
