/* The frame every page shares: the header with its menu, language and theme switches, the shared sections (split
   heads, the trio of statements, the contact band) and the footer. */

/* The header bar stays at the top of the window: sticky in the page's column, over a translucent, blurred page
   background so the content shows faintly through it as it scrolls by. --hdr-h is its height (44px row, padding,
   border), which the hero and the anchors' scroll padding make room for. */
:root { --hdr-h: 93px; }
.hdr-bar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(16px) saturate(1.3); view-transition-name: site-header; }
/* In a theme switch the bar is part of the page, so the new theme spreads over both at once. */
html.theme-switching .hdr-bar { view-transition-name: none; }
/* At the top of the page the bar has no edge; its hairline and a soft shadow come in over the first 80px of scroll. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hdr-bar { animation: bar-lift linear both; animation-timeline: scroll(root); animation-range: 0 80px; }
  }
}
@keyframes bar-lift { from { border-bottom-color: transparent; box-shadow: none; } to { border-bottom-color: var(--line); box-shadow: 0 10px 30px -22px rgba(14,13,11,.45); } }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 400; font-size: 20px; letter-spacing: -.02em; min-height: 44px; }
.brand .bs { transform-box: fill-box; transform-origin: center; }
.brand:hover .bs { animation: brand-spark 1s ease-out; }
.brand:hover .bs2 { animation-delay: .1s; }
.brand:hover .bs3 { animation-delay: .2s; }
@keyframes brand-spark { 0% { transform: none; opacity: 1; } 45% { transform: translateY(-220px) scale(.6); opacity: 0; } 46% { transform: translateY(160px) scale(.5); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* The menu is a popover (the phone drawer, below); on wider screens it sits inline in the header, so the browser's
   own popover box (fixed, centred, framed) is undone here. */
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; position: static; inset: auto; width: auto; height: auto; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none; }
.nav-tools { display: flex; align-items: center; gap: 4px; }
/* Only the phone drawer has a menu and a close button (both are .icon-btn, so the hiding names the header). */
.hdr .menu-btn, .hdr .menu-close { display: none; }
.nl { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 16px; color: var(--muted); transition: color .2s; }
.nl:hover, .nl[aria-current="page"] { color: var(--fg); }
/* The language switch shows the other language's flag in a small rounded box with a hairline edge. */
.nl-lang { min-width: 44px; justify-content: center; margin-left: 8px; padding: 0 10px; border-radius: 10px; transition: background-color .2s; }
.flag { display: block; width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 14%, transparent); }
.nl-lang:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--fg); cursor: pointer; transition: background-color .2s; }
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }

/* The theme toggle shows the moon in the light theme and the sun in the dark one. */
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}

.split-head { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 24px 48px; align-items: end; }

.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 48px; }
.trio-item { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1.5px solid var(--fg); }

/* The contact band: the page's fire photo (.cta-embers on the home page, .cta-campfire on the services page) fades
   in quietly from the right, under one soft ember glow. */
.cta-panel { --cta-photo-opacity: .4; position: relative; overflow: hidden; isolation: isolate; }
.cta-panel::before { content: ""; position: absolute; inset: 0; z-index: -2; background: right center / cover no-repeat; opacity: var(--cta-photo-opacity); mask-image: linear-gradient(90deg, transparent 30%, rgba(0,0,0,.5) 60%, #000 90%); }
.cta-panel::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(48% 80% at 88% 100%, rgba(240,90,26,.22), transparent 70%); }
.cta-embers::before { background-image: url("/assets/media/photos/embers-1600.webp"); }
.cta-campfire::before { background-image: url("/assets/media/photos/campfire-1600.webp"); background-position: 75% center; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .cta-panel::before { animation: cta-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
  }
}
@keyframes cta-rise { from { opacity: 0; } to { opacity: var(--cta-photo-opacity); } }

.cta { padding-top: 136px; padding-bottom: 144px; display: flex; flex-direction: column; gap: 36px; align-items: flex-start; }
.cta-lead { color: var(--fg); max-width: 26em; }
.cta-mail { font-size: 81px; line-height: 1.05; letter-spacing: -.04em; font-weight: 400; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 14px; text-decoration-color: var(--line); transition: text-decoration-color .25s; overflow-wrap: anywhere; }
.cta-mail:hover { text-decoration-color: var(--ember); }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.copy-btn { min-width: 220px; }

.site-footer { margin-top: auto; }
.ftr { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 40px 32px; padding-top: 72px; padding-bottom: 48px; }
.ftr h2 { font-size: 14px; font-weight: 400; margin-bottom: 8px; }
.ftr ul { list-style: none; padding: 0; display: flex; flex-direction: column; }
.ftr li a, .ftr li span { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 15px; transition: color .2s; }
.ftr li a:hover { color: var(--fg); }
.ftr-brand { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ftr-tagline { font-size: 15px; max-width: 22em; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); transition: color .2s; }
.legal a:hover { color: var(--fg); }

@media (max-width: 900px) {
  .nav { gap: 0; margin-left: -8px; }
  .nl { padding: 0 8px; }
  .nl-lang { margin-left: 4px; }
  .cta-mail { font-size: 37px; text-underline-offset: 8px; }
  .cta-panel { --cta-photo-opacity: .28; }
  .cta-panel::before { background-position: center bottom; mask-image: linear-gradient(180deg, transparent 30%, #000 100%); }
  .cta-embers::before { background-image: url("/assets/media/photos/embers-800.webp"); }
  .cta-campfire::before { background-image: url("/assets/media/photos/campfire-800.webp"); }
  .ftr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr > div:first-child { grid-column: 1 / -1; }
}

/* Phones held upright: the menu takes its own row under the brand, spread across it with the language and theme
   switches at its end; the contact band's address scales with the screen so it stays on one line, and its buttons
   and the footer stack. */
@media (max-width: 600px) {
  :root { --hdr-h: 61px; }
  .hdr { padding-top: 8px; padding-bottom: 8px; flex-wrap: nowrap; }
  .brand { font-size: 18px; }
  .hdr .menu-btn { display: inline-flex; margin-right: -10px; }

  /* The drawer: slides in from the right over a dimmed page, the links one per row at the body's size, the language and theme
     switches at its foot. The page behind does not scroll while it is open. */
  .nav { position: fixed; inset: 0 0 0 auto; width: min(86vw, 340px); height: 100dvh; margin: 0; padding: 8px 24px 28px; box-sizing: border-box; border-left: 1px solid var(--line); background: var(--bg); color: var(--fg); flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; overflow-y: auto; translate: 100% 0; transition: translate .35s cubic-bezier(.2,.7,.2,1), display .35s allow-discrete, overlay .35s allow-discrete; }
  .nav:not(:popover-open) { display: none; }
  .nav:popover-open { translate: 0 0; }
  .nav::backdrop { background: rgba(14,13,11,.45); opacity: 0; transition: opacity .35s, display .35s allow-discrete, overlay .35s allow-discrete; }
  .nav:popover-open::backdrop { opacity: 1; }
  @starting-style {
    .nav:popover-open { translate: 100% 0; }
    .nav:popover-open::backdrop { opacity: 0; }
  }
  html:has(.nav:popover-open) { overflow: hidden; }
  .hdr .menu-close { display: inline-flex; align-self: flex-end; margin-right: -10px; margin-bottom: 20px; }
  .nl { min-height: 52px; padding: 0; font-size: 17px; color: var(--fg); }
  .nl[aria-current="page"] { color: var(--ember); }
  /* Each page link carries a right arrow at its far end (drawn as a mask, so it takes the link's muted colour). */
  .nav > .nl { justify-content: space-between; gap: 16px; }
  .nav > .nl::after { content: ""; flex: 0 0 18px; height: 18px; background: var(--muted); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
  .nav > .nl[aria-current="page"]::after { background: var(--ember); }
  .nav-tools { margin-top: auto; padding-top: 24px; justify-content: space-between; }
  .nav-tools .nl-lang { min-height: 44px; margin-left: -10px; padding: 0 10px; }
  .nav-tools .theme-toggle { margin-right: -10px; }
  .cta { padding-top: 80px; padding-bottom: 88px; gap: 28px; }
  .cta-mail { font-size: clamp(22px, 7vw, 37px); text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .cta-actions { align-self: stretch; }
  .cta-actions > * { flex: 1 1 100%; }
  .copy-btn { min-width: 0; }
  .trio { gap: 32px; }
  .ftr { padding-top: 56px; padding-bottom: 32px; gap: 32px 24px; }
  .legal { flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: 20px; }
}
