/* ============================================================
   John Carlo Pattaguan — Portfolio
   Immersive 3D & motion design (editorial dark)
   ============================================================ */

:root {
  --bg: #0a0a0c;
  --bg-soft: #101014;
  --text: #ececee;
  --text-muted: #8a8a92;
  --accent: #e8a849;
  --border: rgba(255, 255, 255, 0.09);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}
html.lenis { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--text); text-decoration: none; }

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.container-wide {
  width: min(1360px, 94%);
  margin-inline: auto;
}

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

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}
.preloader.done { transform: translateY(-100%); }

.preloader-name {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.preloader-count {
  position: absolute;
  right: 5vw;
  bottom: 4vh;
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

/* ---------- Custom cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
}
.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(232, 168, 73, 0.55);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s;
}
.cursor-ring.grow {
  width: 72px;
  height: 72px;
  border-color: rgba(232, 168, 73, 0.9);
}
@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.045;
  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.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 600;
  background: var(--accent);
  color: #0a0a0c;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.site-header.scrolled {
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #58c96a;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.nav-menu {
  display: flex;
  gap: 34px;
  list-style: none;
}
.nav-link {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.25s;
}
.nav-link sup {
  font-size: 0.6em;
  color: var(--accent);
  margin-right: 5px;
}
.nav-link:hover,
.nav-link.active { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-bottom: 7vh;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 140px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3vh;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7.6vw, 7rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 7vh;
  text-wrap: balance;
}

.line {
  display: block;
  overflow: hidden;
}
.line-inner {
  display: block;
  will-change: transform;
}
.js .line-inner { transform: translateY(115%); }
.no-js .line-inner,
.lines-done .line-inner { transform: none; }

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: clamp(24px, 5vw, 72px);
  flex-wrap: wrap;
}
.stat {
  display: grid;
  gap: 6px;
  max-width: 200px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 18px 30px;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.hero-cta svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.hero-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0a0c;
}
.hero-cta:hover svg { transform: translateY(4px); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding: 22px 0;
  background: var(--bg-soft);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 44px;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.marquee-track i {
  color: var(--accent);
  font-style: normal;
  font-size: 1rem;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Sections (shared) ---------- */
.section { padding: clamp(100px, 14vh, 170px) 0; position: relative; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: clamp(40px, 7vh, 80px);
}
.section-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.section-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.4vw, 4.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.section-lede {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 620px;
  margin-bottom: 48px;
}

/* ---------- About ---------- */
.about-statement {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.9rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 1080px;
  margin-bottom: clamp(40px, 7vh, 72px);
  text-wrap: balance;
}
.about-statement strong { color: var(--accent); font-weight: 600; }

.about-detail {
  max-width: 640px;
  margin-left: auto;
}
.about-detail p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
}

/* ---------- WordPress rows ---------- */
.wp-rows { border-top: 1px solid var(--border); }

.wp-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr;
  gap: 32px;
  align-items: start;
  padding: 44px 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.35s, padding-left 0.35s var(--ease);
}
.wp-row:hover {
  background: rgba(255, 255, 255, 0.025);
  padding-left: 28px;
}

.wp-row-num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 8px;
}
.wp-row-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
}
.wp-row-text {
  color: var(--text-muted);
  font-size: 0.98rem;
}
.wp-row-text p + p,
.wp-row-text p + ul,
.wp-row-text ul + p { margin-top: 14px; }
.wp-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wp-list li {
  padding-left: 16px;
  position: relative;
}
.wp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.wp-row-text strong { color: var(--text); font-weight: 600; }
.wp-row-text a {
  color: var(--accent);
  border-bottom: 1px solid rgba(232, 168, 73, 0.35);
}
.wp-row-text a:hover { border-bottom-color: var(--accent); }

.wp-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.pill {
  font-family: var(--font-display);
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}
.pill-lg { padding: 16px 34px; }

/* ---------- Photography ---------- */
.photography { background: var(--bg-soft); border-block: 1px solid var(--border); }

.album-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.album-tab {
  font-family: var(--font-display);
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.album-tab:hover { border-color: var(--accent); color: var(--text); }
.album-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0c;
  font-weight: 600;
}

.gallery-status {
  color: var(--text-muted);
  font-size: 0.95rem;
  min-height: 1.4em;
  margin-bottom: 18px;
}
.gallery-status a { color: var(--accent); }
.gallery-status .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gallery-grid {
  columns: 3 320px;
  column-gap: 18px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background: #16161c;
  border: 0;
  padding: 0;
  width: 100%;
  display: block;
}
.gallery-item img {
  width: 100%;
  transition: transform 0.6s var(--ease), opacity 0.6s, filter 0.6s;
  opacity: 0;
}
.gallery-item img.loaded { opacity: 1; }
.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.08);
}
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.5), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.gallery-item:hover::after { opacity: 1; }

.gallery-more { margin-top: 52px; text-align: center; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(6, 6, 8, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  max-width: 90vw;
  max-height: 88vh;
  text-align: center;
}
.lightbox-figure img {
  max-width: 90vw;
  max-height: 82vh;
  margin-inline: auto;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-figure figcaption {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 14px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.25s, color 0.25s;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: var(--accent); color: #0a0a0c; }
.lightbox-close { top: 22px; right: 22px; }
.lightbox-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 22px; top: 50%; transform: translateY(-50%); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(60px, 8vh, 110px); }

.contact-giant {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10.5vw, 9.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: clamp(40px, 7vh, 70px);
  transition: color 0.3s;
}
.contact-arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.4s var(--ease);
}
.contact-giant:hover .contact-arrow { transform: translateX(4%) rotate(-45deg); }

.contact-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}
.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.25s;
}
.contact-email:hover { color: var(--accent); }

.social-links {
  display: flex;
  gap: 26px;
  list-style: none;
  flex-wrap: wrap;
}
.social-links a {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.25s;
}
.social-links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 40px;
  background: var(--bg-soft);
  overflow: hidden;
}
.footer-brand {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 16rem);
  font-weight: 700;
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: -0.04em;
  user-select: none;
  margin-bottom: 24px;
}
.footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-loc { text-align: center; }
.back-to-top {
  font-family: var(--font-display);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: color 0.25s;
}
.back-to-top:hover { color: var(--accent); }

/* ---------- Fade reveal fallback ---------- */
[data-fade] { will-change: transform, opacity; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .wp-row { grid-template-columns: 48px 1fr; }
  .wp-row-text { grid-column: 2; }
  .section { padding: 90px 0; }
  .nav-status { display: none; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--header-h);
    right: 0;
    flex-direction: column;
    gap: 0;
    width: min(300px, 80vw);
    height: calc(100vh - var(--header-h));
    background: rgba(12, 12, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    padding: 22px 0;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu li { width: 100%; }
  .nav-menu .nav-link { display: block; padding: 18px 30px; font-size: 1.05rem; }

  .hero-foot { flex-direction: column; align-items: flex-start; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .line-inner { transform: none; }
  .grain, .marquee-track { animation: none !important; }
  .cursor-dot, .cursor-ring { display: none; }
  .preloader { display: none !important; }
}
