@font-face {
  font-family: Roundo;
  src: url("./assets/roundo.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #080808;
  --foreground: #f5f4f1;
  --muted: #a2a2a2;
  --edge: 4vw;
  --footer-height: 80px;
  --header-space: 102px;
  --motion: cubic-bezier(.2, .8, .2, 1);
  font-family: Roundo, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) var(--footer-height);
  background: var(--background);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button {
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .32; }
button:focus-visible, a:focus-visible {
  outline: 1px solid var(--foreground);
  outline-offset: 5px;
}
img { display: block; max-width: 100%; }
img, .gallery-card, .about-portrait, .menu-picture {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; }
svg { display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--edge);
  z-index: 100;
  padding: 15px 20px;
  background: var(--background);
  border: 1px solid var(--foreground);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px var(--edge);
  background: linear-gradient(#080808b3, #08080800);
}
.brand { display: block; flex: 0 0 180px; width: 180px; }
.brand img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.main-nav { display: flex; gap: 32px; align-items: center; }
.mobile-menu-toggle, .mobile-menu-shade { display: none; }
.main-nav a {
  position: relative;
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.3;
  text-transform: uppercase;
  transition: color .25s ease;
}
.main-nav a:hover { color: var(--muted); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 2px;
  height: 1px;
  background: currentColor;
}
#main { display: grid; min-width: 0; min-height: 0; }
#main:focus { outline: none; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  height: var(--footer-height);
  margin: 0 var(--edge);
  border-top: 1px solid #292929;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.footer-copyright { justify-self: start; }
.footer-tagline { justify-self: end; text-align: right; }
.social-icons { display: flex; align-items: center; gap: 16px; }
.social-icons a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--foreground);
}
.social-icons svg { width: 23px; height: 23px; transition: opacity .25s ease; }
.social-icons a:hover svg { opacity: .6; }

/* The image groups follow the center of the active opening link. */
body[data-page="home"] .site-header { justify-content: center; }
body[data-page="home"] .main-nav { display: none; }
.opening-menu {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 28rem;
  padding: 80px 0 0;
  overflow: hidden;
}
.opening-links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.opening-links a {
  display: block;
  padding: 3px 20px;
  color: #d5d5d3;
  font-size: clamp(2.375rem, 4.1vw, 4.25rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.045em;
  border-radius: 9px;
}
.opening-links a span {
  display: block;
  padding: 5px 14px;
  border-radius: 9px;
  transition: transform 1s var(--motion), background-color .5s ease, color .5s ease;
}
.opening-links a.is-active span {
  color: #111;
  background: #f1f0eb;
  transform: translateX(7px) scale(1.08);
}
.menu-pictures {
  position: absolute;
  top: var(--picture-y, 50%);
  display: flex;
  align-items: center;
  gap: 22px;
  width: calc(50% - clamp(160px, 18vw, 270px));
  height: clamp(160px, 24vw, 320px);
  transform: translateY(-50%);
  transition: top 1s var(--motion);
  pointer-events: none;
}
.pictures-left { left: 0; justify-content: flex-end; }
.pictures-right { right: 0; justify-content: flex-start; }
.menu-picture {
  position: relative;
  flex: 0 0 clamp(170px, 19vw, 280px);
  height: 72%;
  border-radius: 11px;
  overflow: hidden;
}
.pictures-left .picture-1, .pictures-right .picture-0 { height: 88%; }
.picture-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.1);
  filter: brightness(.75);
  transition: opacity 1s ease, transform 1s var(--motion), filter 1s ease;
}
.picture-layer.is-active { opacity: 1; transform: scale(1); filter: brightness(.95); }
.picture-layer[src*="portrait"] { object-position: 50% 35%; }
.menu-departing .opening-links { pointer-events: none; }

/* Card positions and scale are measured once per layout by the gallery. */
.gallery-page {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto auto;
  min-width: 0;
  padding: var(--header-space) 0 12px;
  overflow: hidden;
}
.gallery-window {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}
.gallery-window.dragging { cursor: grabbing; }
.gallery-track { position: relative; width: 100%; height: 100%; }
.gallery-card {
  position: absolute;
  top: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  transform-origin: center;
  transition: transform .65s var(--motion);
  backface-visibility: hidden;
  outline-offset: -4px;
}
.gallery-card.selected { z-index: 2; }
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.gallery-window:not(.gallery-ready) .gallery-card { transition: none; }
.frost { display: none; }
.products .frost {
  display: block;
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(9px);
  mask-image: linear-gradient(transparent 25%, #000 85%);
  transition: opacity .45s ease;
  pointer-events: none;
}
.products .selected .frost { opacity: 0; }
.gallery-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px var(--edge) 0;
  text-align: center;
}
.item-name { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.item-type { font-size: 13px; line-height: 1.35; color: var(--muted); }
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-top: 8px;
}
.gallery-controls button {
  display: grid;
  place-items: center;
  min-width: 60px;
  min-height: 44px;
  padding: 4px 16px;
  font-size: 27px;
}
.gallery-count { min-width: 60px; text-align: center; font-size: 14px; }
.projects .gallery-controls { gap: 0; }
.projects .gallery-controls .project-dot-control,
.projects .gallery-controls .project-arrow-control {
  width: 44px;
  min-width: 44px;
  padding: 0;
}
.project-position-dot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.project-dot-shape {
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.project-dot-shape.is-current { background: currentColor; }
.gallery-hint { margin: 3px 20px 0; text-align: center; font-size: 12px; line-height: 1.4; color: var(--muted); }

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 64px 6vw 88px;
  color: var(--foreground);
  background: var(--background);
  border: 0;
}
.lightbox::backdrop { background: #000e; }
.viewer-image { width: 100%; height: 100%; object-fit: contain; }
.close-viewer { position: absolute; top: 10px; right: 20px; width: 48px; height: 48px; font-size: 38px; }
.viewer-bottom {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  bottom: 16px;
  display: grid;
  grid-template-columns: 60px minmax(0, auto) 60px;
  align-items: center;
  justify-content: center;
  gap: 25px;
}
.viewer-bottom button { min-height: 44px; padding: 5px 10px; font-size: 26px; }
.viewer-caption { max-width: 700px; text-align: center; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
body.modal-open { overflow: hidden; }

.about-page { display: grid; grid-template-columns: 62% 38%; min-width: 0; min-height: 0; }
.about-copy {
  align-self: end;
  justify-self: end;
  max-width: 350px;
  margin: 110px var(--edge) 8vh 30px;
  text-align: right;
  font-size: 16px;
  line-height: 1.5;
}
.about-copy h1 { margin: 0 0 28px; font-size: 17px; font-weight: 500; text-transform: uppercase; }
.about-copy p { margin: 0; }
.about-copy p + p { margin-top: 20px; }
.about-portrait { position: relative; min-width: 0; min-height: 0; margin: 0; overflow: hidden; background: #151515; }
.about-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }

.contact-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8vw;
  padding: 108px var(--edge) 20px;
  min-width: 0;
}
#contact-form {
  grid-column: 2;
  justify-self: end;
  display: grid;
  grid-template-rows: repeat(3, minmax(3.5rem, 1fr)) minmax(6rem, 1.6fr) 66px auto auto;
  gap: 8px;
  width: 100%;
  height: 100%;
  max-width: 650px;
  max-height: 580px;
}
.floating-field { position: relative; display: block; min-width: 0; padding-top: 22px; }
.floating-field input, .floating-field select, .floating-field textarea {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 34px;
  padding: 5px 0 8px;
  background: transparent;
  color: var(--foreground);
  border: 0;
  border-bottom: 1px solid #5b5b5b;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .25s ease;
}
.floating-field input, .floating-field select { position: absolute; bottom: 0; height: 36px; }
.floating-field textarea { resize: vertical; }
.floating-field > span {
  position: absolute;
  top: calc(100% - 33px);
  left: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
  transform-origin: left top;
  transition: top .3s ease, transform .3s ease, color .3s ease;
  pointer-events: none;
}
.message-field > span { top: 25px; }
.floating-field:focus-within > span,
.floating-field.has-value > span,
.floating-field:has(input:not(:placeholder-shown)) > span,
.floating-field:has(textarea:not(:placeholder-shown)) > span { top: 0; transform: scale(.8); color: var(--foreground); }
.floating-field input:focus, .floating-field select:focus, .floating-field textarea:focus { outline: none; border-bottom-color: var(--foreground); }
.floating-field select option { color: var(--foreground); background: #181818; }
.send {
  align-self: end;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 180px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid #777;
  border-radius: 3px;
  font-size: 14px;
  transition: border-color .25s ease, background-color .25s ease;
}
.send:hover { border-color: var(--foreground); background: #ffffff0c; }
.form-note, #form-status { max-width: 470px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.form-note a { text-decoration: underline; text-underline-offset: 3px; }
#form-status:empty { display: none; }
.not-found { display: grid; align-content: center; justify-items: center; gap: 20px; padding: 110px var(--edge) 50px; text-align: center; }
.not-found h1 { font-size: clamp(32px, 5vw, 64px); font-weight: 500; }

@media (max-width: 800px) {
  .brand { flex-basis: 160px; width: 160px; }
  .main-nav { gap: 22px; }
  .contact-page { gap: 4vw; }
}

@media (max-width: 650px) {
  :root { --edge: 5vw; --footer-height: 88px; --header-space: 100px; }
  .site-header { align-items: flex-start; gap: 20px; padding-top: 22px; padding-bottom: 18px; }
  .brand { flex-basis: 138px; width: 138px; }
  .main-nav { flex-wrap: wrap; justify-content: flex-end; max-width: 190px; gap: 4px 15px; }
  .main-nav a { padding: 4px 0; font-size: 12px; min-height: 26px; }
  .main-nav a[aria-current="page"]::after { bottom: 0; }
  .site-footer { grid-template-columns: 1fr 1fr; grid-template-rows: 44px auto; gap: 0 12px; padding-bottom: 12px; }
  .site-footer .social-icons { grid-column: 1 / -1; grid-row: 1; justify-self: center; gap: 10px; }
  .footer-copyright, .footer-tagline { grid-row: 2; font-size: 10px; }
  .opening-menu { min-height: 25rem; padding-top: 66px; }
  .opening-links { gap: 14px; }
  .opening-links a { padding: 4px 5px; font-size: clamp(1.6875rem, 7.4vw, 2.6875rem); }
  .opening-links a span { padding: 6px 8px; border-radius: 6px; }
  .opening-links a.is-active span { transform: translateX(2px) scale(1.06); }
  .menu-pictures { width: calc(50% - 98px); height: 210px; gap: 12px; }
  .menu-picture { flex-basis: 145px; border-radius: 7px; }
  .gallery-page { grid-template-rows: minmax(200px, 1fr) auto auto auto; padding-bottom: 10px; }
  .gallery-caption { padding-top: 10px; }
  .item-type { font-size: 12px; }
  .gallery-controls { gap: 27px; margin-top: 4px; }
  .gallery-hint { font-size: 11px; }
  .lightbox { padding: 64px 12px 90px; }
  .viewer-bottom { gap: 8px; grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .viewer-caption { font-size: 13px; }
  .about-page { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 1fr) auto; gap: 12px; padding-top: var(--header-space); }
  .about-portrait { grid-row: 1; }
  .about-portrait img { object-position: 50% 30%; }
  .about-copy { grid-row: 2; max-width: 340px; margin: 0 var(--edge) 14px; font-size: 13px; line-height: 1.4; }
  .about-copy h1 { margin-bottom: 10px; font-size: 15px; }
  .about-copy p + p { margin-top: 10px; }
  .contact-page { grid-template-columns: 1fr; padding: 102px var(--edge) 12px; }
  #contact-form { grid-column: 1; max-width: none; max-height: 540px; gap: 6px; }
  .form-note { font-size: 11px; }
}

/* Let the document scroll whenever the screen cannot hold the content. */
@media (max-height: 600px) {
  body { height: auto; }
  .site-header { position: absolute; padding-top: 18px; }
  .opening-menu { min-height: 430px; }
  .gallery-page { min-height: 470px; }
  .about-page { min-height: 480px; }
  .contact-page { min-height: 600px; }
}

@media (max-width: 650px) {
  body.mobile-menu-ready { --header-space: 82px; }
  .mobile-menu-ready .site-header,
  body[data-page="home"].mobile-menu-ready .site-header {
    position: fixed;
    height: 82px;
    padding: 18px 22px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #080808;
  }
  .mobile-menu-ready .mobile-menu-toggle {
    display: grid;
    place-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    padding: 10px;
    position: relative;
  }
  .mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--foreground);
    transition: transform .25s ease, opacity .2s ease;
  }
  .mobile-menu-open .mobile-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
  .mobile-menu-open .mobile-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mobile-menu-ready .main-nav {
    display: none;
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    max-width: none;
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 4px 26px;
    background: #080808;
    border-bottom: 1px solid #323232;
  }
  .mobile-menu-ready .main-nav a {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 11px 0;
    font-size: 14px;
    line-height: 1.2;
    color: #c7c7c5;
    border-bottom: 1px solid #222;
  }
  .mobile-menu-ready .main-nav a:last-child { border-bottom: 0; }
  .mobile-menu-ready .main-nav a[aria-current="page"] { color: #fff; }
  .mobile-menu-ready .main-nav a[aria-current="page"]::after { inset: auto auto 5px 0; width: 26px; }
  .mobile-menu-ready.mobile-menu-open .main-nav,
  body[data-page="home"].mobile-menu-ready.mobile-menu-open .main-nav { display: flex; }
  .mobile-menu-open { overflow: hidden; }
  .mobile-menu-open .mobile-menu-shade {
    display: block;
    position: fixed;
    inset: 82px 0 0;
    z-index: 19;
    width: 100%;
    height: calc(100dvh - 82px);
    background: #0003;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
