:root {
  --bg: #000;
  --fg: #fff;
  --quote: #E6EDF5;
  --sparkle: #D9D9D9;
  --watermark: #121212;
  --nav-sep: rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Abhaya Libre", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0;
  transition: opacity 0.6s ease;
}
body.is-loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; opacity: 1; }
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
  border-radius: 2px;
}

h1, h2, p { font-weight: inherit; }

/* ===== NAV TOP ===== */
.nav-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  z-index: 10;
  font-size: 18px;
  line-height: 1.2;
  pointer-events: none;
}
.nav-top > * { pointer-events: auto; }
.nav-top .nav-name { font-weight: 400; }

/* ===== HERO ===== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.constellation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(0, 0, 0) translate(-50%, -50%);
  width: min(60vmin, 750px);
  height: min(60vmin, 750px);
  pointer-events: none;
  will-change: transform;
}
.constellation canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg);
  height: clamp(20px, 3.2vmin, 30px);
  pointer-events: none;
}
.hero-title .letter {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hero-title .letter svg {
  height: 100%;
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* invisible hit-box expanding hover target without affecting layout */
.hero-title .letter::before {
  content: "";
  position: absolute;
  inset: -14px -6px;
}

@media (hover: hover) and (pointer: fine) {
  .hero-title .letter {
    pointer-events: auto;
    cursor: none;
  }
}

/* ===== NAV BOTTOM ===== */
.nav-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  font-size: 18px;
  line-height: 1.2;
  z-index: 2;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-sep {
  width: 1px;
  height: 10px;
  background: var(--nav-sep);
}
.nav-eyes {
  display: inline;
  font-weight: 400;
}
.nav-eyes a { display: inline; }

/* ===== MANIFESTO ===== */
.manifesto {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
}
.manifesto p {
  max-width: 880px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 1.2px;
  line-height: 1.2;
  text-align: center;
  color: var(--fg);
}

/* ===== QUOTE ===== */
.quote {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  gap: 20px;
}
.sparkle {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--sparkle);
}
.sparkle svg {
  width: 100%;
  height: 100%;
  display: block;
}
.quote h2 {
  max-width: 880px;
  font-size: 50px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--quote);
}

/* ===== WATERMARK (MİSEKA) ===== */
.watermark {
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0 20px;
  margin-top: -40px;
}
.watermark::before {
  content: "MİSEKA";
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: clamp(76px, 18.3vw, 246px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--watermark);
  text-align: center;
  letter-spacing: 0;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

/* ===== EYES PAGE ===== */
.page-eyes { background: var(--bg); }

.eyes-main {
  padding: 100px 20px 40px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyes-heading {
  font-family: "Abhaya Libre", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--fg);
  text-transform: uppercase;
  margin-bottom: 32px;
  width: 100%;
  max-width: 750px;
  text-align: left;
}

.eyes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}
.eyes-grid figure { margin: 0; line-height: 0; }
.eyes-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.eyes-year {
  font-family: "Abhaya Libre", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--fg);
  margin-top: 48px;
  width: 100%;
  max-width: 750px;
  text-align: left;
  letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-top,
  .nav-bottom {
    padding: 20px;
    font-size: 16px;
  }
  .manifesto { padding: 60px 24px; }
  .manifesto p {
    font-size: 16px;
    letter-spacing: 0.8px;
  }
  .quote { padding: 60px 24px; }
  .quote h2 { font-size: 32px; }
  .sparkle { width: 24px; height: 24px; }
  .eyes-main { padding: 80px 16px 32px; }
  .eyes-grid { gap: 2px; }
}

@media (max-width: 480px) {
  .nav-top,
  .nav-bottom {
    padding: 16px;
    font-size: 14px;
  }
  .nav-group { gap: 8px; }
  .manifesto p {
    font-size: 15px;
    letter-spacing: 0.6px;
  }
  .quote h2 { font-size: 26px; }
  .hero-title { gap: 8px; }
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("/assets/textures/grain.png");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.25;
  z-index: 1;
  mix-blend-mode: overlay;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .grain-overlay { transition: none; }
}

/* ===== HOVER VIDEO PREVIEW ===== */
.nav-group.has-preview { position: relative; }

.hover-preview {
  position: absolute;
  bottom: calc(100% + 24px);
  right: 0;
  width: 200px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 5;
  border-radius: 2px;
}

.has-preview:hover .hover-preview,
.has-preview:focus-within .hover-preview {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (hover: none), (max-width: 768px) {
  .hover-preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hover-preview { transition: opacity 0.2s ease; transform: none; }
  .has-preview:hover .hover-preview,
  .has-preview:focus-within .hover-preview { transform: none; }
}

/* ===== CUSTOM CURSOR ===== */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  transition: opacity 0.2s ease, background-color 0.3s ease;
  will-change: transform, opacity;
  overflow: hidden;
}
.cursor-dot.is-visible { opacity: 1; }
.cursor-dot.is-lens { background: #000; }
.cursor-dot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.cursor-dot.is-lens .cursor-dot-img { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  html.has-custom-cursor,
  html.has-custom-cursor body,
  html.has-custom-cursor a,
  html.has-custom-cursor button {
    cursor: none;
  }
}

/* ===== A11Y: Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
  /* Constellation script handles motion reduction — static render */
  /* Cursor script disables lerp smoothing */
}

@media not (hover: hover), (pointer: coarse) {
  .cursor-dot { display: none; }
}
