/* ─────────────────────────────────────────────
   styles.css  –  Deveney portfolio (homepage)
   ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Modak&display=swap');

/* ── Tokens ── */
:root {
  --bg:           #000;
  --fg:           #fff;
  --muted:        rgba(255, 255, 255, 0.75);
  --accent-color: #ff3f7b;
  --glass:        rgba(255, 255, 255, 0.06);
  --nav-height:   72px;
  --max-width:    1200px;
  --ease:         cubic-bezier(0.2, 0.9, 0.2, 1);
  --duration:     300ms;
}

[data-theme="light"] {
  --bg:    #fff;
  --fg:    #0b0b0b;
  --muted: rgba(11, 11, 11, 0.7);
  --glass: rgba(0, 0, 0, 0.04);
}

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

html, body { height: 100%; }

html { scroll-behavior: smooth; }

.work { scroll-margin-top: var(--nav-height); }

body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
  cursor: none;
}

a, button, input, label, select, textarea, [tabindex] { cursor: none !important; }

/* ── Material Symbols ── */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal; font-size: 18px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-smoothing: antialiased; font-feature-settings: "liga" 1;
}

/* ── Custom cursor ── */
#cursor-dot, #cursor-ring {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 9999; will-change: left, top;
}
#cursor-dot {
  width: 8px; height: 8px;
  background: var(--accent-color);
  mix-blend-mode: difference; opacity: 0; transition: opacity 200ms ease;
}
#cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: transparent; mix-blend-mode: difference; opacity: 0;
  transition: width 200ms var(--ease), height 200ms var(--ease),
              border-color 200ms ease, opacity 200ms ease;
}
body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring,
body:has(.liq-char:hover) #cursor-ring {
  width: 60px; height: 60px; border-color: var(--accent-color);
}
.cursor-trail {
  position: fixed; border-radius: 50%; pointer-events: none;
  z-index: 9998; background: var(--accent-color); will-change: left, top, opacity;
}

/* ── Nav ── */
.nav {
  position: fixed; inset: 0 0 auto; height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px; gap: 16px; z-index: 40;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent);
  transition: background var(--duration) var(--ease);
}
[data-theme="light"] .nav { background: linear-gradient(180deg, rgba(255,255,255,0), transparent); }

.logo { display: none; font-size: 0.95rem; font-weight: 700; letter-spacing: 2px; }
@media (min-width: 768px) { .logo { display: block; } }

.nav a {
  color: var(--fg); text-decoration: none;
  font-size: 0.95rem; letter-spacing: 1px; margin-left: 22px;
  transition: opacity 160ms var(--ease);
}
.nav a:hover { opacity: 0.6; }
@media (min-width: 768px) { header.nav nav { position: relative; left: -1.5%; } }

/* ── Nav controls ── */
.nav-controls {
  display: flex; align-items: center;
  border-radius: 999px; padding: 0.25rem 0.35rem; gap: 0.25rem;
}
.nav-controls button {
  background: transparent; border: none; padding: 0.45rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: background 0.25s ease;
}
.nav-controls button:hover { background: rgba(255, 255, 255, 0.15); }
.nav-controls .material-symbols-outlined { font-size: 1.35rem; }

.palette-btn { position: relative; transition: transform 160ms var(--ease); }
.palette-btn:active { transform: scale(0.96); }
.palette-btn::after {
  content: ''; position: absolute; bottom: 5px; right: 5px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--dot-color, var(--accent-color)); transition: background 200ms ease;
}

.theme-toggle .moon-icon { display: none; }
.theme-toggle .sun-icon  { display: inline-block; }
[data-theme="light"] .theme-toggle .sun-icon  { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: inline-block; }

/* ── Hero ── */
.hero {
  position: relative; height: 100vh; min-height: 640px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.bg-still, .bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.bg-video { transform: scale(1.05); transition: transform 1s var(--ease); will-change: transform; }
@media (min-width: 768px) { .hero-bg .bg-still { content: url("white.png"); } }

.hero-inner {
  position: relative; z-index: 5; width: 100%; max-width: var(--max-width);
  margin: 0 auto; padding: 0 20px; text-align: center;
}
.headline {
  display: block; width: 100%;
  font-family: 'Modak', cursive; font-size: clamp(64px, 18vw, 240px);
  color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,0.03);
  will-change: transform, opacity; transform-origin: center; transition: opacity 60ms linear;
  
}
.liq-char {
  display: inline-block; color: inherit; will-change: transform, color; pointer-events: auto;
  transition: transform 220ms cubic-bezier(0.15, 1.4, 0.4, 1), color 220ms linear;
}
.scroll-indicator {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); z-index: 6;
  color: var(--muted); text-decoration: none; font-size: 0.95rem; letter-spacing: 2px;
}
.hero::after { display: none; }
#wave-fill-svg {
  position: absolute; bottom: 0; left: 0; width: 100%; z-index: 4;
  pointer-events: none; display: block; overflow: visible;
}

/* ── Work section ── */
.work { background-color: var(--accent-color); color: #000; transition: background-color 0s; }
.work-inner { max-width: var(--max-width); margin: 0 auto; padding: 80px 36px 100px; }
.work .section-title {
  color: #000; margin-bottom: 48px; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; opacity: 0.6;
}

/* ── Case list ── */
.case-list { display: flex; flex-direction: column; }

/* ── Case item ── */
.case-item {
  display: flex; align-items: center;
  gap: 32px; padding: 1.25rem; margin-bottom: 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.18); border-radius: 18px;
  background: #fff; text-decoration: none; color: #000;
  height: 200px; overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.case-item:last-child { border-bottom: 1px solid rgba(0,0,0,0.18); }
.case-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

/* ── Case number — light accent tint, vertically centered ── */
.case-num {
  flex: 0 0 auto; font-size: 0.72rem; font-weight: 600; letter-spacing: 2px;
  min-width: 2.5rem; text-align: right; margin-right: 0.75rem; align-self: center;
  color: color-mix(in srgb, var(--accent-color) 38%, #fff 62%);
}

/* ── Body text ── */
.case-item-body {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-self: center;
}

/* ── Title — slow dragged colour wipe from left to right ── */
.case-item-title {
  font-family: 'Modak', cursive;
  font-size: clamp(28px, 4vw, 52px); line-height: 1; letter-spacing: -0.5px;
  position: relative; display: inline-block;
  background-image: linear-gradient(
    to right,
    var(--accent-color)   0%,
    var(--accent-color)  55%,
    transparent          85%,
    transparent         100%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: currentColor;
  color: #000;
  animation: none;
}
.case-item:hover .case-item-title {
  -webkit-text-fill-color: transparent;
  animation: title-drag 0.75s cubic-bezier(0.25, 0.1, 0.1, 1) forwards;
}
@keyframes title-drag {
  from { background-position: 100% 0; }
  to   { background-position:   0% 0; }
}

.case-item-tags { font-size: 0.78rem; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.5; }

/* ── Image wrap ── */
.case-item-img-wrap {
  flex: 0 0 220px; width: 220px; height: 100%; border-radius: 12px; overflow: hidden;
  transition: flex-basis 0.45s var(--ease), width 0.45s var(--ease);
}
.case-item:hover .case-item-img-wrap { flex-basis: 33%; width: 33%; }
.case-item-img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transform: scale(1);
  transition: opacity 260ms ease, transform 360ms var(--ease);
}
.case-item:hover .case-item-img { opacity: 1; transform: scale(1.04); }

/* ── About / Contact ── */
.about, .contact { max-width: var(--max-width); margin: 0 auto; padding: 80px 36px; }
.section-title { margin-bottom: 28px; font-size: 1.25rem; font-weight: 700; letter-spacing: 2px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 600px; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
}
.reveal.visible { opacity: 1; transform: translateX(0); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .bg-video { display: none; }
  body { cursor: auto; }
  a, button, input, label, select, textarea, [tabindex] { cursor: auto !important; }
  #cursor-dot, #cursor-ring, .cursor-trail { display: none; }
  .liq-char { display: inline !important; transform: none !important; transition: none !important; color: inherit !important; }
  .case-item { flex-wrap: nowrap; gap: 16px; height: auto; align-items: center; }
  .case-num { min-width: 28px; }
  .case-item-img-wrap { display: none; }
  .work-inner { padding: 60px 20px 80px; }
  .case-item-title,
  .case-item:hover .case-item-title {
    -webkit-text-fill-color: currentColor !important;
    background-image: none !important;
    animation: none !important;
  }
  :root:not([data-theme="dark"]) {
    --bg: #fff; --fg: #0b0b0b;
    --muted: rgba(11,11,11,0.7); --glass: rgba(0,0,0,0.04);
  }
}

@media (max-width: 900px) and (min-width: 769px) {
  .case-item { height: 160px; }
  .case-item-img-wrap { flex-basis: 140px; width: 140px; }
  .case-item:hover .case-item-img-wrap { flex-basis: 33%; width: 33%; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .case-item, .case-item-img, .case-item-img-wrap, .liq-char, .headline {
    transition: none !important; animation: none !important;
  }
  .case-item-title,
  .case-item:hover .case-item-title {
    -webkit-text-fill-color: currentColor !important;
    background-image: none !important;
    animation: none !important;
  }
  #cursor-dot, #cursor-ring, .cursor-trail { display: none; }
  body { cursor: auto; }
  a, button, input, label, select, textarea, [tabindex] { cursor: auto !important; }
}