:root {
  --fg: #0b0b0d;
  --muted: rgba(11, 11, 13, 0.55);
  --stroke: rgba(11, 11, 13, 0.1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "owners", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #e7e7e1;
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; margin: 0; -webkit-appearance: none; appearance: none; }   /* Safari (iPad) adds its own button padding otherwise */
a { color: inherit; text-decoration: none; }

#gl {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#gl.is-dragging { cursor: grabbing; }
#gl.is-over-card { cursor: pointer; }

/* ---------- Frosted glass (UI) ---------- */
.glass {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 50px -24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.pill.glass:hover { background: rgba(255, 255, 255, 0.85); }
.pill:active { transform: scale(0.97); }

/* ---------- Top & bottom bars ---------- */

/* Nav buttons (DM Sans), touching. Two identical layers:
   .nav--face  white shapes with mix-blend-mode: difference → they invert
               against whatever is behind them (dark on the light wall,
               light over dark cards), just like the wordmark.
   .nav--hit   the real links, invisible, on top; they carry the shine. */
.nav {
  position: fixed;
  top: calc(var(--sa-t) + 14px);
  right: calc(var(--sa-r) + 20px);
  display: flex;
}
.nav--face { z-index: 6; mix-blend-mode: difference; pointer-events: none; }
.nav--hit { z-index: 7; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}
.nav .btn { font-family: var(--font); font-weight: 500; }   /* both nav layers */
.nav--face .btn--solid { background: #fff; color: #000; }          /* fill, no border */
.nav--face .btn--outline { border-color: #fff; color: #fff; }      /* border, no fill */
.nav--hit .btn { color: transparent; }


/* About me: black panel that slides in from the right and pushes the
   whole page to the left by its own width */
:root {
  --side-w: min(600px, 100vw);
  --push: var(--side-w);
}
.overlay.overlay--side {
  place-items: stretch end;
  padding: 0;                                    /* panel sits flush against top, right and bottom */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  overflow: hidden;
  transition: visibility 0s 0.6s;                /* stay visible while the panel slides out */
}
.overlay.overlay--side.is-open { transition: visibility 0s; }
.side {
  position: relative;
  width: var(--side-w);
  overflow: auto;
  padding: calc(var(--sa-t) + 120px) calc(var(--sa-r) + 60px) calc(var(--sa-b) + 60px) 60px;   /* top leaves room for the close button */
  border-radius: 0;
  background: #000;
  color: #fff;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.25);
  border-left: 1px solid #3c3c3c;
  transform: translateX(100%);
  transition: transform 0.6s var(--ease);
  user-select: text;
  -webkit-user-select: text;
}
.overlay.is-open .side { transform: none; }

/* the page itself moves out of the way */
#gl, .wordmark, .nav, .bottom {
  transition: translate 0.6s var(--ease);
}
.is-about-open :is(#gl, .wordmark, .nav, .bottom) {
  translate: calc(-1 * var(--push)) 0;
}
.side__close {
  position: absolute;
  top: 24px; right: 24px;
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.22);
  background: #000;
  color: #fff;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.side__close svg { display: block; flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.side__close:hover { background: #1c1c1c; }
.side__close:active { transform: scale(0.94); }
.overlay .side__title {
  margin: 0 0 3rem;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.side__text {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
}
.side__text + .side__text { margin-top: 0.8em; }
/* experience: rows between white lines, company left, years right, arrow list */
.cv { margin: 0; padding: 0; list-style: none; border-top: 1px solid #fff; font-size: 1rem; font-weight: 500; line-height: 1.4; }
.cv__job { padding: 1.25rem 0; border-bottom: 1px solid #fff; }
.cv__head { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; }
.cv__list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.cv__list li { position: relative; padding-left: 1.6em; }
.cv__list li::before {                                     /* → arrow */
  content: "";
  position: absolute;
  left: 0; top: 0.2em;
  width: 1em; height: 1em;
  background: currentColor;
  -webkit-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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.side__pills { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 3rem 0 0; padding: 0; list-style: none; }   /* same gap as below the headline */
.side .pill { background: #fff; color: #000; height: auto; padding: 0.375rem 0.75rem; font-size: 0.875rem; line-height: 1.2; }   /* inverted on the black panel */
.pill.pill--accent { background: #ff5e27; color: #fff; }   /* same orange as the View Website button */
@media (max-width: 720px) {
  .side { padding: calc(var(--sa-t) + 100px) calc(var(--sa-r) + 28px) calc(var(--sa-b) + 32px) 28px; border-radius: 0; }
}

/* Headline reveal (script.js: revealText): per word a block in the text
   colour wipes in from the left, then out to the right, leaving the word */
.rv { position: relative; display: inline-block; }
.rv__t { opacity: 0; }
.rv::after {
  content: "";
  position: absolute;
  inset: 0.06em -0.03em 0.02em;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
}
.is-revealed .rv::after { animation: rv-block 0.4s cubic-bezier(0.7, 0, 0.3, 1) calc(var(--rv-delay, 0s) + var(--i) * var(--rv-step, 0.1s)) both; }
.is-revealed .rv__t { animation: rv-text 0.01s linear calc(var(--rv-delay, 0s) + var(--i) * var(--rv-step, 0.1s) + 0.2s) both; }
@keyframes rv-block {
  0%     { transform: scaleX(0); transform-origin: left; }
  49.9%  { transform: scaleX(1); transform-origin: left; }
  50%    { transform: scaleX(1); transform-origin: right; }
  100%   { transform: scaleX(0); transform-origin: right; }
}
@keyframes rv-text { to { opacity: 1; } }
.side__title { --rv-delay: -0.03s; --rv-step: 0.02s; }      /* while the panel slides in */
@media (prefers-reduced-motion: reduce) {
  .rv::after { display: none; }
  .rv__t, .is-revealed .rv__t { opacity: 1; animation: none; }
}

/* Button hover: the label slides out to the right and comes back in from the
   left (script: .btn__t wrapper + .is-swap) */
.btn { overflow: hidden; }
.btn__t { display: inline-flex; align-items: center; gap: inherit; }
.btn.is-swap .btn__t { animation: btn-swap 0.3s both; }
@keyframes btn-swap {
  0%     { transform: translateX(0); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  49.99% { transform: translateX(calc(100% + 1.5em)); }
  50%    { transform: translateX(calc(-100% - 1.5em)); animation-timing-function: cubic-bezier(0.1, 0.5, 0.5, 1); }
  100%   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .btn.is-swap .btn__t { animation: none; } }

/* Wordmark: its own layer so it can blend with the wall behind it.
   White + difference → dark on the light background, light on dark cards. */
.wordmark {
  position: fixed;
  z-index: 6;
  top: calc(var(--sa-t) + 20px);
  left: calc(var(--sa-l) + 24px);
  display: block;
  line-height: 0;
  color: #fff;
  mix-blend-mode: difference;
}
.wordmark__logo { display: block; height: 22px; width: auto; }


.bottom {
  position: fixed;
  z-index: 5;
  left: 0; right: 0; bottom: 0;
  padding: 0 calc(var(--sa-r) + 24px) calc(var(--sa-b) + 22px) calc(var(--sa-l) + 24px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.legal-links { display: flex; gap: 16px; flex-shrink: 0; white-space: nowrap; pointer-events: auto; text-transform: none; letter-spacing: 0; font-size: 0.8125rem; font-weight: 500; }
.bottom { gap: 16px; }
.legal-links a { transition: color 0.2s; }
.legal-links a:hover { color: var(--fg); }
.gate__legal {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--sa-b) + 22px);
  justify-content: center;
  color: var(--muted);
}
.hint { transition: opacity 0.8s, transform 0.8s var(--ease); }
.hint { font-family: var(--font); font-weight: 500; font-size: 0.875rem; text-transform: none; letter-spacing: 0; color: #fff; }
/* Bottom bar inverts against what's behind it (dark on the light wall, light
   over dark cards), like the nav. The blend sits on .bottom itself: it is a
   stacking context, so a blend on its children would only see .bottom. */
.bottom { mix-blend-mode: difference; }
.legal-links a { color: #7d7d7a; }                 /* ≈ the old muted grey on the light wall */
.legal-links a:hover { color: #fff; }
.hint.is-hidden { opacity: 0; transform: translateY(8px); }

/* ---------- Project overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(var(--sa-t) + 20px) calc(var(--sa-r) + 20px) calc(var(--sa-b) + 20px) calc(var(--sa-l) + 20px);
  background: rgba(248, 248, 249, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.overlay.is-open { opacity: 1; visibility: visible; }
.overlay:focus { outline: none; }                 /* focused after a click (script.js), no ring */

.overlay__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 100%;
  overflow: auto;
  border-radius: 32px;
  padding: 32px;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.45s var(--ease);
  user-select: text;
  -webkit-user-select: text;
  touch-action: pan-y;
}
.overlay.is-open .overlay__panel { transform: none; }

.overlay__panel--project {
  width: min(860px, 100%);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.project__art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 26px; display: block; background: #111; }
.project__body { padding: 22px 18px 18px 0; display: flex; flex-direction: column; gap: 12px; }

.close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 1;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  background: rgba(11, 11, 13, 0.06);
  border: 1px solid var(--stroke);
}
.close:hover { background: rgba(11, 11, 13, 0.12); }

.eyebrow { margin: 0; font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.overlay h2 { margin: 0; font-size: 2.125rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.lede { margin: 0; color: rgba(11, 11, 13, 0.72); line-height: 1.6; font-size: 0.9375rem; }


.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 0.75rem; padding: 5px 10px; border-radius: 999px; background: rgba(11, 11, 13, 0.05); border: 1px solid var(--stroke); }

.button {
  margin-top: auto;
  align-self: flex-start;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  background: #0b0b0d;
  color: #fff;
}

/* ---------- Project gallery overlay ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.overlay--gallery {
  display: block;
  padding: 0;
  overflow: hidden;
  background: rgba(231, 231, 225, 0.55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
}
/* the contents (cards, header, buttons) slide up from the bottom while the
   blurred backdrop just fades in where it is. Uses `translate`, so it adds
   to the transforms script.js sets on the header and the button. */
.overlay--gallery > :not(.gallery__live) {
  translate: 0 100vh;
  transition: translate 0.6s var(--ease);
}
.overlay--gallery.is-open > :not(.gallery__live) { translate: 0 0; }   /* the button keeps its own translate (mouse follow) */
.gallery__gl {                                       /* glass cards, drawn in WebGL */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.gallery__scroll {                                   /* invisible scroller that drives the cards */
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.gallery__scroll::-webkit-scrollbar { display: none; }
/* Project header above the first card: headline + pills, centred */
.gallery__head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  will-change: transform;
}
.gallery__head[hidden] { display: none; }
.gallery__title {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 3.5rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #000;
}
.gallery__pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.pill {                                               /* like the nav buttons, not clickable */
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 720px) { .gallery__title { font-size: 2.25rem; } }

.gallery__close {
  position: absolute;
  top: calc(var(--sa-t) + 28px);
  left: calc(50% - 25px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  color: #fff;
  background: none;                                  /* outline only */
  mix-blend-mode: difference;                        /* dark on light, light on dark — like the nav */
  transition: opacity 0.2s, transform 0.2s var(--ease), translate 0.6s var(--ease);
}
/* "View Website" link at the bottom, same distance from the edge as the close button from the top */
.gallery__live {
  position: absolute;
  bottom: calc(var(--sa-b) + 28px);
  left: 50%;
  z-index: 2;
  gap: 3px;
  height: 32px;                                      /* a bit less padding top/bottom than the nav buttons (38px) */
  padding: 0 10px 0 12px;                            /* tighter than the nav buttons (16px) */
  background: #ff5e27;                               /* solid orange, no border */
  color: #fff;
  transform: translateX(-50%);
  translate: var(--mx, 0px) var(--my, 0px);           /* magnetic pull toward the cursor (script.js) */
  will-change: translate;
  transition: transform 0.2s var(--ease);
}
.gallery__live svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gallery__scroll.is-link { cursor: pointer; }      /* over a card while the View Website button shows */
.gallery__live[hidden] { display: none; }
.gallery__live { opacity: 1; scale: 1; transition: transform 0.2s var(--ease), opacity 0.2s, scale 0.25s var(--ease); }
.gallery__live.is-away { opacity: 0; scale: 0.6; pointer-events: none; }   /* cursor not over a card */
.gallery__live:active { transform: translateX(-50%) scale(0.96); }
.gallery__close svg { display: block; flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.gallery__close:hover { opacity: 0.6; }
.gallery__close:active { transform: scale(0.94); }


/* ---------- Project sheet: black, slides up from the bottom ---------- */
.overlay.overlay--sheet {
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  overflow: hidden;
  transition: visibility 0s 0.6s;                /* stay visible while the sheet slides out */
}
.overlay.overlay--sheet.is-open { transition: visibility 0s; }
/* everything behind the sheet: slightly darkened and blurred, fades in/out */
.overlay--sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.overlay--sheet.is-open::before { opacity: 1; }
.sheet {
  position: absolute;
  inset: calc(var(--sa-t) + 80px) 0 0;           /* gap at the top: the wall stays visible (click it to close) */
  background: #000;
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.6s var(--ease);
}
.overlay.is-open .sheet { transform: none; }
.sheet__close { position: absolute; z-index: 2; top: 24px; right: calc(var(--sa-r) + 24px); }
.sheet__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  user-select: text;
  -webkit-user-select: text;
}
.sheet__inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 100px calc(var(--sa-r) + 60px) calc(var(--sa-b) + 60px) calc(var(--sa-l) + 60px);
}
.overlay .sheet__title {
  margin: 0 0 2rem;
  font-family: var(--font);
  font-weight: 500;
  font-size: 4rem;                               /* 64px */
  line-height: 1;
  letter-spacing: -0.03em;
}
.sheet__title { --rv-delay: 0.15s; --rv-step: 0.02s; }   /* while the sheet slides up */
.sheet__pills { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 2rem; padding: 0; list-style: none; }
.sheet__pills:empty { display: none; }
.sheet .pill { background: #fff; color: #000; height: auto; padding: 0.375rem 0.75rem; font-size: 0.875rem; line-height: 1.2; }
.sheet__text { max-width: 44rem; margin: 0 0 2rem; font-size: 1.25rem; font-weight: 500; line-height: 1.5; color: rgb(255 255 255 / 0.7); }
.sheet__text:empty { display: none; }
.sheet__live { gap: 3px; padding: 0 14px 0 16px; background: #ff5e27; color: #fff; }
.sheet__live[hidden] { display: none; }
.sheet__live svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* View Website with a mouse: follows the cursor over linked pictures (script.js);
   the static button in the text stays for touch screens */
.sheet__follow {
  position: fixed;
  left: 0; top: 0;
  z-index: 3;
  gap: 3px;
  height: 32px;
  padding: 0 10px 0 12px;
  background: #ff5e27;
  color: #fff;
  pointer-events: none;                          /* clicks go to the picture underneath */
  translate: var(--mx, 0px) var(--my, 0px);
  will-change: translate;
  opacity: 1; scale: 1;
  transition: opacity 0.2s, scale 0.25s var(--ease);
}
.sheet__follow.is-away { opacity: 0; scale: 0.6; }
.sheet__follow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sheet__media .is-link { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .sheet__live { display: none; } }
@media (hover: none), (pointer: coarse) { .sheet__follow { display: none; } }
.sheet__media { display: grid; gap: 24px; margin-top: 4rem; }
.sheet__item {                                   /* 4:3 frame: a blurred preview under the real picture */
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
}
.sheet__ph {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(20px);
  scale: 1.1;                                     /* hide the blur's soft edges */
}
.sheet__m {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.sheet__m.is-loaded { opacity: 1; }
@media (max-width: 720px) {
  .sheet { top: calc(var(--sa-t) + 56px); }
  .sheet__inner { padding: 88px calc(var(--sa-r) + 20px) calc(var(--sa-b) + 32px) calc(var(--sa-l) + 20px); }
  .sheet__text { font-size: 1.0625rem; }
  .overlay .sheet__title { font-size: 3rem; }
  .sheet__media { gap: 12px; margin-top: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

/* ---------- Fallback ---------- */
.fallback { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: #e7e7e1; }
.fallback[hidden] { display: none; }
.fallback__panel { max-width: 420px; padding: 28px; border-radius: 24px; display: grid; gap: 8px; }
.fallback__panel p { margin: 0; color: var(--muted); line-height: 1.55; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .overlay__panel--project { grid-template-columns: 1fr; }
  .project__body { padding: 4px 8px 8px; }
  .overlay h2 { font-size: 1.6875rem; }
  .wordmark__logo { height: 17px; }
  .pill { padding: 9px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .overlay, .overlay__panel, .hint, .side, #gl, .wordmark, .nav, .bottom, .overlay--gallery > * { transition: none !important; }
}

/* Phones: nav buttons stacked on the right, right-aligned */
@media (max-width: 560px) {
  .wordmark { top: calc(var(--sa-t) + 24.5px); left: calc(var(--sa-l) + 16px); }
  .wordmark__logo { height: 13px; }
  .nav { top: calc(var(--sa-t) + 16px); right: calc(var(--sa-r) + 12px); flex-direction: column; align-items: flex-end; gap: 0; }
  .nav .btn { height: 30px; padding: 0 11px; font-size: 0.8125rem; }
}

/* ---------- Password gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: calc(var(--sa-t) + 8px) calc(var(--sa-r) + 8px) calc(var(--sa-b) + 8px) calc(var(--sa-l) + 8px);
  background: #000;                              /* solid black, nothing shows through */
  color: #fff;
  transition: opacity 0.5s var(--ease);
}
.is-unlocked .gate { display: none; }
.is-unlocking .gate { opacity: 0; pointer-events: none; }
/* one big password line on the right half: "Password ____ →" */
.gate { place-items: center end; }
.gate__card {
  position: relative;
  width: min(50vw, 100%);
  padding: 0 calc(var(--sa-r) + 40px) 0 0;
  color: #fff;
}
.gate__card.is-wrong { animation: gate-shake 0.4s var(--ease); }
@keyframes gate-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.gate__field {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #7d7d7a;              /* grey line under field and arrow */
  transition: border-color 0.2s;
}
.gate__field:focus-within { border-color: #fff; }
.gate__input {
  flex: 1;
  min-width: 0;
  height: 1.4em;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 500 4rem/1 var(--font);
  letter-spacing: -0.02em;
  outline: none;
}
.gate__input::placeholder { color: #fff; opacity: 1; }
.gate__input:focus::placeholder { color: #7d7d7a; }
.gate__input::selection { background: rgb(255 255 255 / 0.25); }   /* after a wrong try the text is selected */
.gate__submit {                                  /* just the arrow */
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  margin-right: 12%;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.gate__submit svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: butt; stroke-linejoin: miter; }   /* square corners */
.gate__submit:hover { opacity: 0.7; }
.gate__submit:active { transform: scale(0.94); }
.gate__error { position: absolute; left: 0; top: 100%; min-height: 20px; margin: 16px 0 0; color: #ff5e27; font: 400 0.875rem var(--font); }
@media (max-width: 900px) {
  .gate { place-items: center; }
  /* phones: the field sits a bit above the middle (the keyboard covers the
     lower half), arrow at the right end of the line, all inside the screen */
  .gate { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--sa-b) + 18vh); }   /* column = screen width, not the input's natural width */
  .gate__card { box-sizing: border-box; width: 100%; padding: 0 calc(var(--sa-r) + 16px) 0 calc(var(--sa-l) + 16px); }
  .gate__field { gap: 12px; }
  .gate__input { width: 0; font-size: 2.5rem; height: 1.5em; }
  .gate__submit { width: 44px; height: 44px; margin-right: -6px; }   /* 44px tap target, arrow tip on the line's end */
  .gate__submit svg { width: 36px; height: 36px; }
  .gate__error { margin-top: 12px; }
}
/* legal links under the password line, flush with the line's right end,
   Privacy policy 24px next to Imprint */
.gate__legal {
  left: calc(50vw - var(--sa-r) - 8px);
  right: calc(2 * var(--sa-r) + 48px);
  justify-content: flex-end;
  gap: 24px;
  font-weight: 500;
}
.gate__legal a { color: #7d7d7a; }               /* same grey as the focused "Password" placeholder */
.gate__legal a:hover { color: #fff; }
@media (max-width: 900px) {
  .gate__legal { left: calc(var(--sa-l) + 24px); right: calc(var(--sa-r) + 24px); bottom: calc(var(--sa-b) + 24px); font-size: 0.875rem; }
}

