:root {
  --font-heading: 'HelveticaNowDisplay-Medium', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'HelveticaNowDisplayW01-Rg', 'Helvetica Neue', Arial, sans-serif;
  --ink: #0c0c0b;
  --paper: #faf9f7;
  --paper-deep: #f3f1ec;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: #ffffff;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Custom cursor (desktop) */
.has-cursor,
.has-cursor a,
.has-cursor button,
.has-cursor input,
.has-cursor textarea,
.has-cursor [data-cursor] {
  cursor: none;
}
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  pointer-events: none;
  border-radius: 9999px;
  mix-blend-mode: difference;
  display: none;
}
body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring {
  display: block;
}
.cursor-dot {
  width: 7px;
  height: 7px;
  background: #ffffff;
}
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid #ffffff;
  transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1), height 0.32s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.32s ease;
}
body.cursor-hover .cursor-ring {
  width: 66px;
  height: 66px;
  background: rgba(255, 255, 255, 0.1);
}

/* Page transition curtain */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(0);
  will-change: transform;
}
.page-curtain.intro {
  animation: curtainUp 0.85s cubic-bezier(0.76, 0, 0.24, 1) both;
}
.page-curtain.outro {
  animation: curtainDown 0.55s cubic-bezier(0.76, 0, 0.24, 1) both;
}
@keyframes curtainUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}
@keyframes curtainDown {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

::selection {
  background: #EAECE9;
  color: #1C2E1E;
}

/* Hide scrollbar on horizontal scroll rows */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Fine film grain — tactile, premium */
.grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fade-in on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.05s cubic-bezier(0.16, 1, 0.3, 1), transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Work card media zoom + reveal */
.work-media img,
.work-media video {
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  filter: saturate(0.96);
}
.work-card:hover .work-media img,
.work-card:hover .work-media video {
  transform: scale(1.045);
  filter: saturate(1.04);
}
.work-view {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.work-card:hover .work-view {
  opacity: 1;
  transform: translateY(0);
}
.work-num {
  transition: color 0.5s ease;
}
.work-card:hover .work-num {
  color: var(--ink);
}

/* Premium link underline draw */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: 2px;
}
.link-underline:hover {
  background-size: 100% 1px;
}

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 26s linear infinite;
}

/* Pulse dot */
@keyframes softpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}
.status-dot {
  animation: softpulse 2.4s ease-in-out infinite;
}

/* Refined input focus */
.field {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.field:focus {
  background-color: #fff;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Spin (asterisk motif) */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin-slow { animation: spin 26s linear infinite; }
.spin-rev { animation: spin 34s linear infinite reverse; }

/* Word-by-word reveal */
.reveal-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.62em) rotate(1.5deg);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-words.is-visible .word {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .reveal-words .word { opacity: 1; transform: none; transition: none; }
  .marquee-track, .status-dot, .animate-blink, .spin-slow, .spin-rev { animation: none; }
  .page-curtain.intro, .page-curtain.outro { animation: none; }
}
