/* 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: var(--text-width);
  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-start;
  padding: 43px var(--page-pad) 60px;
}
.legal + .site-footer { margin-top: 120px; }

.footer-logo { width: calc(10.2vw + 127.8px); height: auto; margin-top: 6px; }

.footer-nav { display: flex; gap: 28px; margin-top: 26px; }
.footer-nav a,
.legal-links a { display: inline-block; padding: 6px 0; font-size: var(--fs-body); line-height: 1.6; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.footer-nav a:hover,
.legal-links a:hover { text-decoration-color: currentColor; }

.footer-legal { text-align: right; }
.legal-links { display: flex; justify-content: flex-end; gap: 14px; margin-top: 26px; }
.legal-links a { color: var(--text-muted); text-decoration-color: currentColor; }

@media (max-width: 767px) {
  .site-footer { display: block; padding: 120px 23px 60px; }
  .footer-logo { width: 204px; margin-top: 0; }
  .footer-nav { margin-top: 22px; }
  .footer-nav a,
  .legal-links a { padding: 8.5px 0; line-height: 27px; }
  .footer-legal { margin-top: 47px; }
  .footer-legal h3 { font-size: 26.7px; line-height: 36px; }
  .legal-links { gap: 12px; margin-top: 22px; }
}
