/* ============================================
   MINIMALIST EDITORIAL PORTFOLIO - DESIGN SYSTEM
   ============================================ */

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

:root {
  --bg: #fafafa;
  --bg-dark: #0e0e0e;
  --surface: #f2f2f0;
  --surface-dark: #1a1a1a;

  --text: #111111;
  --text-dark: #f0ede8;

  --muted: #777777;
  --muted-dark: #888888;

  --line: #e0ddd8;
  --line-dark: #2a2a2a;

  --accent: #b8956a;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 0.35s;

  --nav-h: 68px;
}

.dark {
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --text: var(--text-dark);
  --muted: var(--muted-dark);
  --line: var(--line-dark);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  cursor: none;
}

@media (hover: none) {
  body {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--speed) ease;
}

a:hover {
  opacity: 0.65;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: background 0.3s;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    border-color 0.3s, opacity 0.3s;
  opacity: 0.5;
}

.cursor-ring.hovered {
  width: 56px;
  height: 56px;
  opacity: 0.3;
}

/* ============================================
   SKIP NAV
   ============================================ */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.5rem;
  z-index: 9999;
  transition: top 0.3s;
}

.skip-nav:focus {
  top: 0;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.dark .nav.scrolled {
  background: rgba(14, 14, 14, 0.88);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  opacity: 1;
  transition: opacity var(--speed);
}

.nav-logo:hover {
  opacity: 0.6;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--speed);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--speed) var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  opacity: 1;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dark mode toggle */
#dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: none;
  padding: 0.4rem;
  border-radius: 50%;
  transition: background-color var(--speed), transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#dark-mode-toggle:hover {
  background-color: rgba(128, 128, 128, 0.12);
  transform: scale(1.1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 0.4rem;
  width: 36px;
  height: 36px;
}

.hamburger span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.2s;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-overlay ul {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.mobile-nav-link {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 300;
  color: var(--text);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color var(--speed);
}

.mobile-overlay.open .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-overlay.open .mobile-nav-link:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-overlay.open .mobile-nav-link:nth-child(2) {
  transition-delay: 0.18s;
}

.mobile-overlay.open .mobile-nav-link:nth-child(3) {
  transition-delay: 0.26s;
}

.mobile-nav-link:hover {
  color: var(--muted);
  opacity: 1;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--bg);
  padding-top: var(--nav-h);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0 5%;
  max-width: 1000px;
  animation: heroFadeIn 1.6s var(--ease) both;
}

.hero-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 500;
}

.hero-name {
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--text);
  font-family: var(--font-display);
}

.hero-subtext {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 500px;
  line-height: 1.8;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Cue */
.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: heroFadeIn 1s var(--ease) 1.2s both;
  transition: opacity var(--speed);
}

.scroll-cue:hover {
  opacity: 0.5 !important;
}

.scroll-cue-line {
  display: block;
  width: 1px;
  height: 48px;
  background: var(--muted);
  animation: scrollLine 1.8s var(--ease) infinite;
  transform-origin: top;
}

.scroll-cue-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-family: var(--font-body);
}

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
    opacity: 1;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* ============================================
   SECTION GENERAL
   ============================================ */
section {
  padding: 6rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================
   PORTFOLIO
   ============================================ */
.portfolio {
  padding-top: 4rem;
  padding-bottom: 6rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: none;
  background: none;
  border: none;
  padding: 0;
  display: block;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger */
.portfolio-item:nth-child(3n+1).visible {
  transition-delay: 0.05s;
}

.portfolio-item:nth-child(3n+2).visible {
  transition-delay: 0.15s;
}

.portfolio-item:nth-child(3n+3).visible {
  transition-delay: 0.25s;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
  display: block;
  transition: transform 0.65s var(--ease);
}

.portfolio-item:hover img {
  transform: scale(1.04);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  border-top: 1px solid var(--line);
  padding: 6rem 5%;
}

.about-inner {
  max-width: 760px;
}

.about-inner .section-label {
  margin-bottom: 2rem;
}

.about-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 3.5rem;
}

.about-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--line);
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 6rem 5% 8rem;
}

.contact .section-label {
  margin-bottom: 2rem;
}

.contact-text {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 300;
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: background var(--speed), border-color var(--speed),
    color var(--speed), transform var(--speed) var(--ease);
}

.contact-pill:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  opacity: 1;
  transform: translateY(-2px);
}

.contact-pill svg {
  flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  text-align: center;
  padding: 2.5rem 5%;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================
   BACK TO TOP
   ============================================ */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background-color: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: all var(--speed) var(--ease);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.visible {
  opacity: 0.75;
  visibility: visible;
}

#back-to-top:hover {
  opacity: 1;
  transform: translateY(-4px);
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.96);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.open {
  opacity: 1;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.4s var(--ease);
  border-radius: 2px;
}

.lightbox.open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: none;
  padding: 0.5rem;
  display: flex;
  transition: color 0.2s, transform 0.2s;
  border-radius: 50%;
}

.lightbox-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: none;
  padding: 1rem;
  display: flex;
  transition: color 0.2s, transform 0.25s;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-prev:hover {
  color: #fff;
  transform: translateY(-50%) translateX(-4px);
}

.lightbox-next:hover {
  color: #fff;
  transform: translateY(-50%) translateX(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}

@media (max-width: 600px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .about-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .stat-divider {
    display: none;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}