/* Sitehold site v2: "proof, then print".
   A preview wears a dashed proof-blue frame; the live page is the same page in a solid ink frame.
   Magenta means two things only: the button that starts you, and what is live. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #fff;
  --ink: #14294a;
  --ink-soft: #465672;
  --proof: #dceef7;
  --pencil: #1e6f99;
  --live: #be0f5c;
  --live-deep: #980a48;
  --rule: #d5dde6;

  --font: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --text-display: clamp(2.75rem, 6.3vw, 5.75rem);
  --text-title: clamp(2.5rem, 5vw, 4rem);
  --text-heading: clamp(2rem, 3.4vw, 3rem);
  --text-sub: 1.375rem;
  --text-lead: clamp(1.125rem, 1.6vw, 1.25rem);
  --text-body: 1.125rem;
  --text-small: 0.9375rem;
  --text-legal: 0.8125rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-section: clamp(4.5rem, 8vw, 7.5rem);

  --radius-small: 0.1875rem;
  --radius: 0.375rem;
  --radius-bubble: 1.25rem;
  --shadow: 0 1rem 2rem rgb(20 41 74 / 0.14);
  --motion: 150ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion: 0s; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--text-body)/1.55 var(--font); }
h1, h2, h3, p, ol, ul, figure, blockquote, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2 { font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: var(--text-title); line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-size: var(--text-heading); line-height: 1.08; }
h3 { font-size: var(--text-sub); line-height: 1.3; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
summary { cursor: pointer; list-style: none; }
[hidden] { display: none !important; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.band-ink :focus-visible { outline-color: var(--paper); }
main:focus { outline: none; }

/* Layout */
.wrap { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section:not([class*="band-"]) + .section:not([class*="band-"]) { padding-top: 0; }
.section:not([class*="band-"]):has(+ .section:not([class*="band-"])) { padding-bottom: calc(var(--space-section) * 0.75); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-4) clamp(3rem, 7vw, 6rem); }
.split-even { grid-template-columns: 1fr 1fr; align-items: center; }
.band-proof { background: var(--proof); }
.band-ink { background: var(--ink); color: var(--paper); }
.page-head { padding-block: clamp(2.5rem, 5vw, 4.5rem); background: var(--proof); }
.hero { padding-block: clamp(2rem, 2.5vw, 2.5rem) clamp(3rem, 5vw, 4.5rem); }
.hero h1 { font-size: var(--text-display); line-height: 0.98; }
.hero h1 span { display: block; }
.eyebrow { margin-bottom: var(--space-2); color: var(--pencil); font-size: var(--text-small); font-weight: 600; }
.lead { max-width: 41rem; margin-top: var(--space-3); font-size: var(--text-lead); }
.soft { color: var(--ink-soft); }
.small { font-size: var(--text-small); }
:is(.lead, .lang-menu) + .small { margin-top: var(--space-2); }
.split > div > .lead:first-child { margin-top: 0; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 2; padding: 0.75rem 1rem; background: var(--paper); }
.skip:focus { top: 1rem; }
.visually-hidden, .price-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Buttons and links */
.button {
  display: inline-block;
  padding: 1rem 1.75rem;
  border-radius: var(--radius);
  background: var(--live);
  color: var(--paper);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--motion);
}
.button:hover { background: var(--live-deep); }
.button-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button-quiet:hover { background: var(--paper); }
.text-link { display: inline-block; padding-block: 0.625rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }

/* Header */
.site-header { position: relative; background: var(--proof); }
.site-header .wrap { display: flex; align-items: center; gap: clamp(1rem, 3.75vw - 1rem, 2.25rem); padding-block: 1.25rem; }
.wordmark { padding-block: 0.375rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; }
.site-header .wordmark { margin-right: auto; }
.site-header .button { padding: 0.75rem 1.25rem; }
.nav-links { display: flex; gap: inherit; }
.nav-links a, .sign-in { padding-block: 0.625rem; text-decoration: none; white-space: nowrap; }
.nav-links a:hover, .sign-in:hover, .site-header a[aria-current="page"]:not(.wordmark) { text-decoration: underline; text-decoration-thickness: 2px; }
.menu { display: none; }
.menu summary { padding: 0.625rem 0; font-weight: 600; }
.menu nav { position: absolute; inset: 100% 0 auto; z-index: 1; padding: 0.5rem 1.25rem 1.5rem; background: var(--paper); box-shadow: var(--shadow); }
.menu nav a { display: block; padding-block: 0.875rem; border-bottom: 1px solid var(--rule); text-decoration: none; }
.menu nav a:last-child { border-bottom: 0; }

/* Footer */
.site-footer { padding-block: 4.5rem 3rem; border-top: 1px solid var(--rule); font-size: var(--text-small); }
.footer-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem 2rem; }
.footer-groups h2 { margin-bottom: 0.5rem; font-size: inherit; line-height: 1.55; letter-spacing: 0; }
.footer-groups ul + h2 { margin-top: 1.5rem; }
.footer-groups a { overflow-wrap: anywhere; display: inline-block; padding-block: 0.3125rem; color: var(--ink-soft); text-decoration: none; }
.footer-groups a:hover, .footer-groups a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.lang-menu { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.lang-menu ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.lang-menu a { display: inline-block; padding-block: 0.3125rem; color: var(--ink-soft); text-decoration: none; }
.lang-menu a:hover, .lang-menu a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.business-id { margin-top: 1.5rem; color: var(--ink-soft); font-size: var(--text-legal); }

/* Proof and live frames. The frame changes, the page inside never does. */
.frame { overflow: hidden; border: 2px solid var(--ink); border-radius: 0.5rem; background: var(--paper); }
.frame-proof { border: 2px dashed var(--pencil); }
.frame-bar { display: flex; justify-content: space-between; gap: 0 1rem; padding: 0.625rem 0.875rem; font-size: var(--text-small); line-height: 1.4; }
.frame-state { font-weight: 600; white-space: nowrap; }
.frame-proof .frame-state { color: var(--pencil); }
.frame-proof img { opacity: 0.8; filter: saturate(0.75); }
.live-dot { font-weight: 600; }
:is(.frame-live .frame-state, .live-dot)::before { content: ""; display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.375rem; border-radius: 50%; background: var(--live); }

.message { padding: 1.125rem 1.25rem; border-radius: var(--radius-bubble) var(--radius-bubble) 0.25rem; background: var(--ink); color: var(--paper); line-height: 1.35; }
.message p { text-wrap: balance; }
.message .who { margin-bottom: 0.375rem; color: var(--proof); font-size: var(--text-small); }
.message.reply { border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) 0.25rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
.reply .who { color: var(--ink-soft); }

/* message, proof, reply, live: the whole idea in one row */
.flow { margin-top: clamp(2.5rem, 5vw, 4.5rem); }
.flow ol { display: grid; grid-template-columns: 14rem 1fr 10.5rem 1fr; gap: 2rem; align-items: center; }
/* The line is drawn in the gaps only, from each message to its neighbours */
.flow .message { position: relative; }
.flow .message::after, .flow .reply::before { content: ""; position: absolute; top: calc(50% - 1px); left: 100%; width: 2rem; height: 2px; background: var(--pencil); }
.flow .reply::before { right: 100%; left: auto; }
figcaption { margin-top: 1.5rem; color: var(--ink-soft); font-size: var(--text-small); }

/* Miniature of demo.sitehold.page, in that page's own colours and type */
.tide { margin: 0 0.375rem 0.375rem; border-top: 1px solid var(--rule); color: #1e372c; font-size: var(--text-small); line-height: 1.4; }
.tide p { padding-inline: 0.5rem; }
.tide-title { margin-block: 0.875rem 0.25rem; font: 700 1.625rem/1.1 Georgia, serif; letter-spacing: -0.035em; }
.tide img { display: block; width: 100%; aspect-ratio: 2 / 1; margin-top: 0.875rem; object-fit: cover; }

/* Numbered steps */
.steps { counter-reset: step; display: grid; gap: 3.5rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.5rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; font-size: var(--text-sub); font-weight: 600; line-height: 1.3; }
.steps p, .points p, .notes p { max-width: 34rem; margin-top: 0.5rem; color: var(--ink-soft); }

/* Headed notes next to a section title; .steps without the numbers */
.notes { display: grid; gap: 2.5rem; }

/* A chat message and the page it leads to, stacked */
.scene { display: grid; justify-items: start; align-content: start; gap: var(--space-2); width: 100%; max-width: 30rem; }
.scene .message { max-width: 24rem; }
.scene .frame { width: 100%; }
.scene figcaption { margin-top: 0; }

/* Client jobs: what it is on one side, what you ask on the other */
.cases { margin-top: var(--space-4); }
.cases > li { padding-block: var(--space-4); border-top: 1px solid var(--rule); }
.cases > li:last-child { padding-bottom: 0; }
.cases > li > div > p { margin-top: 0.5rem; color: var(--ink-soft); }

/* Three points side by side */
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem clamp(2rem, 5vw, 4.5rem); margin-top: clamp(3rem, 6vw, 5.5rem); }
.band-ink .points p { color: var(--proof); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 0.875rem 1rem 0.875rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; line-height: 1.4; }
th { font-weight: 600; }
thead th { color: var(--ink-soft); font-size: var(--text-small); font-weight: 400; }
tbody:last-child tr:last-child > * { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.table-wrap + .small { margin-top: var(--space-2); }
.compare-table { min-width: 48rem; margin-top: var(--space-4); table-layout: fixed; }
.compare-table .row-names { width: 8.5rem; }
.price-table { align-self: start; }
.price-table :is(th, td) { vertical-align: middle; }
.price-table tbody :is(th, td) { height: 4rem; padding-block: 0.5rem; }
.price-table tr > :first-child { padding-left: 0.75rem; }
.price-table tr > :last-child { padding-right: 0.75rem; text-align: right; white-space: nowrap; }
.price-table td span { color: var(--ink-soft); font-size: var(--text-small); }
.tax { color: var(--ink-soft); font-size: var(--text-small); font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.price-table .group th { height: auto; padding-block: 1.5rem 0.5rem; color: var(--pencil); font-size: var(--text-small); text-align: left; white-space: normal; }
.price-table thead + tbody .group th { padding-top: 0.75rem; }
.rules { display: grid; gap: var(--space-2); max-width: 25rem; margin-top: 2rem; color: var(--ink-soft); }

.price-table .fits > * { background: var(--proof); }
.price-table .fits > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.price-table .fits > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* Forms */
p + form { margin-top: 2rem; }
label { display: block; margin-top: 1.5rem; font-weight: 600; }
form > :first-child { margin-top: 0; }
input, textarea { display: block; width: 100%; margin-top: 0.5rem; padding: 0.75rem 0.875rem; border: 1px solid var(--ink-soft); border-radius: var(--radius); background: var(--paper); color: inherit; font: inherit; }
input[type="number"] { width: 8rem; }
.with-unit { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.with-unit input { margin-top: 0; }
textarea { resize: vertical; }
button.button { margin-top: 1.5rem; white-space: normal; border: 0; background: var(--ink); font-family: inherit; font-size: inherit; cursor: pointer; }
button.button:hover { background: var(--ink-soft); }
form p { margin-top: 1rem; }
.contact-status { font-weight: 600; }

/* Questions: <details> in .questions */
.questions details { border-bottom: 1px solid var(--rule); }
.questions summary { position: relative; padding: 1.25rem 3rem 1.25rem 0; font-size: var(--text-sub); font-weight: 600; line-height: 1.3; text-wrap: balance; }
.questions summary::before, .questions summary::after { content: ""; position: absolute; right: 0.25rem; top: 2.1rem; width: 1rem; height: 2px; background: var(--ink); }
.questions summary::after { transform: rotate(90deg); transition: transform var(--motion); }
.questions summary:focus-visible { outline-offset: 0; }
.questions details[open] summary::after { transform: none; }
.questions details > :not(summary) { max-width: 38rem; padding-block: 0.25rem 1.75rem; color: var(--ink-soft); }
.questions details :is(p, li, ul) + :is(p, li) { margin-top: 0.75rem; }
.questions > .text-link { margin-top: var(--space-2); }

/* Closing call to action */
.close h2 { max-width: 17em; }
.close .button { margin-top: 2.5rem; }
.close .actions { margin-top: 2.5rem; }
.close .actions .button { margin-top: 0; }

/* Long reading: articles, guides, legal */
.prose-head { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem); }
.prose-head .wrap > * { max-width: 40rem; margin-inline: auto; }
.prose-head h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); line-height: 1.06; }
.prose-head .crumbs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.prose-head .meta { margin-top: 1rem; }
:is(.prose-head, .prose) :is(.meta, .crumbs) { color: var(--ink-soft); font-size: var(--text-small); }
.prose { max-width: 40rem; margin-inline: auto; padding-block: clamp(2rem, 4vw, 3rem) var(--space-section); line-height: 1.65; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.25rem; }
.prose h2:not(:first-child) { margin-top: 3.5rem; }
.prose h2 { font-size: 1.875rem; line-height: 1.15; }
.prose h3 { margin-top: 2.25rem; }
.prose :is(h2, h3) + * { margin-top: 0.75rem; }
.prose :is(ul, ol) { padding-left: 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--pencil); }
.prose :is(.answer, blockquote, pre) { padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--proof); }
.prose pre { overflow-x: auto; white-space: pre-wrap; }
code { font: 0.875em/1.5 ui-monospace, Menlo, Consolas, monospace; }
p code { overflow-wrap: anywhere; }
.prose :not(pre) > code { padding: 0.125em 0.3em; border-radius: var(--radius-small); background: var(--proof); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.prose :is(td, th) { min-width: 6.75rem; font-size: 1rem; }
.prose .questions { margin-top: 1rem; }
.prose .cta { padding-block: 0.5rem 1rem; }
.prose .cta p { margin-top: 0.75rem; color: var(--ink-soft); font-size: var(--text-small); }

/* A short conversation inside a text */
.chat { display: grid; gap: var(--space-2); padding: 1.5rem; border-radius: var(--radius); background: var(--proof); }
.chat .message { justify-self: end; max-width: 24rem; }
.chat .reply { justify-self: start; }
.chat .who { display: block; font-weight: 400; }

/* What to read next, under a text */
.prose:has(+ .related) { padding-bottom: var(--space-4); }
.related { max-width: 40rem; margin-inline: auto; padding-block: 2rem var(--space-section); border-top: 1px solid var(--rule); }
.related h2 { margin-bottom: 0.5rem; font-size: var(--text-sub); letter-spacing: 0; }
.related .mdlink { display: inline-block; margin-top: 1.5rem; color: var(--ink-soft); font-size: var(--text-small); }

/* Lists of pages: guides, articles, resources */
:is(.linklist, .related) li { border-bottom: 1px solid var(--rule); }
:is(.linklist, .related) li:last-child { border-bottom: 0; }
:is(.linklist, .related li) > a, .linklist li { display: block; padding-block: 0.75rem; line-height: 1.4; }
.linklist a, .related li a { text-decoration: none; }
:is(.linklist, .related li) a:hover, .post:hover h2 { text-decoration: underline; }
.posts { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem clamp(3rem, 7vw, 6rem); padding-block: var(--space-4) var(--space-section); }
.post { text-decoration: none; }
.post h2 { font-size: var(--text-sub); line-height: 1.3; letter-spacing: 0; }
.post p { margin-block: 0.5rem; color: var(--ink-soft); }
.post .meta { color: var(--ink-soft); font-size: var(--text-small); }
.directory { padding-block: clamp(3rem, 6vw, 5rem) 0; }
.directory:last-child { padding-bottom: var(--space-section); }
.directory .group { display: grid; grid-template-columns: 5fr 7fr; gap: 0 clamp(3rem, 7vw, 6rem); margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.directory .group h3 { padding-block: 0.5rem; }

/* One address with several pages on it */
.shelf { font-size: var(--text-small); }
.shelf code { font-size: inherit; }
.calc { margin: 0 0.375rem 0.375rem; padding: 1rem; border-top: 1px solid var(--rule); }
.calc p { display: flex; justify-content: space-between; padding-block: 0.375rem; }
.shelf li { display: grid; grid-template-columns: 2fr 1.2fr 0.6fr; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); }
.shelf .active { background: var(--paper); font-weight: 600; }
.steps .message { width: fit-content; color: var(--paper); }

@media (max-width: 68rem) {
  .flow ol { grid-template: auto auto / 1fr 1fr; grid-auto-flow: column; gap: 0.75rem 1.5rem; }
  .flow .message::after, .flow .reply::before { display: none; }
  .flow .message { align-self: end; justify-self: start; max-width: 22rem; }
}

/* 859.98px: the full navigation starts at 860px whatever the text size */
@media (max-width: 859.98px) {
  .nav-links, .sign-in { display: none; }
  .menu { display: block; }
  .split, .points, .posts, .directory .group { grid-template-columns: 1fr; }
  .rules { max-width: none; }
  .footer-groups { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 40rem) {
  .button { white-space: normal; text-wrap: balance; }
  .site-header .wrap { gap: 0.75rem; }
  .site-header .button { padding: 0.625rem 0.75rem; font-size: var(--text-small); white-space: nowrap; }
  .hero h1 span { display: inline; }
  .flow ol { grid-template: none; grid-auto-flow: row; }
  .flow .message { max-width: 17rem; }
  .flow .reply { margin-top: 1rem; }
  .message { padding: 0.75rem 0.875rem; font-size: 1rem; }
  .steps { gap: 2.5rem; }
  .steps li { padding-left: 2.25rem; }
  .prose :is(td, th) { font-size: 0.9375rem; }
  .price-table { font-size: 1rem; }
  .price-table :is(th, td) { padding-right: 0.5rem; }
  .price-table tr > :first-child { padding-left: 0.5rem; }
  .price-table tr > :last-child { padding-right: 0.5rem; }
  .price-table td span { display: block; }
  .compare-table { min-width: 0; }
  .compare-table thead { display: none; }
  .compare-table :is(tbody, tr, th, td) { display: block; }
  .compare-table :is(th, td) { padding: 0 0 1rem; border: 0; }
  .compare-table tr { padding-block: 1.5rem 0.5rem; border-top: 1px solid var(--rule); }
  .compare-table th { font-size: var(--text-sub); }
  .compare-table td::before { content: attr(data-col); display: block; color: var(--pencil); font-size: var(--text-small); font-weight: 600; }
}

/* The narrowest phones: the header button takes two short lines rather than pushing the menu off screen */
@media (max-width: 24rem) {
  .site-header .button { white-space: normal; text-align: center; line-height: 1.15; }
}
