/* ── Reset & tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0a0a;
  --bg-nav:       rgba(255,255,255,0.07);
  --bg-image:     url('bg.jpg.jpg');
  --glass-border: rgba(255,255,255,0.15);
  --glass-shadow: 0 4px 30px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
  --fg:           #ffffff;
  --fg-muted:     rgba(255,255,255,0.45);
  --accent:       #e63946;
  --font-ui:      'Inter', system-ui, sans-serif;
  --font-script:  'Pinyon Script', cursive;
  --nav-h:        64px;
  --transition:   0.35s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:           #f0ede8;
  --bg-nav:       rgba(255,255,255,0.35);
  --bg-image:     url('bg2.jpg.jpg');
  --glass-border: rgba(0,0,0,0.08);
  --glass-shadow: 0 4px 30px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
  --fg:           #0a0a0a;
  --fg-muted:     rgba(10,10,10,0.45);
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-weight: 300;
  overflow-x: hidden;
  cursor: none;
  transition: background var(--transition), color var(--transition);
}

/* ── Page transition overlay ── */
.page-overlay {
  position: fixed;
  inset: 0;
  background: var(--accent);
  z-index: 9000;
  transform: translateY(0);
  will-change: transform;
  pointer-events: none;
}

/* ── Custom cursor ── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease;
  will-change: transform;
  opacity: 0;
}

.cursor.cursor--active {
  width: 56px;
  height: 56px;
}

/* make all interactive elements hide system cursor too */
a, button { cursor: none; }

a { text-decoration: none; color: inherit; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav__logo { display: flex; align-items: center; }

.logo-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.nav__center {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.nav__link {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  transition: opacity var(--transition);
}
.nav__link:hover { opacity: 0.55; }

.nav__sep { color: var(--fg-muted); }

.nav__about { /* right-side link, no extra style needed */ }

/* ── HERO ── */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* background image */
.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  animation: bg-drift 18s ease-in-out infinite alternate;
  transform-origin: center;
  will-change: transform;
  transition: background-image 0s;
}

@keyframes bg-drift {
  0%   { transform: scale(1.08) translate(0%, 0%); }
  33%  { transform: scale(1.14) translate(-4%, 3%); }
  66%  { transform: scale(1.10) translate(3%, -3%); }
  100% { transform: scale(1.12) translate(-2%, 2%); }
}

/* vertical name */
.hero__name {
  position: absolute;
  left: 22px;
  top: 44%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--fg);
  z-index: 2;
}

/* headline */
.hero__headline {
  position: relative;
  z-index: 2;
  margin-left: clamp(60px, 8vw, 130px);
  left: -50px;
  margin-top: -4%;
  user-select: none;
}

.hero__script {
  font-family: var(--font-script);
  font-size: clamp(15rem, 1000vw, 9rem);
  font-weight: 400;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
}

.hero__dot {
  color: var(--accent);
}

.hero__rule {
  width: clamp(220px, 36vw, 420px);
  height: 1px;
  background: var(--fg-muted);
  margin-top: -20px;
  margin-bottom: 14px;
  margin-left: 350px;
}

.hero__sub {
  font-family: var(--font-ui);
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-left: 350px;
}

/* theme toggle — glass widget */
.theme-toggle {
  position: fixed;
  bottom: 8px;
  left: 5px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
[data-theme="light"] .theme-toggle:hover {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
}


/* bottom ticker */
.hero__ticker {
  position: fixed;
  bottom: 5px;
  left: 50%;
  right: 0;
  display: flex;
  align-items: baseline;
  gap: 0;
  z-index: 100;
  white-space: nowrap;
}

.hero__ticker-text {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.hero__ticker-period {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0;
  color: var(--fg-muted);
}

.hero__ticker-line {
  display: block;
  flex: 1;
  height: 1px;
  background: var(--fg-muted);
  transform-origin: left;
  animation: ticker-grow 3s ease-out forwards;
}

@keyframes ticker-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Entrance animations ── */
.hero__name span,
.hero__script,
.hero__rule,
.hero__sub {
  opacity: 0;
  animation: fade-up 0.9s var(--transition) forwards;
}

.hero__name span:nth-child(1) { animation-delay: 0.1s; }
.hero__name span:nth-child(2) { animation-delay: 0.22s; }
.hero__name span:nth-child(3) { animation-delay: 0.34s; }
.hero__script { animation-delay: 0.5s; }
.hero__rule   { animation-delay: 0.75s; }
.hero__sub    { animation-delay: 0.9s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .hero__rule {
    margin-left: clamp(60px, 18vw, 350px);
    width: clamp(140px, 28vw, 420px);
  }
  .hero__sub {
    margin-left: clamp(60px, 18vw, 350px);
  }
  .hero__headline {
    left: 0;
    margin-left: clamp(50px, 10vw, 130px);
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {

  /* Disable custom cursor on touch devices */
  .cursor { display: none; }
  body, a, button { cursor: auto; }

  /* Nav */
  .nav { padding: 0 14px; --nav-h: 54px; }
  .nav__center { display: flex; }
  .nav__link { font-size: 0.78rem; }
  .logo-icon { width: 30px; height: 30px; }

  /* Hero */
  .hero { align-items: flex-start; padding-top: calc(var(--nav-h) + 60px); }

  .hero__name {
    font-size: 22px;
    left: 10px;
    top: calc(var(--nav-h) + 25px + 15vw);
    gap: 2px;
  }

  .hero__headline {
    margin-left: 44px;
    left: 0;
    margin-top: 0;
  }

  .hero__script {
    font-size: clamp(4rem, 22vw, 7rem);
    white-space: normal;
  }

  .hero__rule {
    margin-left: 0;
    width: 70vw;
    margin-top: 8px;
  }

  .hero__sub {
    margin-left: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  /* Ticker */
  .hero__ticker {
    left: 2%;
    bottom: 50px;
  }

  .hero__ticker-text,
  .hero__ticker-period {
    font-size: 0.68rem;
  }

  /* Theme toggle */
  .theme-toggle {
    bottom: 14px;
    left: 10px;
    font-size: 0.7rem;
    padding: 5px 12px;
  }
}
