/* Home: hero over the photo, About split card, Work grid. Contact panel styles live in contact.css (shared). */

/* ── hero: full viewport, crisp photo behind an always-dark glass panel ── */
.hero { position: relative; min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h)); display: grid; align-items: center; padding-block: 48px; isolation: isolate; }
.hero__photo { position: absolute; inset: 0; z-index: -1; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, var(--ink) 72%, transparent 100%); mask-image: linear-gradient(180deg, var(--ink) 72%, transparent 100%); }
/* layers (css/depth.css, js/hero-depth.js): .hero__depth moves with scrolling and the pointer, its spare 24px hiding the
   edges; .hero__shot holds the picture, whichever kind it is, and has the Ken Burns */
.hero__depth { position: absolute; inset: -24px; }
.hero__shot { width: 100%; height: 100%; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
/* photo themes: the colour story's lead photo replaces the hero (html.photo-theme, --theme-hero set in src/layout.js) */
.photo-theme .hero__shot { background-image: var(--theme-hero); background-position: center 40%; background-size: cover; background-repeat: no-repeat; }
.photo-theme .hero__photo img { visibility: hidden; }
.hero__inner { display: grid; justify-items: center; }
.hero__panel { max-width: 720px; text-align: center; background: color-mix(in srgb, var(--ink) 58%, transparent); }
/* LinkedIn photo: straddles the panel's top edge, opens /linkedin */
.hero__panel:has(.hero__linkedin) { margin-top: 64px; padding-top: 0; }
.hero__linkedin { display: inline-grid; justify-items: center; gap: 10px; margin: -64px 0 18px; color: var(--cream); text-decoration: none; border-radius: var(--radius-lg); }
.hero__avatar { position: relative; width: 128px; height: 128px; border-radius: 50%; transition: transform .4s var(--ease-out); }
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--cream); box-shadow: 0 14px 34px color-mix(in srgb, var(--ink) 45%, transparent); }
.hero__in { position: absolute; right: 0; bottom: 2px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cream); color: var(--ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 40%, transparent); }
.hero__in svg { width: 20px; height: 20px; fill: currentColor; }
.hero__linkedin-label { display: inline-flex; align-items: center; gap: .45em; min-height: 36px; padding: 0 1.1em; border-radius: var(--radius-pill); border: 1px solid color-mix(in srgb, var(--cream) 40%, transparent); background: color-mix(in srgb, var(--cream) 14%, transparent); font-weight: 600; font-size: .9rem; transition: background .2s ease; }
.hero__linkedin:hover .hero__avatar { transform: translateY(-3px) scale(1.04); }
.hero__linkedin:hover .hero__linkedin-label { background: color-mix(in srgb, var(--cream) 26%, transparent); }
.hero__linkedin:focus-visible { outline-color: var(--cream); }
.hero__panel .eyebrow { color: var(--sand); }
.hero__panel h1 { margin-bottom: .3em; }
.hero__statement { font-size: clamp(1.08rem, 1.8vw, 1.3rem); line-height: 1.55; color: var(--cream); max-width: 34ch; margin: 0 auto 1.6em; }
.hero__panel .btn-row { justify-content: center; }
.hero .btn:focus-visible { outline-color: var(--cream); }

/* ── section headings ── */
.section-head { margin-bottom: clamp(20px, 3vw, 36px); }
.section-head .lede { margin: 0; }

/* ── about: split glass card ── */
.about { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.about__photo { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); box-shadow: var(--shadow-glass); }
.about__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.about__text .prose { margin-bottom: 1.4em; }

@media (max-width: 767px) {
  .hero { padding-block: 32px; }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 260px; }
}

/* ── work: single-row coverflow (site.js). Without JS: a horizontal scroll-snap row, each card's back below its front. ── */
.work-carousel { position: relative; width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; overflow: clip; padding-block: 10px 6px; --cf-w: min(400px, 78vw); }
:root:not(.js-anim) .work-carousel.reveal { opacity: 1; transform: none; filter: none; } /* no JS: .reveal would stay hidden */
.work-grid { list-style: none; margin: 0; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px max(var(--gutter), calc(50vw - var(--cf-w) / 2)) 20px; scrollbar-width: none; }
.work-grid::-webkit-scrollbar { display: none; }
.work-card { position: relative; flex: 0 0 var(--cf-w); scroll-snap-align: center; display: flex; flex-direction: column; padding: 10px; }
.work-card__media { position: relative; isolation: isolate; aspect-ratio: 4 / 3; }
.work-card__media img { object-position: center top; }
.work-card__title { margin: 0; padding: 14px 8px 6px; font-size: clamp(1.2rem, 2.2vw, 1.4rem); line-height: 1.25; }
/* the link covers the whole card, so nothing between it and .work-card may be positioned or transformed (.btn:hover is) */
.work-card__link::after { content: ''; position: absolute; inset: -1px; border-radius: var(--radius-lg); }
.work-card__link:focus-visible { outline: none; }
.work-card__link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.work-card__front .work-card__link { color: inherit; text-decoration: none; }
.work-card__back { padding: 0 8px 8px; }
.work-card__back .work-card__title { display: none; }
.work-card__back p { color: var(--text-muted); font-size: .96rem; line-height: 1.55; margin: .4em 0 1em; }
.work-card__back .work-card__link { margin-top: 16px; min-height: 42px; padding: .6em 1.2em; font-size: .9rem; transform: none; }
.work-card__flip { display: none; }

/* "Open project" over the image: on hover or keyboard focus; where nothing can hover, always there in the corner */
.work-card__cue { position: absolute; z-index: 1; top: 50%; left: 50%; min-height: 44px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-50% + 10px)); box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 40%, transparent); transition: opacity .25s ease, transform .4s var(--ease-out); }
.work-card__front:has(.work-card__link:focus-visible) .work-card__cue { opacity: 1; transform: translate(-50%, -50%); }
@media (hover: hover) { .work-card__front:has(.work-card__link:hover) .work-card__cue { opacity: 1; transform: translate(-50%, -50%); } }
@media (hover: none) {
  .work-card .work-card__cue { top: auto; left: 10px; bottom: 10px; min-height: 38px; padding: .5em 1.1em; font-size: .86rem; transform: none !important; }
  .work-carousel:not(.is-coverflow) .work-card__cue, .work-card.is-active .work-card__cue { opacity: 1; }
}
/* glass shine: a slanted highlight parked outside the image; site.js sweeps it across once. The tinted edges are what
   show on a white image. */
.work-card__shine { position: absolute; inset: 0; pointer-events: none; transform: translateX(-101%);
  background: linear-gradient(112deg, transparent 22%,
    color-mix(in srgb, var(--sky) 24%, transparent) 33%, color-mix(in srgb, var(--cream) 34%, transparent) 37%,
    color-mix(in srgb, var(--cream) 78%, transparent) 46%, color-mix(in srgb, var(--cream) 30%, transparent) 53%,
    color-mix(in srgb, var(--cream) 8%, transparent) 56%, color-mix(in srgb, var(--cream) 58%, transparent) 60%,
    color-mix(in srgb, var(--sky) 20%, transparent) 64%, transparent 72%); }

/* coverflow mode */
.work-carousel.is-coverflow:focus { outline: none; } /* focusable by click only (for the arrow keys), never a tab stop */
.is-coverflow .work-grid { display: block; position: relative; overflow: visible; padding: 0; height: var(--cf-h, 460px); perspective: 1400px; transition: height .45s var(--ease-out); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.is-coverflow .work-card { position: absolute; top: 0; left: 50%; width: var(--cf-w); margin-left: calc(var(--cf-w) / -2); transform-origin: 50% 50%; will-change: transform, opacity; transition: transform .7s var(--ease-out), opacity .5s ease, filter .5s ease, background .3s ease; }
.is-coverflow .is-dragging .work-card { transition: none; }
.is-coverflow .work-card:not(.is-active) { cursor: pointer; filter: saturate(.85) brightness(.9); }
@media (hover: hover) { .is-coverflow .work-card:not(.is-active):hover { filter: none; } }
.is-coverflow .work-card.is-active { box-shadow: 0 24px 60px color-mix(in srgb, var(--ink) 28%, transparent); }
/* Two faces in one grid cell. site.js turns the whole card edge-on, swaps the face there (.is-flipped) and turns it on
   round: the same picture as a two-sided 3D card, but .glass keeps its blur (backdrop-filter rules out preserve-3d).
   The front always holds the card's height; the back adds to it only while showing, if it needs more room. */
.is-coverflow .work-card { display: grid; grid-template-columns: minmax(0, 1fr); }
.is-coverflow .work-card__front, .is-coverflow .work-card__back { grid-area: 1 / 1; }
.is-coverflow .work-card__back { display: flex; flex-direction: column; align-items: flex-start; }
.is-coverflow .work-card:not(.is-flipped) .work-card__back { display: none; }
.is-coverflow .work-card.is-flipped .work-card__front { visibility: hidden; }
.is-coverflow .work-card.is-flipped { background: color-mix(in srgb, var(--bg) 86%, transparent); } /* text stays readable over bright side cards */
.is-coverflow .work-card__back .work-card__title { display: block; padding: 12px 56px 8px 0; min-height: 60px; }
.is-coverflow .work-card__back .work-card__link { margin-top: auto; }
.is-coverflow .work-card__back .tags { margin-bottom: 18px; }
.is-coverflow .work-card__flip { position: absolute; z-index: 2; top: 18px; right: 18px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--glass-border); background: color-mix(in srgb, var(--bg) 84%, transparent); color: var(--text); cursor: pointer; box-shadow: var(--shadow-glass); transition: background .2s ease, opacity .3s ease; }
.work-card__flip:hover { background: var(--bg); }
.work-card__flip:focus-visible { border-radius: 50%; }
.work-card__flip svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease-out); }
@media (hover: hover) { .work-card__flip:hover svg { transform: scale(1.12); } }
.is-coverflow .work-card:not(.is-active) .work-card__flip { opacity: 0; }

.work-carousel__arrow { display: none; }
.is-coverflow .work-carousel__arrow { position: absolute; z-index: 200; top: calc(var(--cf-h, 460px) / 2 - 24px); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-glass); transition: background .2s ease, transform .2s ease; }
.work-carousel__arrow:hover { background: var(--glass-bg-hover); transform: scale(1.06); }
.work-carousel__arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.work-carousel__arrow--prev { left: max(var(--gutter), calc(50vw - var(--maxw) / 2)); }
.work-carousel__arrow--next { right: max(var(--gutter), calc(50vw - var(--maxw) / 2)); }

.work-carousel__controls[hidden] { display: none; }
.work-carousel__controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px var(--gutter) 0; }
.work-carousel__dots { display: flex; align-items: center; gap: 2px; }
.work-carousel__dots button { width: 22px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.work-carousel__dots button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); opacity: .4; transition: width .3s ease, opacity .3s ease, border-radius .3s ease; }
.work-carousel__dots button[aria-current="true"]::before { width: 20px; border-radius: 4px; opacity: 1; background: var(--terracotta-strong); }
.work-carousel__play { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); cursor: pointer; }
.work-carousel__play svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.work-carousel__play .i-play { fill: currentColor; stroke-width: 1.5; }
.work-carousel__play .i-play, .work-carousel__play[aria-pressed="true"] .i-pause { display: none; }
.work-carousel__play[aria-pressed="true"] .i-play { display: block; }
.work-carousel__count { margin: 0; min-width: 3.2em; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--text-muted); text-align: right; }
@media (max-width: 767px) { .is-coverflow .work-carousel__arrow { display: none; } }
