/* ==========================================================================
   Zara — Sarachchandra Seneviratne · Portfolio
   Elegant editorial theme · light + dark · dependency-free
   ========================================================================== */

:root {
  --bg:          #faf7f1;
  --bg-elev:     #ffffff;
  --bg-sunken:   #f2ede3;
  --text:        #1c1813;
  --text-muted:  #6b6154;
  --line:        #e2d9c9;
  --accent:      #9a7233;
  --accent-soft: #b98f47;
  --shadow:      0 18px 50px -24px rgba(60, 44, 20, .35);
  --maxw:        1180px;
  --serif:       "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:        system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg:          #13100b;
  --bg-elev:     #1d1811;
  --bg-sunken:   #0d0b07;
  --text:        #ede6d8;
  --text-muted:  #9c9284;
  --line:        #2e2619;
  --accent:      #d0a75f;
  --accent-soft: #b98f47;
  --shadow:      0 22px 60px -28px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: .01em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}

.section { padding: clamp(64px, 11vw, 140px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 6vw, 64px); }
.section-head h2 { font-size: clamp(2.4rem, 6vw, 4rem); }
.section-head p { color: var(--text-muted); font-size: 1.12rem; margin: 18px 0 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.brand { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; letter-spacing: .16em; }
.brand span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.nav a.navlink {
  font-size: 14px; letter-spacing: .04em; color: var(--text-muted);
  position: relative; padding: 4px 0; transition: color .25s;
}
.nav a.navlink::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width .3s ease;
}
.nav a.navlink:hover { color: var(--text); }
.nav a.navlink:hover::after { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: background .25s, border-color .25s, transform .2s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(120px, 20vh, 200px); padding-bottom: clamp(60px, 9vw, 110px); overflow: hidden; }
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 78%, transparent 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; position: relative; z-index: 1; }

/* split-text hero */
.split .word { display: inline-block; will-change: transform; }
.split .word.accent { font-style: italic; color: var(--accent); }
.hero h1 { font-size: clamp(3rem, 9vw, 6.4rem); line-height: .98; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { font-size: clamp(1.15rem, 2.5vw, 1.5rem); color: var(--text-muted); margin: 26px 0 30px; max-width: 46ch; }
.hero .tagline { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--accent); margin-bottom: 8px; }

.figure-frame {
  position: relative; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
}
.figure-frame img { width: 100%; height: 100%; object-fit: cover; }
.figure-frame::after {
  content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  border-radius: 6px; pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  padding: 15px 30px; border-radius: 2px; cursor: pointer; border: 1px solid var(--accent);
  transition: background .3s, color .3s, transform .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Marquee accolades ---------- */
.accolades { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-sunken); overflow: hidden; }
.accolades .track { display: flex; gap: 60px; padding: 20px 0; white-space: nowrap; animation: slide 38s linear infinite; }
.accolades span { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--text-muted); }
.accolades span::before { content: "✦"; color: var(--accent); margin-right: 60px; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .accolades .track { animation: none; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.about-portrait { border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 100px; background: var(--bg-elev); border: 1px solid var(--line); }
.about-portrait img { width: 100%; height: auto; display: block; }
.about-body p { color: var(--text-muted); margin: 0 0 20px; }
.about-body p.intro { font-family: var(--serif); font-size: 1.5rem; line-height: 1.4; color: var(--text); font-style: italic; }
.about-body .signature { max-width: 200px; margin-top: 12px; opacity: .9; }
:root[data-theme="dark"] .about-body .sig-dark { display: none; }
:root:not([data-theme="dark"]) .about-body .sig-light { display: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 40px 0; }
.stat { border-left: 2px solid var(--accent); padding-left: 16px; }
.stat b { font-family: var(--serif); font-size: 2.6rem; display: block; line-height: 1; color: var(--text); }
.stat small { color: var(--text-muted); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Featured video (dedicated section) ---------- */
.watch { background: var(--bg-sunken); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.watch .section-head { margin-left: auto; margin-right: auto; text-align: center; }
.video-block { max-width: 980px; margin: 0 auto; }
.video-shell {
  position: relative; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 16/9; background: #000; cursor: pointer;
}
.video-shell img { width: 100%; height: 100%; object-fit: cover; opacity: .78; transition: opacity .3s, transform .6s; }
.video-shell:hover img { opacity: .6; transform: scale(1.03); }
.video-shell video { width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.video-shell.playing img, .video-shell.playing .play, .video-shell.playing .watch-badge { display: none; }
.video-shell.playing video { display: block; }
.play {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 92%, black); color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center; transition: transform .25s, background .25s;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2.4s infinite;
}
.play:hover { transform: scale(1.08); animation-play-state: paused; }
.play svg { width: 34px; height: 34px; margin-left: 5px; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 26px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .play { animation: none; } }
.watch-badge {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 40px;
  background: color-mix(in srgb, var(--bg) 65%, transparent); backdrop-filter: blur(8px);
  color: var(--text); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
}
.watch-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e0483d; box-shadow: 0 0 0 0 rgba(224,72,61,.6); animation: blink 1.6s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.video-cap { color: var(--text-muted); font-size: 1rem; margin-top: 20px; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; }

/* ---------- Gallery ---------- */
.gallery { columns: 3; column-gap: 16px; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; border-radius: 4px; overflow: hidden; position: relative; cursor: zoom-in; box-shadow: var(--shadow); }
.gallery img { width: 100%; transition: transform .6s ease, filter .4s; filter: saturate(.96); }
.gallery figure::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,14,4,.5), transparent 55%);
  opacity: 0; transition: opacity .35s;
}
.gallery figure:hover img { transform: scale(1.05); filter: saturate(1.05); }
.gallery figure:hover::after { opacity: 1; }

/* ---------- Categories ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  transition: transform .35s, box-shadow .35s, border-color .35s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.card .thumb { aspect-ratio: 3/2; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .thumb img { transform: scale(1.06); }
.card .body { padding: 26px 26px 30px; }
.card h3 { font-size: 1.7rem; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: .98rem; margin: 0; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-sunken); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 80px); }
.contact h2 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 24px; }
.contact-detail { margin-bottom: 26px; }
.contact-detail .label { text-transform: uppercase; letter-spacing: .2em; font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.contact-detail a, .contact-detail address { font-style: normal; font-size: 1.25rem; font-family: var(--serif); color: var(--text); }
.contact-detail a:hover { color: var(--accent); }
.socials { display: flex; gap: 14px; margin-top: 10px; }
.socials a {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; transition: background .25s, border-color .25s, color .25s, transform .2s;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-3px); }
.socials svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--line); text-align: center; color: var(--text-muted); font-size: .9rem; }
.site-footer .brand { font-size: 1.2rem; display: block; margin-bottom: 8px; color: var(--text); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(8,6,3,.92);
  display: none; place-items: center; padding: 4vw; backdrop-filter: blur(4px);
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 4px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox .lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .25s;
}
.lightbox .lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-prev { left: 3vw; } .lb-next { right: 3vw; }
.lb-close { top: 4vw; right: 4vw; transform: none; }
.lightbox svg { width: 24px; height: 24px; }

/* ---------- Reveal on scroll (fallback; GSAP drives when present) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Custom cursor (desktop, fine pointer only) ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; opacity: 0; transition: opacity .3s, width .25s, height .25s, background .25s, border-color .25s; }
body.cursor-ready .cursor-dot, body.cursor-ready .cursor-ring { opacity: 1; }
.cursor-dot { width: 7px; height: 7px; background: #fff; transform: translate(-50%, -50%); }
.cursor-ring { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.6); transform: translate(-50%, -50%); transition: width .25s, height .25s, background .25s, border-color .25s; }
.cursor-ring.hover { width: 62px; height: 62px; background: rgba(255,255,255,.12); border-color: transparent; }
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button, body.has-cursor .video-shell, body.has-cursor .gallery figure { cursor: none; }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* magnetic elements set their own transform via JS */
.magnetic { will-change: transform; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .figure-frame { max-width: 360px; margin: 8px auto 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 360px; }
  .gallery { columns: 2; }
  .cards { grid-template-columns: 1fr; max-width: 460px; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav .navlink { display: none; }
  .menu-btn { display: grid; }
  .nav.open { position: fixed; inset: 0; background: var(--bg); flex-direction: column; justify-content: center; gap: 28px; z-index: 60; }
  .nav.open .navlink { display: block; font-size: 1.6rem; font-family: var(--serif); }
  .nav.open .menu-btn { position: absolute; top: 20px; right: 24px; }
}
@media (max-width: 560px) {
  .gallery { columns: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px; }
}
