/* WORKS — isolated page styling. Existing Home / WHO AM I styles remain untouched. */

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.works-page {
  position: relative;
  min-height: 100svh;
  background: #0d0c0c;
  color: rgba(240,238,234,.90);
  font-family: 'Avant Garde', 'AvantGarde', 'Century Gothic', 'Avenir Next', Avenir, Arial, Helvetica, sans-serif;
  font-weight: 400;
  overflow: hidden;
}

/* Deep cloudy atmosphere, intentionally abstract and image-free. */
.works-page::before,
.works-page::after {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
}

.works-page::before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 14% 62%, rgba(116,112,107,.20) 0%, rgba(54,51,49,.13) 18%, rgba(13,12,12,0) 42%),
    radial-gradient(ellipse at 87% 57%, rgba(102,98,94,.18) 0%, rgba(42,40,39,.12) 19%, rgba(13,12,12,0) 43%),
    radial-gradient(ellipse at 50% 105%, rgba(132,127,119,.12) 0%, rgba(13,12,12,0) 39%),
    radial-gradient(ellipse at 51% 24%, rgba(70,68,65,.08) 0%, rgba(13,12,12,0) 35%);
  filter: blur(26px);
  animation: works-cloud-drift 18s ease-in-out infinite alternate;
}

.works-page::after {
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 25%, rgba(0,0,0,.28) 100%),
    repeating-radial-gradient(ellipse at 50% 100%, rgba(255,255,255,.012) 0 1px, transparent 1px 7px);
  opacity: .55;
}

@keyframes works-cloud-drift {
  0% { transform: translate3d(-1.5%, 0, 0) scale(1.02); }
  100% { transform: translate3d(1.5%, -1%, 0) scale(1.06); }
}

.works-page .site-header {
  position: fixed;
  z-index: 20;
  top: calc(4.15% + 5px);
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.works-page .site-header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .22em;
}

.works-page .site-header a {
  color: #f0eeea;
  text-decoration: none;
  transition: opacity .25s ease, transform 1200ms cubic-bezier(.2,.75,.25,1);
}

.works-page .site-header a:hover,
.works-page .site-header a:focus-visible { opacity: .48; transform: scaleX(1.055); transform-origin: center; }

.works-page .site-header a.active,
.works-page .site-header a[aria-current="page"] {
  color: #777674;
  opacity: 1;
  pointer-events: none;
  cursor: default;
  letter-spacing: .22em;
}

.works-page .site-header .header-back-arrow {
  color: #f0eeea;
  opacity: 1;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0;
  margin-right: -25px;
  flex: 0 0 auto;
  transition: transform 1200ms cubic-bezier(.2,.75,.25,1), opacity .25s ease;
}

.works-page .site-header .header-back-arrow:hover,
.works-page .site-header .header-back-arrow:focus-visible {
  opacity: 1;
  transform: translateX(-3px);
}

.works-page .site-header span {
  color: #f0eeea;
  opacity: .58;
  font-size: 16px;
  letter-spacing: 0;
}

.works-home-logo {
  position: fixed;
  z-index: 20;
  top: calc(4.15% + 43px);
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: auto;
  line-height: 0;
  display: block;
}

.works-home-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: invert(1);
  opacity: .9;
  transition: opacity .25s ease;
}

.works-home-logo:hover img,
.works-home-logo:focus-visible img { opacity: .58; }

.works-stage {
  position: relative;
  z-index: 8;
  width: 100%;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-menu {
  width: 330px;
  max-width: 82vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: translateY(calc(2.5% - 20px));
}

.works-item {
  position: relative;
  display: flex;
  width: 330px;
  max-width: 82vw;
  min-height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f0eeea;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 0;
}

/* The entire row is the hit area — not individual letters. */
.works-word {
  width: min(330px, 78vw);
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  user-select: none;
}

.works-letter {
  display: inline-block;
  flex: 0 0 auto;
  will-change: transform;
  transition: none;
}

.works-word.is-interactive {
  transition: gap 1680ms cubic-bezier(.2,.75,.25,1);
}

.works-line {
  display: block;
  width: var(--line-open, 132px);
  height: 1px;
  margin-top: 10px;
  background: rgba(240,238,234,.55);
  opacity: .55;
  transition: width 1680ms cubic-bezier(.2,.75,.25,1);
}

/* Short contextual note for the WORKS page. It is intentionally kept
   separate from the category menu so adding the text does not alter the
   existing menu spacing or interaction. */
.works-description {
  position: absolute;
  z-index: 9;
  top: calc(71.5% + 20px);
  left: 50%;
  width: 330px;
  max-width: 82vw;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(240,238,234,.41);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .025em;
  text-align: center;
}

#worksParticles {
  position: fixed;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .works-page .site-header { top: 33px; }
  .works-page .site-header nav { gap: 24px; font-size: 12px; letter-spacing: .19em; }
  .works-page .site-header a:hover, .works-page .site-header a:focus-visible { transform: scaleX(1.045); transform-origin: center; }
  .works-home-logo { top: 63px; width: 30px; }
  .works-page .site-header .header-back-arrow { font-size: 19px; margin-right: -18px; }
  .works-menu { width: min(480px, 82vw); gap: 19px; }
  .works-word { width: min(330px, 78vw); font-size: 24px; }
}

@media (max-width: 600px) {
  .works-page .site-header { top: 27px; }
  .works-page .site-header nav { gap: 13px; font-size: 9px; letter-spacing: .13em; }
  .works-page .site-header a:hover, .works-page .site-header a:focus-visible { transform: scaleX(1.035); transform-origin: center; }
  .works-home-logo { top: 52px; width: 26px; }
  .works-page .site-header .header-back-arrow { font-size: 16px; margin-right: -10px; }
  .works-menu { width: min(430px, 88vw); gap: 16px; transform: translateY(calc(1% - 20px)); }
  .works-item { min-height: 60px; }
  .works-word { width: min(330px, 82vw); height: 38px; font-size: 20px; }
  .works-line { width: 105px; margin-top: 8px; }
}


/* WORKS incoming transition: destination stays hidden behind the black cover. */
html.grav-incoming-works body.works-page > *:not(.page-transition) {
  opacity: 0;
  animation: gravWorksDestinationReveal 1000ms cubic-bezier(.22,.72,.22,1) forwards;
}

html.grav-incoming-works body.works-page .page-transition {
  opacity: 1;
  visibility: visible;
  background: #000;
}

@keyframes gravWorksDestinationReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Hand & Digital Paintings — two-level title, while preserving the existing
   WORKS hover language: the smaller descriptor sits about 10px above the
   normal-sized PAINTINGS line and both expand together on hover. */
.works-paintings-word {
  height: 52px;
  flex-direction: column;
  gap: 0;
  justify-content: center;
  overflow: visible;
}

.works-paintings-word .painting-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin-bottom: -1px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 2px;
  font-weight: 400;
  white-space: nowrap;
  transition: gap 1680ms cubic-bezier(.2,.75,.25,1);
}

.works-paintings-word .painting-main {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  font-size: inherit;
  line-height: 1;
  letter-spacing: 0;
  font-weight: inherit;
  white-space: nowrap;
  transition: gap 1680ms cubic-bezier(.2,.75,.25,1);
}

.works-paintings-word .painting-letter {
  display: inline-block;
  flex: 0 0 auto;
}

.works-paintings-item .works-line {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .works-paintings-word .painting-sub { font-size: 15px; }
}

@media (max-width: 600px) {
  .works-paintings-word .painting-sub { font-size: 13px; height: 17px; }
  .works-paintings-word .painting-main { height: 31px; }
}

/* Gallery pages: WORKS remains directly accessible while the back arrow
   continues to return to the Graphics category page. */
.abstract-gallery-page .site-header a.active,
.abstract-gallery-page .site-header a[aria-current="page"],
.photo-collage-gallery-page .site-header a.active,
.photo-collage-gallery-page .site-header a[aria-current="page"] {
  color: #a6a39f;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.abstract-gallery-page .site-header a.active:hover,
.abstract-gallery-page .site-header a.active:focus-visible,
.photo-collage-gallery-page .site-header a.active:hover,
.photo-collage-gallery-page .site-header a.active:focus-visible {
  color: #c0bdb8;
  opacity: .88;
  transform: scaleX(1.055);
  transform-origin: center;
}


/* V159 — the wordmark replaces the centered feather mark on standard internal pages. */
body:has(.internal-wordmark) .works-home-logo { display:none; }

/* V201 — WORKS phone responsiveness.
   The menu lives in the space BELOW the header/nav (never over it), every
   size scales with the viewport height as well as width, and very short
   screens (landscape phones) get a vertically scrollable page instead of a
   clipped one. Letter spreading is narrowed on small widths so short words
   (MUSIC) no longer look scattered. */
@media (max-width: 700px) {
  html:has(body.works-page .works-stage) { overflow: hidden; height: 100%; }
  body.works-page:has(.works-stage) {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  .works-stage {
    box-sizing: border-box;
    height: auto;
    min-height: 100svh;
    padding: 72px 0 calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .works-menu {
    width: min(430px, 88vw);
    max-width: 88vw;
    gap: clamp(2px, 1.6svh, 16px);
    transform: none;
  }
  .works-item {
    width: min(330px, 86vw);
    max-width: 86vw;
    min-height: clamp(44px, 9svh, 60px);
    padding: clamp(2px, .9svh, 8px) 0;
  }
  .works-word {
    width: min(300px, 72vw);
    height: clamp(28px, 5.6svh, 38px);
    font-size: clamp(15px, min(5.4vw, 3.3svh), 20px);
  }
  .works-paintings-word { height: clamp(42px, 8svh, 52px); }
  .works-paintings-word .painting-sub {
    font-size: clamp(10px, min(3.6vw, 2.2svh), 13px);
    height: clamp(13px, 2.6svh, 17px);
  }
  .works-paintings-word .painting-main { height: clamp(26px, 5svh, 31px); }
  .works-line { margin-top: clamp(4px, 1.1svh, 8px); }
}

/* Short screens (landscape phones): smaller rows, page scrolls if needed. */
@media (max-height: 520px) and (max-width: 1000px) {
  html:has(body.works-page .works-stage) { overflow: hidden; height: 100%; }
  body.works-page:has(.works-stage) { height: 100%; overflow-x: hidden; overflow-y: auto; }
  .works-stage {
    box-sizing: border-box;
    height: auto;
    min-height: 100svh;
    padding: 76px 0 24px;
  }
  .works-menu { gap: 4px; transform: none; }
  .works-item { min-height: 42px; padding: 3px 0; }
  .works-word { height: 28px; font-size: 17px; }
  .works-paintings-word { height: 42px; }
  .works-paintings-word .painting-sub { font-size: 11px; height: 14px; }
  .works-paintings-word .painting-main { height: 27px; }
  .works-line { margin-top: 5px; }
}
@media (max-width: 300px) {
  .works-paintings-word .painting-sub { letter-spacing: .6px; font-size: 10px; }
}
