/* Michael Beglinger, static rebuild of the Squarespace site.
   Desktop values (>= 768px) follow the live site, which scales linearly with the viewport width.
   Below 768px the live site freezes the type scale at its 900px values; spacing follows the live site too.
   Header, mobile menu and footer follow the approved artboards (HANDOFF.md, sections 5 and 7). */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-400-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #000000;
  --text: #ffffff;
  --text-muted: #a8a6a1;
  --link-underline: #dfe0e1;

  --font-display: "Newsreader", Georgia, serif;
  --font-text: "EB Garamond", Georgia, serif;

  /* Desktop: linear in vw, as measured on the live site (e.g. h1 = 69.43px at 1512px). */
  --fs-h1: calc(3.6vw + 15px);
  --fs-h2: calc(2.16vw + 15px);
  --fs-h3: calc(1.44vw + 15px);
  --fs-lead: calc(0.6vw + 15px);
  --fs-body: calc(0.24vw + 15px);
  --fs-cta: var(--fs-h2);

  --header-h: calc(7.77vw + 19.5px);
  --header-h-scrolled: calc(5.4vw + 19.5px);
  --page-pad: 4vw;
  --text-width: 61.11vw;
  --gutter: 3vw;
}

@media (max-width: 999px) {
  :root { --gutter: 2.25vw; }
}

@media (max-width: 799px) {
  :root {
    --header-h: calc(11.8vw + 38px);
    --header-h-scrolled: calc(11.8vw + 23px);
    --gutter: max(4px, calc(1.9vw - 3.5px));
  }
}

@media (max-width: 767px) {
  :root {
    --fs-h1: 47.4px;
    --fs-h2: 34.44px;
    --fs-h3: 27.96px;
    --fs-lead: 20.4px;
    --fs-body: 17.16px;
    --text-width: 88vw;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--text); }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 72;
  letter-spacing: normal;
}
h1 { font-size: var(--fs-h1); line-height: 1.232; }
h2 { font-size: var(--fs-h2); line-height: 1.299; }
h3 { font-size: var(--fs-h3); line-height: 1.333; }
h1 em { font-style: italic; font-weight: 300; }

p { margin: 0; }

:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text);
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  background: transparent;
  transition: height 0.3s ease, background-color 0.3s ease;
}
.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  background: var(--bg);
}
body.menu-open .site-header { background: transparent; }

.logo { display: block; flex-shrink: 0; }
.logo img { width: calc(8.43vw + 105.6px); height: auto; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a,
.footer-nav a,
.legal-links a,
.menu a { text-decoration: none; }
.main-nav a {
  font-size: var(--fs-body);
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}
.main-nav a:hover,
.main-nav a.is-active { text-decoration-color: currentColor; }

.burger {
  display: none;
  position: relative;
  width: 34px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 0;
  width: 34px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s ease, top 0.3s ease;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 27px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 799px) {
  .site-header { justify-content: flex-start; gap: 43px; padding: 0 30px; }
  .main-nav { display: none; }
  .burger { display: block; }
  .logo img { width: 175px; }
}

/* ---------- Mobile menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h);
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.menu.is-open { opacity: 1; visibility: visible; }

.menu-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.menu-main a { display: inline-block; padding: 12px 16px; font-size: 32px; line-height: 40px; }

.menu-meta { display: flex; justify-content: center; gap: 12px; padding-bottom: 64px; }
.menu-meta a { display: inline-block; padding: 12px 8px; font-size: 17px; line-height: 20px; color: var(--text-muted); }

@media (min-width: 800px) {
  .menu { display: none; }
}

/* ---------- Home ---------- */

.text-block {
  width: var(--text-width);
  margin: 0 auto;
  text-align: center;
}

.intro {
  padding-top: calc(var(--header-h) + 4.78vw + 18.8px);
  padding-bottom: calc(2.95vw + 5.4px);
}
.intro h1 { margin-bottom: 32px; }

.hero { padding: var(--page-pad); }
.hero img {
  width: 100%;
  height: calc(30.6vw + 169px);
  object-fit: cover;
  object-position: 50% 50%;
}

.portfolio-intro {
  height: 297px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-margin-top: var(--header-h-scrolled);
}
.portfolio-intro .text-block { width: 46vw; }
.lead { margin-top: 30px; font-size: var(--fs-lead); line-height: 1.6; }

.gallery {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 0 var(--gutter);
}
.gallery-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}
.gallery img { width: 100%; }

.js .gallery figure { opacity: 0; transition: opacity 0.8s ease; }
.js .gallery figure.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js .gallery figure { opacity: 1; transition: none; }
}
.gallery figure { margin: 0; }

.contact {
  height: calc(29.5vw + 134px);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-margin-top: var(--header-h-scrolled);
}
.contact h2 { font-size: var(--fs-cta); }

.text-link {
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

@media (max-width: 767px) {
  .intro { padding-top: calc(var(--header-h) + 29px); padding-bottom: 30px; }
  .hero img { height: 357px; }
  .portfolio-intro { justify-content: flex-start; padding-top: 88px; }
  .portfolio-intro .text-block { width: var(--text-width); }
  .contact { height: 468px; }
}

/* ---------- Legal pages ---------- */

.legal {
  width: 46vw;
  margin: 0 auto;
  padding-top: calc(var(--header-h) + 3.3vw);
  text-align: center;
}
.legal h2 { margin: calc(1.6vw + 13px) 0 30px; }
.legal h3 { margin: 30px 0; }
.legal p { margin: 15px 0; }
.legal p:last-child { margin-bottom: 0; }
.legal strong { font-weight: 700; }

@media (max-width: 767px) {
  .legal { width: 65.5vw; padding-top: calc(var(--header-h) + 100px); }
  .legal h1 { margin: 0 -11.25vw; }
  .legal h2 { margin-top: 47px; }
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 43px var(--page-pad) 60px;
}
.legal + .site-footer { margin-top: 120px; }

.copyright,
.legal-links a,
.link-button {
  padding: 6px 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-muted);
}
.copyright { margin: 0; }

.link-button {
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.legal-links a,
.link-button {
  display: inline-block;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.legal-links a:hover,
.link-button:hover { color: var(--text); }

.footer-legal { text-align: right; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 14px; margin-top: 26px; }

@media (max-width: 767px) {
  .site-footer { flex-direction: column-reverse; align-items: stretch; gap: 47px; padding: 120px 23px 60px; }
  .copyright,
  .legal-links a,
  .legal-links .link-button { padding: 8.5px 0; line-height: 27px; }
  .footer-legal h3 { font-size: 26.7px; line-height: 36px; }
  .legal-links { gap: 0 12px; margin-top: 22px; }
}

/* ---------- Cookie notice ---------- */

.button {
  display: inline-block;
  padding: 9px 22px;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.button:hover { background: var(--text); color: var(--bg); }
.button-primary { background: var(--text); color: var(--bg); }
.button-primary:hover { background: var(--link-underline); border-color: var(--link-underline); }

.cookie-banner {
  position: fixed;
  left: var(--page-pad);
  bottom: 32px;
  z-index: 5;
  width: min(640px, calc(100vw - 2 * var(--page-pad)));
  padding: 32px 36px;
  background: #111111;
  border: 1px solid #333333;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { line-height: 1.6; }
.cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px; }
.cookie-actions .link-button { color: var(--text); }

.cookie-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 44px 48px;
  border: 1px solid #333333;
  background: #111111;
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
}
.cookie-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.cookie-dialog form { margin: 0; }
.cookie-dialog h2 { font-size: var(--fs-h3); line-height: 1.333; }
.cookie-dialog h3 { font-size: calc(var(--fs-body) * 1.4); line-height: 1.3; }
.cookie-dialog p { margin-top: 12px; color: var(--text-muted); line-height: 1.6; }

.cookie-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 8px; }
.cookie-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.cookie-category { padding: 28px 0; }
.cookie-category + .cookie-category { border-top: 1px solid #333333; }
.cookie-category-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.cookie-state { color: var(--text-muted); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 56px;
  height: 30px;
  border: 1px solid #555555;
  border-radius: 15px;
  background: #222222;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.switch input:checked + .switch-track { background: var(--text); border-color: var(--text); }
.switch input:checked + .switch-track::after { transform: translateX(26px); background: var(--bg); }
.switch input:focus-visible + .switch-track { outline: 1px solid var(--text); outline-offset: 4px; }

.cookie-dialog-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 767px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 24px; }
  .cookie-actions { gap: 12px 20px; }
  .cookie-dialog { padding: 28px 24px; }
  .cookie-category-head { align-items: flex-start; }
}
