/* =========================================================================
   Zane Bergen — cinematic gallery
   A dark, photo-forward portfolio. The hero slowly crossfades through
   outdoor photographs and fades out as you scroll into the content.
   Display: Fraunces · Body: Hanken Grotesk · Labels: Fragment Mono.
   ========================================================================= */

:root {
  --bg:    #0C0D0F;
  --bg-2:  #131418;
  --bg-3:  #1B1D22;

  --text:  #ECEBE7;
  --muted: #9D9C95;
  --faint: #6A6A64;

  --line:   rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.20);

  --accent: #D2A879;          /* warm sand, used sparingly */

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --mono:  'Fragment Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wrap: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #1a140c; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--text); color: var(--bg);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Top bar ----------------------------------------------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 5vw, 2.75rem);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
  padding-block: 1rem;
}
.topbar .brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 18px rgba(0,0,0,0.5);
}
.topbar.scrolled .brand { text-shadow: none; }
.topbar nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.2rem);
}
.topbar nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
  position: relative;
  padding-bottom: 2px;
}
.topbar.scrolled nav a { color: var(--muted); text-shadow: none; }
.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.topbar nav a:hover { color: #fff; }
.topbar.scrolled nav a:hover { color: var(--text); }
.topbar nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero: crossfading photographs ------------------------------- */
.hero {
  position: fixed;
  inset: 0;
  height: 100svh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;       /* purely visual; nav sits above */
  will-change: opacity, transform;
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.0);
  transition: opacity 3.2s var(--ease);
}
.hero-photo.is-active {
  opacity: 1;
  transform: scale(1.07);
  transition: opacity 3.2s var(--ease), transform 11s ease-out;
}
/* Photo credit — sits under the nav, fades with the photograph */
.hero-credit {
  position: absolute;
  top: clamp(5rem, calc(9vh + 1.5rem), 7rem);   /* clears the topbar at any height */
  right: clamp(1.25rem, 5vw, 2.75rem);          /* flush with the nav's right edge */
  z-index: 2;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.hero-credit .ast {
  color: var(--accent);
  font-size: 0.82rem;
  vertical-align: -0.06em;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(8,9,11,0.42) 0%,
      rgba(8,9,11,0.06) 26%,
      rgba(8,9,11,0.10) 55%,
      rgba(10,11,13,0.72) 86%,
      rgba(12,13,15,0.98) 100%),
    radial-gradient(120% 80% at 50% 38%, transparent 40%, rgba(6,7,9,0.5) 100%);
}
.hero-foot {
  position: fixed;
  inset: 0;
  z-index: 2;                 /* above the page seam, below the topbar */
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 0 clamp(1.25rem, 5vw, 2.75rem) clamp(1.7rem, 4.5vh, 2.8rem);
  pointer-events: none;
  will-change: transform, opacity;
}
.hero-id { max-width: 64ch; }
.hero-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin: 0 0 1.2rem;
  text-shadow: 0 1px 16px rgba(0,0,0,0.55);
}
.hero-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 8.5vw, 6.75rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,0.45);
}
.hero-tag {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 22px rgba(0,0,0,0.5);
}

.m-scroll {
  flex: none;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  text-shadow: 0 1px 14px rgba(0,0,0,0.5);
}
.m-arrow {
  display: inline-block;
  animation: nudge 2.4s var(--ease) infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(-1px); opacity: 0.55; }
  50%      { transform: translateY(3px);  opacity: 1; }
}

/* ---------- Page (scrolls up over the hero) ----------------------------- */
.page {
  position: relative;
  z-index: 1;
  margin-top: 100svh;
  background: var(--bg);
}
/* Sub-pages (work.html): no hero underneath, so no viewport offset or seam */
.page--sub { margin-top: 0; padding-top: clamp(5.5rem, 12vh, 8rem); }
.page--sub::before { display: none; }

.section .page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
.topbar nav a[aria-current="page"] { color: var(--text); }

/* soft seam: blends the photo into the page as content rises.
   Taller = a slower, more gradual fade between the image and the content. */
.page::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -46svh;
  height: 46svh;
  background: linear-gradient(180deg, transparent, var(--bg) 82%);
  pointer-events: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 6vw, 2rem);
}

.section { padding-block: clamp(4rem, 10vw, 7.5rem); }
.section + .section { border-top: 1px solid var(--line); }

/* .section scope outguns `.intro p`, which would otherwise re-size the kicker */
.section .kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.4rem;
}
.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Intro / about ----------------------------------------------- */
.intro p {
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 1.3rem;
  font-weight: 400;
}
.intro p:last-child { margin-bottom: 0; }
.intro p.sub {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--muted);
}
.intro .accent { color: var(--accent); }

/* Inline links inside body copy — underline only, so they read as text first */
.intro a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease);
}
.intro a:hover { color: var(--accent); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-photo {
  margin: 0.4rem 0 0;
}
.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.about-photo figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 280px; }
}

/* ---------- Work list --------------------------------------------------- */
.work-list {
  margin-top: 2.8rem;
  border-top: 1px solid var(--line);
}
.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.work-item:hover { padding-left: 0.75rem; }
.work-item .w-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.work-item .w-meta {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
}
.work-item .w-desc {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 1rem;
  max-width: 54ch;
  margin: 0;
}
.work-item .w-stack {
  grid-column: 1 / -1;
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.work-item .w-links {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.3rem;
  margin-top: 0.4rem;
}
.work-item .w-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.work-item .w-links a:hover { color: var(--text); }
.work-item .w-links .w-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.work-item .w-shots {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 1.15rem;
}
.work-item .w-shots img,
.work-item .w-shots video {
  width: min(240px, 31.5%);
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: block;
}

.work-note {
  margin-top: 1.6rem;
  font-size: 0.92rem;
  color: var(--faint);
}

/* ---------- Contact ----------------------------------------------------- */
.contact h2 { margin-bottom: 2.2rem; }
.contact-list { border-top: 1px solid var(--line); }
.contact-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.contact-list a:hover { padding-left: 0.75rem; }
.contact-list .c-key {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  flex: none;
  width: 6.5rem;
}
.contact-list .c-val {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  flex: 1;
}
.contact-list a:hover .c-val { color: var(--accent); }
.contact-list .c-go { color: var(--accent); flex: none; transition: transform 0.2s var(--ease); }
.contact-list a:hover .c-go { transform: translateX(4px); }

/* ---------- Footer ------------------------------------------------------ */
.footer {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 2.4rem 0;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--faint);
}
.footer .f-colophon {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

/* ---------- Reveal on scroll (progressive enhancement) ------------------ */
.js-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js-ready .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive -------------------------------------------------- */
@media (max-width: 720px) {
  .hero-foot {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;   /* main axis is vertical here */
    gap: 1.6rem;
  }
  .m-scroll { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .topbar { padding: 1rem 1.25rem; }
  .topbar nav { gap: 0.9rem; }
  .topbar nav a { font-size: 0.68rem; letter-spacing: 0.04em; }
  .work-item .w-meta { text-align: left; }
  .work-item .w-shots { overflow-x: auto; padding-bottom: 0.4rem; }
  .work-item .w-shots img,
  .work-item .w-shots video { width: 158px; min-width: 158px; }
  .contact-list a { flex-wrap: wrap; }
  .contact-list .c-key { width: 100%; }
}

/* ---------- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-photo.is-active { transform: none; }
  .js-ready .reveal { opacity: 1; transform: none; }
}
