:root {
  --dock-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 7px));
  --dock-clear: calc(var(--dock-bottom) + 76px);
}
main :is(.work-list a, .photo-teaser, .round-link, .contact-title, .footer-base a, .footer-base button) { scroll-margin-bottom: var(--dock-clear); }
html.dock-jump { scroll-behavior: auto; }
/* Two optical layers share one outline. The centre transmits the page;
   the narrow edge samples the image separately, like a polished bevel. */
.optical-defs { position: absolute; pointer-events: none; }
.glass-surface {
  --shell: #f1eee7;
  --wash: rgb(255 252 245 / 24%);
  --ink-glass: #211f1b;
  --lens: rgb(255 255 255 / 40%);
  --glint: rgb(255 255 255 / 76%);
  --shadow: rgb(42 36 28 / 12%);
  --edge-low: rgb(61 54 44 / 27%);
  --glass-blur: 5px;
  isolation: isolate;
}
.glass-surface[data-tone="dark"], .glass-surface[data-theme="dark"] {
  --shell: #303437;
  --wash: rgb(16 22 26 / 21%);
  --ink-glass: #fffdf8;
  --lens: rgb(255 255 255 / 16%);
  --glint: rgb(255 255 255 / 64%);
  --shadow: rgb(10 14 16 / 19%);
  --edge-low: rgb(3 8 12 / 28%);
}
.glass-surface::before, .glass-surface::after, .glass-surface > .glass-bevel {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.glass-surface::before {
  z-index: -2;
  inset: 1px;
  background: var(--shell);
  box-shadow: 0 3px 9px -4px var(--shadow);
}
.glass-surface > .glass-bevel { z-index: -3; }
.glass-surface::after {
  z-index: -1;
  border: 1px solid rgb(255 255 255 / 25%);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-surface::before {
    background: linear-gradient(105deg, rgb(255 255 255 / 8%), transparent 24%, transparent 75%, rgb(255 255 255 / 6%)), var(--wash);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(128%);
    backdrop-filter: blur(var(--glass-blur)) saturate(128%);
  }
}
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .glass-surface::after, .glass-surface > .glass-bevel {
    border: 0;
    padding: 1px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }
  .glass-surface::after {
    background: linear-gradient(165deg, var(--glint), rgb(255 255 255 / 19%) 31%, rgb(255 255 255 / 5%) 57%, var(--edge-low) 78%, rgb(255 255 255 / 38%));
  }
  .glass-surface > .glass-bevel {
    padding: 3px;
    -webkit-backdrop-filter: saturate(128%);
    backdrop-filter: url("#edge-optic") saturate(128%);
  }
}
.header.glass-surface, .header.glass-surface[data-theme="light"] {
  top: max(clamp(11px, 1.5vh, 20px), calc(env(safe-area-inset-top, 0px) + 4px));
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  margin-inline: auto;
  width: min(88%, 860px);
  padding: 3px clamp(14px, 2.3vw, 30px);
  min-height: 50px;
  border-radius: 100px;
  color: var(--ink-glass);
  background: transparent;
  pointer-events: auto;
  mix-blend-mode: normal;
}
.header .signature { gap: 10px; font-size: 35px; }
.header .signature span { font-size: .71rem; font-weight: 650; }
.header .menu-toggle { font-size: .84rem; font-weight: 650; gap: 10px; }
.header .menu-toggle i { width: 18px; height: 7px; }
.header[data-theme=dark] :is(.menu-toggle,.signature) { text-shadow: 0 1px 3px rgb(0 0 0 / 65%); }
.header[data-theme=dark] .menu-toggle i { filter: drop-shadow(0 1px 1px #0006); }
.header[data-daylight] { --ink-glass: #172128; --wash: rgb(239 246 250 / 14%); }
.header[data-daylight] :is(.menu-toggle,.signature) { text-shadow: 0 1px 2px rgb(255 255 255 / 34%); }
.header[data-daylight] .menu-toggle i { filter: none; }
.header :is(a,button):focus-visible { border-radius: 8px; outline-offset: 0; }
.hero-shade {
  background: linear-gradient(180deg, rgb(15 18 21 / 20%), transparent 24%, transparent 52%, rgb(5 8 12 / 72%)),
              linear-gradient(90deg, rgb(12 13 12 / 18%), transparent 52%);
}
.glass-dock {
  --slot: 0;
  --glass-blur: 6px;
  position: fixed;
  z-index: 22;
  left: 50%;
  bottom: var(--dock-bottom);
  transform: translateX(-50%);
  width: min(390px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 100px;
  color: var(--ink-glass);
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.glass-dock[data-tone=dark] { --wash: rgb(13 19 23 / 31%); }
.glass-dock[data-tone=dark] a { text-shadow: 0 1px 2px #0009; }

.glass-lens {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: 5px auto 5px 5px;
  width: calc((100% - 10px) / 4);
  border-radius: 100px;
  background: linear-gradient(145deg, rgb(255 255 255 / 10%), transparent 43%), var(--lens);
  box-shadow: inset 0 1px .75px var(--glint), inset 0 -1px 1px rgb(255 255 255 / 16%), 0 1px 2px rgb(0 0 0 / 9%);
  opacity: 0;
  transform: translateX(calc(var(--slot) * 100%)) scaleX(var(--lens-width, 1));
}
.glass-dock[data-ready] .glass-lens { opacity: 1; }
.motion .glass-lens { transition: transform .36s cubic-bezier(.22, .88, .24, 1.06); }
.glass-dock[data-dragging] .glass-lens { transition: none; }
.glass-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at var(--glint-x, 50%) 0%, rgb(255 255 255 / 34%), transparent 66%);
  opacity: 0;
}
.glass-dock[data-dragging] .glass-lens::after { opacity: 1; }
.glass-dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  border-radius: inherit;
  font-size: .83rem;
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: -.015em;
}
.glass-dock a[aria-current] { font-weight: 760; }
.glass-dock a:focus-visible { outline-offset: -2px; outline: 2px solid currentColor; }
.glass-dock svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.glass-dock a[aria-current] svg { stroke-width: 2.05; }
@media (hover: hover) { .glass-dock a:hover { background: rgb(156 144 128 / 15%); } }
body:has(dialog[open]) .glass-dock { visibility: hidden; }
body:has(dialog[open]) .header { visibility: hidden; }
.contact { padding-bottom: calc(var(--dock-clear) + 20px); }
.hero-base #hero-caption { margin-right: auto; margin-left: 26px; }
.filters { width: fit-content; max-width: 100%; padding: 4px; gap: 0; border-radius: 23px; background: #dedbd3; flex-wrap: wrap; }
.filters button { min-width: 44px; padding: 6px 15px; border: 0; border-radius: 20px; color: #433e37; font-size: .9rem; }
.filters button[aria-pressed="true"] { color: #28241f; background: #fffdf7; box-shadow: inset 0 1px white, 0 1px 3px #30261536; }
.filters button::after { display: none; }
@media (max-width: 920px) {
  .glass-dock { width: min(328px, calc(100% - 24px)); }
  .glass-dock a { flex-direction: column; gap: 3px; min-height: 48px; font-size: .79rem; }
  .glass-dock svg { width: 20px; height: 20px; }
  .hero-base #hero-caption { display: none; }
  .hero-base, .field-base { bottom: var(--dock-clear); }
  .hero-copy, .field-copy { bottom: calc(var(--dock-clear) + 84px); }
  .filters button { padding-inline: clamp(7px, 2vw, 13px); }
}
@media (max-height: 540px) and (orientation: landscape) {
  .header.glass-surface, .header.glass-surface[data-theme="light"] {
    top: max(5px, env(safe-area-inset-top)); width: min(78%, 660px); padding-block: 0; min-height: 44px;
  }
  :root { --dock-bottom: max(6px, env(safe-area-inset-bottom)); }
  .glass-dock { width: min(290px, calc(100% - 24px)); }
  .glass-dock a { flex-direction: row; min-height: 44px; gap: 4px; font-size: .78rem; }
  .glass-dock svg { width: 15px; height: 15px; }
  .hero-copy, .field-copy { bottom: 78px; }
  .hero-base, .field-base { bottom: 8px; }
}
@media (max-width: 792px) and (orientation: landscape) and (max-height: 540px) {
  .hero-base, .field-base { bottom: calc(var(--dock-bottom) + 61px); }
  .hero-copy, .field-copy { bottom: calc(var(--dock-bottom) + 119px); }
  .field-copy { display: flex; align-items: flex-end; justify-content: space-between; }
  .field-copy p { margin: 0; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass-surface > .glass-bevel { display: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .header[data-daylight] { --shell: #edf1f2; }
  .glass-surface::before { background: var(--shell); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  .glass-surface::after { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; mask: none; -webkit-mask: none; padding: 0; border: 1px solid currentColor; }
  .glass-dock .glass-lens { background: transparent; box-shadow: none; }
  .glass-dock[data-dragging] .glass-lens { outline: 2px solid currentColor; outline-offset: -2px; }
  .glass-dock a[aria-current] { background: var(--ink-glass); color: var(--shell); }
}
@media (prefers-reduced-motion: reduce) { .motion .glass-lens { transition: none; } }
@media (forced-colors: active) {
  .glass-surface > .glass-bevel { display: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass-surface::before { background: Canvas; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass-surface::after { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; mask: none; -webkit-mask: none; padding: 0; border: 1px solid CanvasText; }
  .glass-surface { color: CanvasText; }
  .glass-dock .glass-lens { display: none; }
  .glass-dock a[aria-current], .filters button[aria-pressed=true] { outline: 2px solid Highlight; outline-offset: -3px; }
}
@media print { .header.glass-surface, .glass-dock { display: none; } }
