/* ============================================================
   DESIGN SYSTEM — editorial dark
   Tokens live in the Tailwind config (each HTML file <head>).
   Only custom behavior that Tailwind can't express lives here.
   ============================================================ */

html {
  background: #ffffff;
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-weight: 300;
}

::selection {
  background: #A1C41F;
  color: #ffffff;
}

/* thin scrollbar to match the aesthetic */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #ffffff; }
::-webkit-scrollbar-thumb { background: #d1d1d1; }
::-webkit-scrollbar-thumb:hover { background: #A1C41F; }

/* gradient text — hero accent */
.text-gradient {
  background-image: linear-gradient(105deg, #141c07 0%, #5c7a12 28%, #A1C41F 46%, #d3e68c 52%, #A1C41F 58%, #5c7a12 74%, #141c07 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: text-sheen 7s ease-in-out infinite;
}
@keyframes text-sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .text-gradient { animation: none; }
}

/* ---------- links ---------- */

/* animated underline for inline + nav links */
.link-line {
  position: relative;
}
.link-line::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-line:hover::after,
.link-line.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.link-line.is-active::after {
  background: #A1C41F;
}

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* stagger children slightly when inside a .reveal-group */
.reveal-group > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-group.in > * {
  opacity: 1;
  transform: none;
}
.reveal-group.in > *:nth-child(2)  { transition-delay: 0.06s; }
.reveal-group.in > *:nth-child(3)  { transition-delay: 0.12s; }
.reveal-group.in > *:nth-child(4)  { transition-delay: 0.18s; }
.reveal-group.in > *:nth-child(5)  { transition-delay: 0.24s; }
.reveal-group.in > *:nth-child(6)  { transition-delay: 0.30s; }
.reveal-group.in > *:nth-child(7)  { transition-delay: 0.36s; }
.reveal-group.in > *:nth-child(8)  { transition-delay: 0.42s; }

/* ---------- work index rows ---------- */

.work-row {
  transition: background 0.25s ease;
}
.work-row .row-title {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}
.work-row:hover .row-title {
  transform: translateX(8px);
}
.work-row .row-meta {
  transition: color 0.25s ease;
}
/* hover = invert the row to dark */
.work-row:hover {
  background: #0a0a0a;
}
.work-row:hover .row-title {
  color: #ffffff;
}
.work-row:hover .row-meta,
.work-row:hover .row-num {
  color: #8a8a8a;
}

/* image zoom inside thumbs */
.img-zoom img,
.vid-zoom video {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.img-zoom:hover img,
.vid-zoom:hover video {
  transform: scale(1.03);
}

/* ---------- filter buttons ---------- */

/* pill badges — hairline outline, solid ink when active */
.filter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.65em;
  padding: 9px 20px 8px;
  font-family: "Syne", sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  color: #707070;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.filter-btn:hover {
  color: #0A0A0A;
  border-color: rgba(0, 0, 0, 0.4);
}
.filter-btn.is-active {
  color: #FAFAF7;
  background: #0A0A0A;
  border-color: #0A0A0A;
}
.filter-ico {
  display: inline-flex;
  align-self: center;
  color: #A1C41F;
  opacity: 0.9;
}
.filter-ico svg {
  width: 15px;
  height: 15px;
  display: block;
}
.filter-count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0;
  opacity: 0.45;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.filter-btn.is-active .filter-count {
  opacity: 1;
  color: #A1C41F;
}
.tier-btn {
  font-family: "Syne", sans-serif;
  font-weight: 300;
  font-size: 12px;
  padding: 6px 16px 5px;
  border-radius: 999px;
  color: #707070;
  transition: color 0.3s ease, background 0.3s ease;
}
.tier-btn:hover {
  color: #0A0A0A;
}
.tier-btn.is-active {
  background: #0A0A0A;
  color: #FAFAF7;
}
.viewport-btn.is-active {
  background: #A1C41F;
  color: #ffffff;
  border-color: #A1C41F;
}

/* ---------- misc ---------- */

/* status dot pulse — flat, no glow */
.dot-pulse {
  animation: dotpulse 2s ease-in-out infinite;
}
@keyframes dotpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* work row thumbnail polish */
.work-row img {
  filter: grayscale(1);
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.work-row:hover img {
  filter: grayscale(0);
  transform: scale(1.08);
}

/* footer kinetic hover */
.footer-noise {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.footer-cta:hover h2 {
  color: #A1C41F;
}
.footer-cta .text-reveal {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.footer-cta .text-reveal::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
  color: #A1C41F;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.footer-cta:hover .text-reveal::after {
  transform: translateY(-100%);
}
.footer-cta:hover .text-reveal > span {
  transform: translateY(-100%);
}
.footer-cta .text-reveal > span {
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.6s ease;
}
.footer-cta h2 {
  transition: color 0.6s ease;
}

/* film-grain overlay — drop onto any banner/section, set opacity inline */
.noise {
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* clothing carousel — seamless horizontal loop */
.loop-track {
  animation: loopscroll var(--dur, 40s) linear infinite;
}
.loop-row:hover .loop-track {
  animation-play-state: paused;
}
@keyframes loopscroll {
  to {
    transform: translateX(-50%);
  }
}

/* floating collage pieces — gentle drift, flat */
.float-piece {
  animation: floaty 8s ease-in-out infinite;
  will-change: transform;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-14px) rotate(var(--r, 0deg)); }
}

[data-drift], [data-parallax] {
  will-change: transform;
}

/* keep images grayscale until hover — cohesive editorial feel */
.img-bw img {
  filter: grayscale(1);
}
.img-bw:hover img,
.group:hover .img-bw img {
  filter: grayscale(0);
  transition: filter 0.5s ease;
}

/* ---------- featured showcase ghost numerals ---------- */
.ghost-num {
  position: absolute;
  top: 50%;
  left: 4vw;
  transform: translateY(-58%);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 40vw;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(10, 10, 10, 0.09);
  pointer-events: none;
  user-select: none;
}
@media (min-width: 768px) {
  .ghost-num {
    font-size: 26vw;
  }
}
.carousel-card:nth-child(even) .ghost-num {
  left: auto;
  right: 4vw;
}

/* ---------- film grain overlay ---------- */

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 80;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(8) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-4%, -6%); }
  25% { transform: translate(3%, -4%); }
  37% { transform: translate(-5%, 3%); }
  50% { transform: translate(4%, 6%); }
  62% { transform: translate(-3%, 5%); }
  75% { transform: translate(5%, -3%); }
  87% { transform: translate(-4%, -2%); }
}

/* ---------- preloader ---------- */

.hero-visual-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-n-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  font-family: "Instrument Serif", serif;
  font-size: 75vw;
  line-height: 0.8;
  color: #0a0a0a;
  opacity: 0.025;
  user-select: none;
  white-space: nowrap;
}
.hero-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 80vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(161, 196, 31, 0.08) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  filter: blur(100px);
  z-index: -1;
}

#preloader {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
#preloader.is-done {
  transform: translateY(-101%);
}
#preloader [data-bar] {
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- custom cursor ---------- */

html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #ffffff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 120;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease;
}
#cursor.is-hover {
  width: 44px;
  height: 44px;
}
@media (pointer: coarse) {
  #cursor { display: none; }
}

/* ---------- icons ---------- */

.icon {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  flex: none;
}

/* ---------- masked line reveal (hero headlines) ---------- */

.mask-line {
  display: block;
  overflow: hidden;
}
.mask-line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in .mask-line > span {
  transform: translateY(0);
}

/* ---------- word rotator ---------- */

.word-rotator {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.rot-word {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.45s;
}
.rot-word.is-out {
  transform: translateY(-110%);
  opacity: 0;
}
.rot-word.is-in {
  transform: translateY(110%);
  opacity: 0;
  transition: none;
}

/* ---------- page transitions ---------- */

body {
  transition: opacity 0.3s ease;
}
body.is-leaving {
  opacity: 0;
}

/* ---------- scroll progress (project pages) ---------- */

#progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #A1C41F;
  transform-origin: left;
  transform: scaleX(0);
  z-index: 150;
  pointer-events: none;
}

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
#lightbox img {
  transform: scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#lightbox.is-open img {
  transform: scale(1);
}

/* ---------- rotating badge ---------- */

.spin-slow {
  animation: spin 14s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .grain { animation: none; }
  .dot-pulse { animation: none; }
  .spin-slow { animation: none; }
  .float-piece { animation: none; }
  .reveal,
  .reveal-group > *,
  .mask-line > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  #preloader { display: none; }
}

/* ---------- filter transition ---------- */
#work-list, #cover-grid, #spec-grid, #clothing-grid, #music-grid, #web-grid {
  transition: opacity .28s ease, transform .28s ease;
}
.grid-fading {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.fi {
  animation: fi-in .55s cubic-bezier(.22,.9,.3,1) both;
  animation-delay: calc(var(--fi, 0) * 32ms);
}
@keyframes fi-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- mailto chooser ---------- */
.mailto-pop {
  position: fixed;
  z-index: 120;
  background: #fafaf7;
  border: 1px solid #e4e4de;
  box-shadow: 0 12px 40px rgba(10,10,10,.12);
  min-width: 220px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.mailto-pop.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mailto-pop a, .mailto-pop button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 12px 16px;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #0a0a0a;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.mailto-pop a:hover, .mailto-pop button:hover { background: rgba(10,10,10,.05); }
.mailto-pop a + a, .mailto-pop a + button, .mailto-pop button + a, .mailto-pop button + button {
  border-top: 1px solid #e4e4de;
}
.mailto-pop .mp-note {
  font-family: "Syne", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #8a8a8a;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e4e4de;
}

/* ---------- featured hover preview ---------- */
.feat-preview {
  position: fixed;
  z-index: 90;
  width: min(300px, 26vw);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 22px)) scale(0.94);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.feat-preview.on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 22px)) scale(1);
}
.feat-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  background: #fafaf7;
  border: 1px solid #e4e4de;
  box-shadow: 0 18px 55px rgba(10, 10, 10, 0.14);
}
