/* =============================================================================
   Bailey Hill Photography
   ========================================================================== */

:root {
  --color-bg: #000000;
  --color-bg-raised: #0A0A0A;
  --color-text: #FFFFFF;
  --color-text-muted: rgba(255,255,255,0.6);
  --color-accent: #FFB800;
  --color-accent-rare: #2D6CFF;
  --space-unit: 4px;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

  --font: "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  --nav-h: 68px;
  --gutter: 24px;
  --tile-gap: 6px;
  --section-y: 96px;
}

@media (min-width: 900px) {
  :root { --gutter: 48px; --section-y: 128px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 64px; --section-y: 160px; --nav-h: 76px; }
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) { body { font-size: 19px; } }

img { display: block; max-width: 100%; }

h1, h2, h3, p, figure { margin: 0; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 200;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
}
.skip-link:focus { top: 8px; text-decoration: none; }

/* -----------------------------------------------------------------------------
   Type
--------------------------------------------------------------------------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0 0 20px;
}
@media (min-width: 900px) { .eyebrow { font-size: 13px; } }

.h-hero {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
@media (min-width: 700px)  { .h-hero { font-size: 48px; } }
@media (min-width: 1200px) { .h-hero { font-size: 64px; } }

.h-section {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 32px;
}
@media (min-width: 900px) { .h-section { font-size: 38px; } }

.prose { max-width: 640px; }
.prose p + p { margin-top: 24px; }

/* -----------------------------------------------------------------------------
   Layout
--------------------------------------------------------------------------- */

.wrap { padding-inline: var(--gutter); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }

.section__head { margin-bottom: 48px; }
.section__head .h-section { margin-bottom: 0; }

/* -----------------------------------------------------------------------------
   Navigation
--------------------------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  height: var(--nav-h);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
}

.wordmark {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wordmark:hover { text-decoration: none; }

/* Groups links + social icon + hamburger so .nav keeps exactly two flex
   children (wordmark, nav__right) at every breakpoint — space-between still
   pins them to opposite edges instead of spreading three items evenly. */
.nav__right {
  display: flex;
  align-items: center;
  gap: 32px;
}
@media (max-width: 899px) { .nav__right { gap: 20px; } }

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  position: relative;
  display: inline-block;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-block: 6px;
}
.nav__link:hover { text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--color-accent); }

/* The one deliberate use of Huracan Blue: a 2px rule sweeping in from the left. */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent-rare);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms var(--ease-standard);
}
.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* Icon-only, deliberately outside .nav__link — it's a social link, not a page
   destination, so it doesn't take part in the blue underline-sweep rule that's
   reserved for primary nav (see 4.4). Plain amber hover instead. */
.nav__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text);
  transition: color 150ms linear;
}
.nav__social:hover,
.nav__social:focus-visible { color: var(--color-accent); text-decoration: none; }

.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--color-text);
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 1px;
  margin: 6px auto;
  background: currentColor;
}

@media (max-width: 899px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* Mobile overlay ---------------------------------------------------------- */

.navmenu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms var(--ease-standard), visibility 0s linear 250ms;
}
.navmenu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 250ms var(--ease-standard), visibility 0s;
}

.navmenu__link {
  color: var(--color-text);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.navmenu__link[aria-current="page"] { color: var(--color-accent); }

.navmenu__social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.15);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.navmenu__social:hover,
.navmenu__social:focus-visible { color: var(--color-accent); text-decoration: none; }
.navmenu__social .icon { width: 24px; height: 24px; }

.navmenu__close {
  position: absolute;
  top: 12px;
  right: calc(var(--gutter) - 10px);
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: var(--color-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

body.is-locked { position: fixed; width: 100%; overflow: hidden; }

/* -----------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Buttons share the row evenly, so a pair reads as a deliberate pair whether it
   sits on one line or stacks. Content width still wins when a label needs more. */
.btn-row .btn { flex: 1 1 0; text-align: center; }

.btn {
  display: inline-block;
  padding: 16px 32px;
  border: 1px solid var(--color-text);
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* Keeps min-content equal to the whole label, so a pair that can't fit on one
     line stacks instead of breaking the words. */
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms linear, color 150ms linear;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--color-bg); color: var(--color-text); }
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--color-text); color: var(--color-bg); }

.btn--secondary { background: var(--color-text); color: var(--color-bg); }
.btn--secondary:hover,
.btn--secondary:focus-visible { background: var(--color-bg); color: var(--color-text); }

/* Icon rides on currentColor, so it inverts with the label on hover for free —
   no separate hover rule needed. */
.btn--icon { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn--icon .icon { width: 18px; height: 18px; }

@media (max-width: 599px) {
  .btn { padding: 16px 24px; }
}
/* Below roughly 350px even the longest label ("Browse the full portfolio") can't
   fit on one line; let it break rather than push the page sideways. */
@media (max-width: 359px) {
  .btn { white-space: normal; }
}

.textlink {
  display: inline-block;
  margin-top: 32px;
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* -----------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  padding-top: var(--nav-h);
}

/* Stacked, the hero photo wants a 4:5 crop (125vw tall), but on a tablet that
   pushes the car below the fold — so it's capped at 70svh. Height rather than
   aspect-ratio, because aspect-ratio plus max-height narrows the box instead of
   just shortening it. */
.hero__media {
  position: relative;
  width: 100%;
  height: min(125vw, 70svh);
}
/* Absolute so the portrait source can't push the grid row taller than the
   viewport on desktop, where the row is sized by the text column. */
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 46%;
}

.hero__text {
  padding: 56px var(--gutter) 72px;
  align-self: center;
}

.hero__sub {
  margin-top: 24px;
  max-width: 460px;
  color: var(--color-text);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 44fr 56fr;
    min-height: 100svh;
    padding-top: 0;
  }
  .hero__text {
    grid-column: 1;
    padding: calc(var(--nav-h) + 48px) 56px 48px var(--gutter);
  }
  .hero__media {
    grid-column: 2;
    height: 100%;
  }
}

/* -----------------------------------------------------------------------------
   Grid + tiles
--------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--tile-gap);
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  /* aspect-ratio sizes the row; height:100% then makes every tile fill it, so a
     wide tile and a portrait tile in the same row share one bottom edge. */
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--color-bg);
  font-family: inherit;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
}
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }

.tile--wide { grid-column: span 2; aspect-ratio: 3 / 2; }

.tile__hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 200ms var(--ease-standard);
}
.tile:hover .tile__hover,
.tile:focus-visible .tile__hover { opacity: 1; }

.tile__label {
  position: relative;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 6px;
}
.tile__label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-accent);
}

@media (max-width: 899px) {
  /* Two columns can't always take a 2-wide tile in sequence; dense packing
     backfills the cell instead of leaving a hole mid-grid. Tile order carries
     no meaning, so the reshuffle costs nothing. */
  .grid { grid-template-columns: repeat(2, 1fr); grid-auto-flow: row dense; }
  .tile--wide { grid-column: span 2; aspect-ratio: 16 / 10; }
}

@media (max-width: 599px) {
  .grid { grid-template-columns: 1fr; }
  .tile--wide { grid-column: span 1; aspect-ratio: 4 / 3; }
}

/* Touch devices never get :hover, so keep the label permanently legible. */
@media (hover: none) {
  .tile__hover { display: none; }
}

/* -----------------------------------------------------------------------------
   Gallery clusters
--------------------------------------------------------------------------- */

.cluster + .cluster { margin-top: 72px; }
.cluster__label { margin-bottom: 20px; color: var(--color-text-muted); }

/* -----------------------------------------------------------------------------
   CTA block
--------------------------------------------------------------------------- */

.cta {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 560px;
  overflow: hidden;
}
.cta__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}
.cta__inner {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) 72px;
  max-width: 640px;
}

@media (min-width: 900px) {
  .cta { min-height: 78svh; }
  .cta__inner { padding-bottom: 96px; }
}

/* -----------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 32px var(--gutter);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}
.footer a { color: var(--color-text-muted); transition: color 150ms linear; }
.footer a:hover { color: var(--color-accent); }
.footer__spacer { flex: 1 1 auto; }

.footer__social { display: inline-flex; align-items: center; gap: 6px; }
.footer__social .icon { width: 15px; height: 15px; }

/* -----------------------------------------------------------------------------
   Lightbox
--------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-raised);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms var(--ease-standard), visibility 0s linear 200ms;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms var(--ease-standard), visibility 0s;
}

.lightbox__figure {
  margin: 0;
  padding: 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 200ms var(--ease-standard);
}
.lightbox.is-swapping .lightbox__img { opacity: 0; }

/* width:0 keeps the caption out of the figure's intrinsic width, so the figure
   sizes to the photo; min-width then stretches the caption back across it. */
.lightbox__caption {
  width: 0;
  min-width: 100%;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text-muted);
}

.lb-btn {
  position: absolute;
  background: none;
  border: 0;
  color: var(--color-text);
  cursor: pointer;
  width: 56px;
  height: 56px;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-btn:hover { color: var(--color-accent); }
.lb-close { top: 8px; right: 8px; }
.lb-prev  { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 0; top: 50%; transform: translateY(-50%); }

@media (max-width: 599px) {
  .lightbox__figure { padding: 0 12px; }
  .lb-prev { left: 0; top: auto; bottom: 12px; transform: none; }
  .lb-next { right: 0; top: auto; bottom: 12px; transform: none; }
}

/* -----------------------------------------------------------------------------
   Scroll reveal
--------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 500ms var(--ease-standard) var(--reveal-delay, 0ms),
    transform 500ms var(--ease-standard) var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* No JS: never leave the page invisible. */
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    transform: none;
    transition: opacity 200ms linear 0ms;
  }
  .nav__link::after { transition: none; }
  .lightbox__img { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
