/* Brand styles layered over the original Prologue layout and navigation. */
:root {
  color-scheme: dark;
  --ink: #0c0c0e;
  --section: #17171b;
  --card: #202025;
  --paper: #f5f2ed;
  --muted: #b2afb3;
  --accent: #e62490;
  --button-fill: #f04da6;
  --accent-hover: #f45bae;
  --line: #3c3733;
}

body {
  background: var(--ink);
  color: var(--muted);
  font: 400 16px/1.65 system-ui, sans-serif;
}

.logo-splash {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  body > .logo-splash {
    position: fixed;
    inset: 0;
    z-index: 10003;
    display: grid;
    place-items: center;
    background: #000;
    pointer-events: none;
    /* Run the splash while the template preload class disables other animations. */
    animation: logo-splash-out 1250ms ease-in-out 650ms forwards !important;
  }

  body > .logo-splash img {
    width: min(160px, 45vw);
    height: auto;
    animation: logo-splash-settle 650ms ease-out both !important;
  }

  body:has(:focus-visible) > .logo-splash {
    visibility: hidden !important;
  }
}

@keyframes logo-splash-settle {
  from { transform: scale(1.1); }
  to { transform: scale(0.95); }
}

@keyframes logo-splash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

h1, h2, h3, #main section.dark h1 {
  color: var(--paper);
  font-family: Georgia, serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.55rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.6rem); }
p { margin: 0 0 1.1rem; }
a { color: var(--paper); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

#header {
  left: auto;
  right: 0;
  background: #111114;
  text-align: left;
}
.nav-logo {
  display: block;
  width: 68px;
  height: auto;
  margin: 0.5rem auto;
  transition: filter 180ms ease;
}
.nav-logo:hover { filter: drop-shadow(0 0 8px rgb(244 91 174 / 60%)); }
#nav ul li a { color: var(--muted); min-height: 44px; }
#nav ul li a span {
  padding: 0 0 0 calc(2.5rem + 40px);
  transition: transform 180ms ease, color 180ms ease, text-shadow 180ms ease;
}
#nav ul li a span::before { left: 0; margin-left: 0; transition: color 180ms ease; }
#nav ul li a.active { box-shadow: inset 3px 0 var(--accent); color: var(--paper); }
#nav ul li a.active span::before { color: var(--accent); }
#nav ul li a:is(:hover, :focus-visible) span {
  color: var(--accent-hover);
  text-shadow: 0 0 12px rgb(244 91 174 / 55%);
}
#nav ul li a:is(:hover, :focus-visible) span::before { color: inherit; }
@media (prefers-reduced-motion: no-preference) {
  #nav ul li a:is(:hover, :focus-visible) span { transform: translateY(-3px); }
}
.sidebar-social { margin-left: 1.2rem; font-size: 0.8rem; }
#headerToggle .toggle::before { background: #17171b; color: var(--paper); }

#main > section {
  background: var(--ink);
  background-image: none;
  box-shadow: none;
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 6rem) 0;
  text-align: left;
}
#main > section.two, #main > section.four { background: var(--section); }
#main > section.three { background: var(--ink); }
#main .container { width: min(88%, 72rem); padding: 0; }
#main > section.barber-hero {
  display: flex;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(720px, 92svh);
  border-top: 0;
}
.photo-filters { position: absolute; }
.hero-photo,
.service-card img,
.gallery-tile img,
.about-photo,
#photo-dialog img {
  filter: url(#blush-photo);
}

.hero-photo, .barber-hero::before { position: absolute; inset: 0; }
.hero-photo {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% top;
}
.barber-hero::before {
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(12, 12, 14, .95), rgba(12, 12, 14, .65) 51%, rgba(12, 12, 14, .12));
}
@media (prefers-reduced-motion: no-preference) {
  .barber-hero::before { transition: background-color 1.5s ease-in-out; }
  body.is-preload .barber-hero::before { background-color: #000; }
  .hero-content { animation: hero-reveal 3s cubic-bezier(0.16, 1, 0.3, 1) both; }

  @keyframes hero-reveal {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
  }
}
.hero-content h1 { max-width: 13ch; }
.hero-intro { color: var(--paper); max-width: 40ch; margin: 1.35rem 0 1.7rem; }
.hero-highlight {
  color: #000;
  padding: 1px 6px;

  background: linear-gradient(
    175deg,
    transparent 8%,
    #ff95c8 15%,
    #ff77b9 85%,
    transparent 92%
  );

  clip-path: polygon(
    0% 25%,
    3% 12%,
    97% 8%,
    100% 22%,
    98% 86%,
    3% 92%,
    0% 75%
  );

  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
#main .eyebrow {
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}
.section-heading { max-width: 44rem; margin-bottom: 1.7rem; }
.section-heading h2, .about-grid h2, .booking-grid h2 { margin-bottom: 0.9rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.button, #main section.dark .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--button-fill);
  background-image: none;
  border: 1px solid var(--button-fill);
  border-radius: 3px;
  color: var(--ink) !important;
  font-size: 0.87rem;
  font-weight: 700;
  min-height: 46px;
  padding: 0.65rem 1.2rem;
  text-align: center;
}
.button:not(.button-outline):hover,
#main section.dark .button:not(.button-outline):hover,
dialog .dialog-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
}
.button:not(.button-outline), dialog .dialog-close { transition: color 180ms ease; }
@media (prefers-reduced-motion: no-preference) {
  .button:not(.button-outline), dialog .dialog-close { transition: color 180ms ease, translate 180ms ease; }
  .button:not(.button-outline):hover, dialog .dialog-close:hover { translate: 0 -2px; }
}
.button.button-outline, #main section.dark .button-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--paper) !important;
}
.button.button-outline:hover, #main section.dark .button-outline:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--ink) !important;
}

.services-grid, .portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.service-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 160ms ease;
}
.service-card:hover { border-color: var(--accent); }
.service-card img, .gallery-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
:is(.service-card, .gallery-tile):has(> img[src$="/barber-placeholder.jpg"]) {
  position: relative;
  isolation: isolate;
}
:is(.service-card, .gallery-tile):has(> img[src$="/barber-placeholder.jpg"])::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 4 / 3;
  background-color: var(--accent);
  pointer-events: none;
}
:is(.service-card, .gallery-tile) > img[src$="/barber-placeholder.jpg"] {
  position: relative;
  mix-blend-mode: multiply;
}
.service-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}
.service-card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 0.45rem; }
.service-card-content p { font-size: 0.91rem; margin: 0.65rem 0 1rem; }
.service-card-content .button { margin-top: auto; }
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  :is(.button, button, #headerToggle .toggle) { transition: scale 120ms ease-out; }
  :is(.button, button, #headerToggle .toggle):active { scale: 0.97; }
}
.price { color: var(--accent); font-size: 0.9rem; font-weight: 700; }

.gallery-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
}
.gallery-tile img { transition: transform 220ms ease; }
.gallery-tile:hover img, .gallery-tile:focus-visible img { transform: scale(1.045); }
.gallery-label {
  display: block;
  position: relative;
  padding: 0.65rem 0.75rem;
  background: var(--card);
  color: var(--paper);
  font-size: 0.83rem;
}
.section-actions { margin-top: 1.5rem; }

.about-grid, .booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 4vw, 4.25rem);
  align-items: center;
}
.about-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}
.booking-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.booking-details {
  background: var(--section);
  border: 1px solid var(--line);
  margin: 0;
  padding: 1.4rem;
}
.booking-details dt {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.booking-details dd { margin: 0.2rem 0 0.9rem; overflow-wrap: anywhere; }
.booking-details dd:last-child { margin-bottom: 0; }
#footer {
  background: var(--section);
  border-top: 1px solid var(--line);
  box-shadow: none;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.6rem 1rem;
}
#footer p { margin: 0.15rem 0; }

dialog {
  max-width: min(90vw, 46rem);
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--paper);
}
dialog::backdrop { background: rgba(0, 0, 0, .8); }
@media (prefers-reduced-motion: no-preference) {
  #photo-dialog[open]::backdrop { animation: gallery-backdrop-in 220ms ease-out; }
  #photo-dialog[open] { animation: gallery-lightbox-in 260ms cubic-bezier(0.16, 1, 0.3, 1); }

  @keyframes gallery-backdrop-in {
    from { background-color: transparent; }
  }

  @keyframes gallery-lightbox-in {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
  }
}
dialog form { display: flex; justify-content: end; margin: 0 0 0.5rem; }
dialog .dialog-close {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--button-fill);
  color: var(--ink);
  font-size: 1.25rem;
}
#photo-dialog .dialog-close { position: relative; top: -6px; }
#demo-dialog > .dialog-close {
  position: relative;
  top: -6px;
  margin: 0 0 0.5rem auto;
}
dialog img { display: block; width: 100%; max-height: 69vh; object-fit: contain; }
.lightbox-photo:has(> img[src$="/barber-placeholder.jpg"]) {
  background-color: var(--accent);
  isolation: isolate;
}
.lightbox-photo > img[src$="/barber-placeholder.jpg"] {
  mix-blend-mode: multiply;
}
dialog h2 { font-size: 1.75rem; }
dialog p { margin: 0.75rem 0 0; }
.noscript-note { text-align: center; }

/* Desktop top bar and right-side mobile drawer. */
@media (min-width: 961px) {
  :root { --desktop-nav-height: 76px; }
  html { scroll-padding-top: var(--desktop-nav-height); }
  #header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    width: 100%;
    height: var(--desktop-nav-height);
    padding: 0 clamp(1rem, 3vw, 3rem);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    overflow: visible;
    z-index: 1000;
  }
  #header .top { display: contents; }
  #header .bottom { padding: 0; justify-self: end; }
  .nav-logo {
    position: relative;
    /* Follow the hero container's left edge from inside the padded navbar. */
    left: calc(max(6vw, 50vw - 36rem) - clamp(1rem, 3vw, 3rem));
    width: 96px;
    margin: 0;
  }
  #nav { grid-column: 2; justify-self: center; }
  #nav ul { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0; padding: 0; }
  #nav ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem clamp(0.6rem, 1.2vw, 1.15rem);
    font-size: 1rem;
  }
  #nav ul li a span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0;
    white-space: nowrap;
  }
  #nav ul li a span::before { position: static; line-height: 1; }
  #nav ul li a.active { box-shadow: inset 0 -3px var(--accent); }
  .sidebar-social { margin: 0; white-space: nowrap; }
  #main, #footer { margin-left: 0; }
  #main { padding-top: var(--desktop-nav-height); }
}
@media (max-width: 960px) {
  #header { transform: translateX(275px); }
  #headerToggle { left: auto; right: 0; width: 4.25rem; height: 3.25rem; }
  #headerToggle .toggle::before { left: auto; right: 0.5em; }
  body.header-visible #main,
  body.header-visible #headerToggle { transform: translateX(-275px); }
}

@media (max-width: 1250px) {
  .services-grid, .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 736px) {
  #main > section.barber-hero { min-height: 660px; align-items: end; padding-bottom: 3.25rem; }
  .hero-photo { object-position: 69% center; }
  .barber-hero::before { background: linear-gradient(0deg, var(--ink), rgba(12, 12, 14, .65) 46%, transparent 92%); }
  .about-grid, .booking-grid { grid-template-columns: 1fr; }
  #main .container { width: 89%; }
}
@media (max-width: 490px) {
  .services-grid { grid-template-columns: 1fr; }
  .button-row { align-items: stretch; flex-direction: column; }
  .portfolio-grid { gap: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-pending:not(:focus-within) { opacity: 0; }
  .reveal-enter:not(:focus-within) {
    animation: section-reveal 850ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms) both;
  }

  .service-card:nth-child(2n), .gallery-tile:nth-child(2n) { --reveal-delay: 80ms; }
  .service-card:nth-child(4n + 3), .gallery-tile:nth-child(4n + 3) { --reveal-delay: 160ms; }
  .service-card:nth-child(4n), .gallery-tile:nth-child(4n) { --reveal-delay: 240ms; }

  @media (min-width: 737px) {
    .about-grid > :first-child, .booking-grid > :first-child {
      --reveal-x: -20px;
      --reveal-y: 0px;
    }
    .about-grid > :last-child, .booking-grid > :last-child {
      --reveal-x: 20px;
      --reveal-y: 0px;
      --reveal-delay: 100ms;
    }
  }

  @media (max-width: 736px) {
    .reveal-enter:not(:focus-within) {
      --reveal-y: 10px;
      animation-duration: 1050ms;
      animation-timing-function: cubic-bezier(0.25, 0.65, 0.35, 1);
      animation-delay: 0ms;
    }

    .gallery-tile:nth-child(even).reveal-enter:not(:focus-within) {
      animation-delay: 60ms;
    }
  }

  @keyframes section-reveal {
    from {
      opacity: 0;
      transform: translate(var(--reveal-x, 0px), var(--reveal-y, 20px));
    }
    to { opacity: 1; transform: none; }
  }
}
