/* ---- Homepage layout ---------------------------------------------------------------------------------
   A slim black bar, the intro in large type on black, then each project: its name and a one-line
   summary above its three carousel pictures, side by side. */
.home2 { margin: 0; padding-top: 34px; background: #000; color: #000; font-family: var(--font-family); font-weight: var(--font-weight); letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
.home2 a { color: inherit; text-decoration: none; }
html { -webkit-tap-highlight-color: transparent; }
html:has(body.home2) { background: #000; }   /* pulling past the top shows black, however hard: the bar and intro read as one */
.h2-foot { box-shadow: 0 0 0 100vh #fff; clip-path: inset(0 -100vw -100vh -100vw); }   /* …and past the bottom, white: a white strip hangs below the footer (clipped so it only reaches down) */
.h2-work, .h2-foot { background: #fff; }   /* the page is black behind the bar (the strip it covers shows when the page is pulled down past the top); white from the projects down */   /* phones: no grey flash when a link or button is tapped */
:focus:not(:focus-visible) { outline: none; }   /* no outline left on a tapped or clicked link (keyboard focus still shows) */
.home2 * { box-sizing: border-box; }

/* the bar: name left, links in the middle-left, email right */
.h2-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 15; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; height: 34px; padding: 0 20px; background: #000; color: #fff; font-size: 11px; }   /* no line: the bar and the black intro read as one block */
.h2-bar__links { justify-self: start; }
.h2-bar__mail { justify-self: end; }
.h2-bar__m { display: none; }
@media (hover: hover) { .h2-bar a:hover { opacity: .6; } }
.h2-bar a { transition: opacity .2s ease; }

/* the intro on black */
.h2-intro { background: #000; color: #fff; padding: clamp(96px, 13vw, 220px) 20px 48px; }
.h2-intro__text { max-width: 31em; margin: 0; font-size: clamp(20px, 2.15vw, 33px); line-height: 1.2; letter-spacing: -0.02em; }
.h2-intro__text + .h2-intro__text { margin-top: 1.1em; }
.h2-intro__text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; }
.h2-intro__clients { max-width: 31em; margin: 1em 0 0; color: rgb(255 255 255 / 0.5); font-size: clamp(20px, 2.15vw, 33px); line-height: 1.2; letter-spacing: -0.02em; }   /* the same size as the intro above it, in grey */

/* the projects */
.h2-work { padding: clamp(48px, 6vw, 80px) 20px 64px; }
.h2-project { display: block; }
.h2-project + .h2-project { margin-top: clamp(72px, 7vw, 112px); }   /* more room between projects */
.h2-project__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; font-size: 16px; line-height: 1.3; }   /* name + description on the left, disciplines on the right */
.h2-project__text { display: flex; flex-direction: column; gap: 6px; }   /* a little space under the name */
.h2-project__name { align-self: flex-start; padding-bottom: 2px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s cubic-bezier(.4, 0, .2, 1); }
@media (hover: hover) { .h2-project:hover .h2-project__name { background-size: 100% 1px; } }   /* the underline grows in from the left */   /* the only hover: the name underlines, also when over the pictures */
.h2-project__summary { color: #8a8a8a; }
.h2-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.h2-tag { padding: 6px 10px; border-radius: 4px; background: rgb(0 0 0 / 0.07); color: rgb(0 0 0 / 0.56); font-size: 13px; line-height: 1.2; }   /* disciplines: light grey text in grey boxes */
.h2-project__pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.h2-pic { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 0; background: #f2f2f2; }
.h2-pic img, .h2-pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.h2-pic .is-in { opacity: 1; }
.h2-shade { position: absolute; z-index: 1; border-radius: 4px; box-shadow: 0 0 0 100vmax var(--shade); pointer-events: none; }   /* homeShade: colours everything around the mockup */
.h2-project img, .h2-project video { transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }

/* the footer, in light grey */
.h2-foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 28px 20px 14px; color: #9a9a9a; font-size: 11px; }   /* the same size as the bar, the same grey as the headings in the project text */
.h2-foot__links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.h2-foot__links:last-child { justify-self: end; }
.h2-foot a { transition: color .2s ease; }
@media (hover: hover) { .h2-foot a:hover { color: #000; } }

/* phones: the bar keeps name + email, the three pictures become a sideways swipe */
@media (max-width: 767px) {
  .h2-bar { grid-template-columns: 1fr auto; padding: 0 16px; font-size: 11px; }
  .h2-bar__links, .h2-bar__mail { display: none; }
  .h2-bar__m { display: block; justify-self: end; }   /* About, Selected Work, Contact in place of the email */
  .h2-intro { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(100svh - 50px - (100vw - 40px) / 4); padding: 144px 16px 40px; }   /* the text low on the first screen, with the top half of the first pictures showing below (bar 34 + gap 40 + half a 2:3 tile) */
  .h2-intro__text { font-size: 21px; }
  .h2-work { padding: 40px 0 56px; }
  .h2-project__head { padding: 0 16px; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 15px; }
  .h2-tags { justify-content: flex-start; margin-top: 14px; }   /* a little more room above the disciplines */
  .h2-project__summary, .h2-intro__text, .h2-intro__clients { text-wrap: pretty; }   /* full width, but no word left alone on the last line */
  .h2-intro__clients { font-size: 21px; }
  .h2-foot { display: flex; justify-content: space-between; gap: 12px; padding: 24px 16px calc(14px + env(safe-area-inset-bottom)); }
  .h2-foot__links:nth-child(2) { display: none; }   /* phones: the year and name, then Email and LinkedIn */
  /* phones: the three pictures side by side first, the name and description below */
  .h2-project { display: flex; flex-direction: column; }
  .h2-project__head { margin: 20px 0 0; align-items: stretch; }
  .h2-project__text { width: 100%; }   /* the name and description run the full width */
  .h2-project__pics { order: -1; gap: 4px; padding: 0 16px; }
  .h2-pic { aspect-ratio: 2 / 3; }   /* taller on phones (home2.js shade() uses the same shape) */
  .h2-project { margin: 0 16px; padding-bottom: 48px; border-bottom: 1px solid rgb(0 0 0 / 0.1); }   /* a thin line under each project, within the side margins */
  .h2-project__head, .h2-project__pics { padding-left: 0; padding-right: 0; }   /* the margin is on the project now */
  .h2-project + .h2-project { margin-top: 28px; }   /* closer together */
  .h2-project:last-child { padding-bottom: 0; border-bottom: 0; }   /* less space under the last project */
}

/* section links (About, Selected Work) land just below the pinned bar */
.h2-intro, .h2-work { scroll-margin-top: 34px; }
@media (prefers-reduced-motion: no-preference) { html:has(body.home2) { scroll-behavior: smooth; } }   /* About / Selected Work glide into place */

/* the password box (homepage): opens right over the spot you clicked, the page blurred behind it —
   the same box as on the project pages (site.css) */
.home2 .gate-blur { position: fixed; inset: 0; z-index: 19; background: rgb(170 170 170 / 0.5); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); transition: opacity .4s cubic-bezier(.645, .045, .355, 1); }
.home2 .gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 0 16px; font-size: 11px; line-height: 14px; letter-spacing: -0.025em; transition: opacity .4s cubic-bezier(.645, .045, .355, 1); }
.home2 .gate-blur.is-leaving, .home2 .gate.is-leaving { opacity: 0; pointer-events: none; }
.home2 .gate button { font: inherit; color: #000; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.home2 .gate) p { margin: 0; }   /* (low priority, so the spacing below wins) */
.home2 .gate__box { position: relative; width: min(420px, 100%); padding: 44px 24px 12px; border-radius: 5px; background: #fff; }
.home2 .gate__close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; }
.home2 .gate__text { padding-right: 24px; margin-bottom: 18px; color: #000; }   /* a little less room above the password field */
.home2 .gate__text a { color: inherit; transition: opacity .24s ease; }
@media (hover: hover) { .home2 .gate__text a:hover { opacity: .5; } }
.home2 .gate__field { display: flex; align-items: center; height: 31px; border-radius: 5px; background: rgb(244 244 244); }
.home2 .gate__input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 12px; border: 0; background: none; font: inherit; letter-spacing: inherit; color: #000; outline: none; }
.home2 .gate__input::placeholder { color: #858585; opacity: 1; }
.home2 .gate__go { flex: none; width: 34px; height: 100%; }
.home2 .gate__error { height: 1.2em; line-height: 1.2em; margin-top: 8px; font-size: .85em; color: #858585; }
.home2 .gate__form.is-wrong .gate__field { animation: gate-shake .35s cubic-bezier(.645, .045, .355, 1); }
@keyframes gate-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } 100% { transform: none; } }
html.is-gated:has(body.home2) { overflow: hidden; }   /* the page stays where it is underneath */
@media (max-width: 767px) {
  .home2 .gate__field { height: 40px; }
  .home2 .gate__box { padding: 40px 16px 10px; }
  .home2 .gate__error { font-size: 9px; }
  .home2 .gate__text { padding-right: 0; }
  .home2 .gate__close { top: 4px; right: 4px; }
}
@media (min-width: 1801px) { .home2 .gate { font-size: 13px; line-height: 17px; } .home2 .gate__box { width: min(calc(28em + 72px), 100%); } }   /* as site.css on wide screens */
@media (min-width: 768px) {   /* desktop: bigger text and box in the password modal */
  .home2 .gate { font-size: 14px; line-height: 18px; }
  .home2 .gate__box { width: min(calc(28em + 80px), 100%); padding: 52px 28px 14px; }
  .home2 .gate__close { top: 8px; right: 8px; width: 34px; height: 34px; }
  .home2 .gate__close svg { width: 11px; height: 11px; }
  .home2 .gate__field { height: 40px; }
  .home2 .gate__input { padding: 0 14px; }
  .home2 .gate__go { width: 42px; }
}
