/* ==========================================================================
   Subpage refresh. Loaded AFTER styles.css, overrides only.
   Brings pages/*.html in line with the homepage (css/site.css) without
   touching the original stylesheet or the subpage markup.
   ========================================================================== */

:root {
  --ink-900: #05070f;
  --ink-700: #12182b;
  --surface: rgba(57, 80, 102, 0.28);
  --surface-hi: rgba(57, 80, 102, 0.46);
  --hairline: rgba(164, 243, 255, 0.16);
  --hairline-hi: rgba(164, 243, 255, 0.34);
  --mint: #d5ffea;
  --cyan: #a4f3ff;
  --lav: #d1ccff;
  --magenta: #894384;
  --magenta-hi: #b85bb0;
  --accent: #74edff;
  --text-dim: #8ea8b8;

  /* the homepage card fill and its hard drop shadow, for the header chips */
  --card: rgba(57, 80, 102, 0.42);
  --card-shadow: rgba(9, 7, 26, 0.42);

  --display: "Bebas Neue", Impact, sans-serif;
  --word: "Vampiro One", cursive;
  --label: "Oswald", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wrap: 1560px;
  --radius: 10px;
  --radius-lg: 12px;
}

html {
  /* The colour is not decoration, it is the backstop a fixed background needs:
     `fixed` confines the gradient to one viewport box, and on a phone the
     browser paints canvas outside that box (URL bar collapsing, overscroll),
     which without a colour underneath comes out browser-default white. See the
     full explanation on html in css/site.css. --ink-900 is the gradient's own
     end stop, so the seam is invisible. */
  background-color: var(--ink-900);
  background-image: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-700) 22%, var(--ink-700) 76%, var(--ink-900) 100%);
  background-attachment: fixed;
  scroll-padding-top: 96px;
}

/* the original hid scrollbars everywhere, which costs orientation */
*,
html {
  scrollbar-width: auto;
  /* These pages are long walls of lazily loaded images. A smooth anchor
     scroll gets fought by scroll anchoring as those images resolve, so the
     back-to-top arrow never actually arrives. Instant jumps always land. */
  scroll-behavior: auto;
}
*::-webkit-scrollbar {
  display: initial;
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(164, 243, 255, 0.22);
  border-radius: 10px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ header bar */
/* The same component as the homepage header in css/site.css: wordmark left,
   the work tabs in the middle, contact icons and the language switch on the
   right. Restated here because these pages load styles.css, not site.css.
   The subpages have no hero, so the bar is solid from the first pixel. */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: var(--ink-900);
  font-family: var(--label);
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus {
  top: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-block: 0.7rem;
  background: rgba(8, 11, 20, 0.86);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--hairline);
}

/* A backdrop-filter makes this header the containing block for any fixed
   positioned descendant, which would collapse the full screen mobile menu
   into the bar itself. Drop the blur for as long as the menu is open. */
.site-header.has-menu-open {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
}

/* the site wordmark, identical to the homepage header */
.wordmark {
  font-family: var(--word);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.55rem);
  font-weight: 400;
  line-height: 1;
  color: var(--lav);
  text-decoration: none;
  text-shadow: 0 2px var(--magenta), 0 4px var(--magenta), 0 6px var(--magenta);
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}

.wordmark:hover {
  color: var(--accent);
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 1.9vw, 2.2rem);
  list-style: none;
}

.main-nav li {
  margin: 0;
}

.nav-link {
  position: relative;
  font-family: var(--label);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mint);
  text-decoration: none;
  text-shadow: none;
  white-space: nowrap;
  padding-block: 0.2rem;
  transition: color 0.25s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* tap to call and mail, always on screen for phone visitors */
.header-contact {
  display: flex;
  gap: 0.45rem;
}

.header-contact a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--mint);
  box-shadow: 3px 3px var(--card-shadow);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.header-contact a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px var(--card-shadow);
  color: var(--accent);
}

.header-contact svg {
  width: 21px;
  height: 21px;
}

.lang-switch {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 3px 3px var(--card-shadow);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mint);
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink-900);
}

.main-nav .lang-switch--menu {
  display: none;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: var(--card);
  box-shadow: 3px 3px var(--card-shadow);
  border-radius: var(--radius);
  width: 46px;
  height: 46px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transform: translateX(-50%);
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateX(-50%) translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateX(-50%) translateY(-6px) rotate(-45deg);
}

/* the page name, styled like a homepage section heading */
.page-title {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.2rem, 1.85rem + 1.6vw, 3.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  border-bottom: 0;
  padding: 0;
  margin: 2.5rem auto 3.5rem;
  display: block;
  align-self: auto;
}

.page-title::after {
  content: "";
  /* h1::after above is absolutely positioned; reset it so the bar flows */
  position: static;
  transform: none;
  display: block;
  width: 110px;
  height: 5px;
  margin: 1.8rem auto 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--magenta-hi, #b85bb0), var(--accent));
}

/* the old full-width rule under the header is redundant now */
.navline {
  display: none;
}

/* --------------------------------------------------------------- content */
main {
  padding-top: 2.5rem;
}

h1 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  letter-spacing: 0.02em;
  border-bottom: 0;
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1.6rem;
}

h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 92px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.description,
p {
  color: #cfe9f2;
  line-height: 1.65;
}

/* ----------------------------------------------------------------- cards */
.new-card,
.new-card-small {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.new-card:hover,
.new-card-small:hover {
  transform: translateY(-5px);
  border-color: var(--hairline-hi);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.5);
}

.card-image {
  border-radius: 0;
  transition: transform 0.6s var(--ease);
}

.new-card:hover .card-image,
.new-card-small:hover .card-image {
  transform: scale(1.05);
}

.card-image-link {
  overflow: hidden;
}

.card-title {
  font-family: var(--label);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.PageLink {
  font-family: var(--label);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 15px 15px;
}

.PageLink:hover {
  color: #9df4ff;
}

/* --------------------------------------------------------------- media */
.gridbox img,
.refImage {
  border-radius: 6px;
}

.portVid {
  border-radius: var(--radius-lg);
  margin: 30px auto;
  max-width: 100%;
}

/* --------------------------------------------------------------- gallery */
/* pages/gallery.html is the homepage gallery on its own page, reachable from
   the work nav instead of jumping back to the front page. The grid below is
   the same component as css/site.css, restated because these pages load
   styles.css, whose older .gallery-* rules it overrides. */
.gallery-note {
  max-width: 44rem;
  margin: -1.6rem auto 2.6rem;
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.3rem;
}

/* four per row on desktop, so each piece is shown large */
@media (min-width: 1080px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  background: var(--ink-700);
  box-shadow: 8px 8px var(--card-shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.gallery-item:hover {
  transform: translate(-4px, -4px);
  box-shadow: 13px 13px var(--card-shadow);
}

.gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.07);
}

@media (max-width: 860px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .gallery-item {
    box-shadow: 7px 7px var(--card-shadow);
  }
}

/* ------------------------------------------------------- back to top */
/* identical to the homepage button in css/site.css */
.to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(164, 243, 255, 0.34);
  background: rgba(8, 11, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--mint);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s,
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------------------------------------------------------------- footer */
.line {
  display: none;
}

.footer {
  border-top: 1px solid var(--hairline);
  padding-top: 1.4rem;
  margin-top: 3rem;
}

h6 {
  color: var(--text-dim);
}

/* ------------------------------------------- breakpoints / mobile menu */
/* these labels run longer than the homepage's, so buy them room before the
   row has to wrap into the contact buttons */
@media (max-width: 1080px) {
  .nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
  }

  .header-inner {
    gap: 0.9rem;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
    position: relative;
    z-index: 120;
  }

  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    /* one row spanning the overlay, so the list's min-height: 100% below has
       something definite to measure against */
    grid-template-rows: 1fr;
    justify-items: center;
    align-items: center;
    /* a long menu on a short phone has to stay reachable: without the safe
       keyword the centred list overflows past the top edge and cannot be
       scrolled back to. Browsers without it keep plain centring. */
    align-items: safe center;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(5, 7, 15, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* The list fills the overlay so the two auto margins below have space to
     share out: the destinations settle in the middle, the language switch
     sits on the bottom edge instead of reading as a sixth menu item. */
  .main-nav ul {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.1rem;
    min-height: 100%;
    /* clears the hamburger, which sits above this overlay */
    padding: 5rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* free space is split evenly between these two, so the links stay centred
     while the switch is pushed all the way down. On a screen too short for
     both, the margins collapse to zero and the list simply scrolls. */
  .main-nav ul > li:first-child,
  .main-nav ul > li:last-child {
    margin-top: auto;
  }

  /* the original site's oversized stacked menu, kept for the phone */
  .main-nav .nav-link {
    font-size: clamp(1.8rem, 7.5vw, 2.8rem);
    letter-spacing: 0.04em;
    color: var(--lav);
    text-shadow: 0 3px var(--magenta), 0 6px var(--magenta);
  }

  .main-nav .nav-link::after {
    display: none;
  }

  .main-nav .lang-switch--menu {
    display: inline-flex;
    margin-top: 0;
  }

  .main-nav .lang-switch--menu button {
    font-size: 1.1rem;
    padding: 0.7rem 1.5rem;
  }

  .header-actions .lang-switch {
    display: none;
  }

  main {
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ------------------------------------------------------ overflow fixes */
/* styles.css sizes sections and grids in vw. With a vertical scrollbar
   present, 100vw exceeds the content width and the page scrolls sideways. */
body {
  overflow-x: hidden;
}

section {
  width: 100%;
}

.grid,
.grid1,
.grid2,
.gridSmall {
  width: min(100% - 2.5rem, 1400px);
  margin: 40px auto;
}

.gridbox img {
  width: 100%;
}

.portVid {
  width: min(100% - 2.5rem, 1120px);
  height: auto;
  aspect-ratio: 16 / 9;
}

.CardHolder-small,
.CardHolder {
  width: min(100% - 2.5rem, 1400px);
  margin-inline: auto;
}

@media (max-width: 880px) {
  .grid,
  .grid1,
  .grid2,
  .gridSmall {
    width: 100%;
    margin: 24px auto;
    grid-template-columns: 1fr;
  }

  /* styles.css asks for 100vw columns here, which are wider than this padded
     container. The column then starts at the container's left edge and runs
     off the right, so the card centred inside it lands a gutter's width to
     the right of the page's own centre line. One plain column fixes it. */
  .CardHolder {
    grid-template-columns: 1fr;
  }

  .CardHolder .new-card {
    width: 100%;
  }

  .page-title {
    margin: 1.6rem auto 2.2rem;
  }
}
