/* Abrar Zahin portfolio v2 - monochrome editorial, reference-driven.
   Palette: near-black surfaces, bone type. Shape: pill buttons, 24px cards. */

@font-face { font-family: 'Anton'; src: url('../fonts/anton-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('../fonts/archivo-black.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('../fonts/archivo-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Gantari'; src: url('../fonts/gantari-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Gantari'; src: url('../fonts/gantari-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Gantari'; src: url('../fonts/gantari-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0F1013;
  --bg-2: #13141A;
  --card: #181A21;
  --bone: #E8E5DE;
  --muted: #A3A19A;
  --line: rgba(232, 229, 222, 0.1);
  --display: 'Anton', 'Arial Narrow', sans-serif;
  --wide: 'Archivo', 'Arial', sans-serif;
  --body: 'Gantari', system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--bone); color: var(--bg); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.loader-line {
  font-family: var(--wide); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: clamp(1rem, 2.4vw, 1.6rem);
  color: var(--bone);
}
html:not(.js) .loader, html:not(.motion-ok) .loader { display: none; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.5;
  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.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 96; pointer-events: none; }
.progress span {
  display: block; height: 100%; background: var(--bone); opacity: 0.9;
  transform: scaleX(0); transform-origin: left center; will-change: transform;
}

/* ---------- cursor dot ---------- */
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 95;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bone); mix-blend-mode: difference;
  pointer-events: none; opacity: 0;
  transform: translate(-50%, -50%);
}
@media (hover: none), (prefers-reduced-motion: reduce) { .cursor-dot { display: none; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 3.5vw, 48px);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--body); font-weight: 500; font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  color: var(--bone); background: rgba(15, 16, 19, 0.4);
  border: 1px solid rgba(232, 229, 222, 0.35); border-radius: 6px;
  padding: 10px 18px; white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, transform 0.2s var(--ease);
  will-change: transform;
}
.pill-btn:hover { background: var(--bone); color: var(--bg); }
.pill-btn:active { transform: scale(0.97); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  text-decoration: none; font-size: 0.95rem; font-weight: 500; color: var(--bone);
  opacity: 0.85; transition: opacity 0.25s;
}
.nav-links a:hover { opacity: 1; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden; padding: 90px 20px 40px;
}
.hero-bg { position: absolute; inset: -10%; z-index: 0; filter: blur(70px); }
.blob { position: absolute; border-radius: 50%; background: rgba(232, 229, 222, 0.10); will-change: transform; }
.blob-a { width: 44vw; height: 30vw; top: 6%; left: -6%; }
.blob-b { width: 36vw; height: 26vw; top: 42%; right: -4%; background: rgba(232, 229, 222, 0.08); }
.blob-c { width: 30vw; height: 30vw; bottom: -8%; left: 26%; background: rgba(232, 229, 222, 0.06); }
@media (prefers-reduced-motion: no-preference) {
  html.motion-ok .blob-a { animation: drift-a 16s ease-in-out infinite alternate; }
  html.motion-ok .blob-b { animation: drift-b 20s ease-in-out infinite alternate; }
  html.motion-ok .blob-c { animation: drift-c 24s ease-in-out infinite alternate; }
}
@keyframes drift-a { to { transform: translate(10vw, 8vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-8vw, -6vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(6vw, -8vh) scale(1.1); } }

/* Curved 3D gallery arc across the top of the hero (positions set by JS) */
.hero-gallery {
  position: absolute; z-index: 1;
  top: clamp(64px, 10vh, 110px); left: 50%;
  width: 0; height: 0;
}
html:not(.js) .hero-gallery, html:not(.motion-ok) .hero-gallery { display: none; }
.hg-panel {
  position: absolute; left: 0; top: 0;
  aspect-ratio: 3 / 2;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  will-change: transform;
}
.hg-panel img { width: 100%; height: 100%; object-fit: cover; }
html.js.motion-ok .hg-panel { opacity: 0; }

.hero-name {
  margin-top: clamp(48px, 10vh, 120px);
  position: relative; z-index: 1;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(5rem, 17vw, 15.5rem);
  line-height: 0.86; text-align: center;
  letter-spacing: 0.01em; text-transform: none;
  color: var(--bone);
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-name .line-inner { display: inline-block; will-change: transform; }
.hero-name .line-two { margin-top: -0.05em; }

.hero-avatar-wrap {
  position: absolute; z-index: 2;
  left: 50%; top: calc(50% + 6vh);
  width: clamp(110px, 16vw, 190px);
  margin-left: calc(clamp(110px, 16vw, 190px) / -2);
  margin-top: calc(clamp(110px, 16vw, 190px) / -2);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  will-change: transform;
}
.hero-avatar { width: 100%; height: auto; filter: grayscale(1); }
.hero-avatar-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; top: -40%;
  height: 34%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(232, 229, 222, 0.22), transparent);
}
html.motion-ok .hero-avatar-wrap::after { animation: holo-scan 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes holo-scan { 0% { transform: translateY(0); } 55%, 100% { transform: translateY(420%); } }

.hero-meta {
  position: absolute; z-index: 3;
  left: 0; right: 0; bottom: 34px;
  display: flex; justify-content: space-between; gap: 24px;
  padding: 0 clamp(20px, 3.5vw, 48px);
}
.hero-meta p { max-width: 300px; font-size: 0.95rem; color: var(--bone); opacity: 0.9; }
.hero-meta p + p { text-align: right; }

/* ---------- about / statement ---------- */
.about { background: var(--bg-2); padding: clamp(96px, 13vw, 180px) clamp(20px, 6vw, 96px); }
.statement {
  font-family: var(--wide); font-weight: 700;
  font-size: clamp(2.2rem, 6.2vw, 5.4rem);
  line-height: 1.02; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--bone);
  max-width: 1200px;
}
.st-line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.st-inner { display: inline-block; will-change: transform; }

.about-grid {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: clamp(40px, 6vw, 110px);
  max-width: 1200px; margin-top: clamp(48px, 6vw, 88px);
}
.about-copy p { color: var(--bone); opacity: 0.92; max-width: 56ch; }
.about-copy p + p { margin-top: 22px; }
.tool-group + .tool-group { margin-top: 34px; }
.tool-group h3 {
  font-family: var(--wide); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.02em; margin-bottom: 8px;
}
.tool-group p { color: var(--muted); font-size: 0.95rem; }

/* ---------- editorial photo pair ---------- */
.photo-row {
  display: grid; grid-template-columns: 1fr 1.7fr;
  gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(56px, 7vw, 110px);
  align-items: start;
}
.photo-row figure {
  margin: 0; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
}
.photo-a { aspect-ratio: 4 / 5; }
.photo-b { aspect-ratio: 3 / 2; margin-top: clamp(36px, 6vw, 90px); }
.photo-row img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  .photo-row { grid-template-columns: 1fr; }
  .photo-b { margin-top: 0; }
}

/* ---------- full-width parallax banners ---------- */
.banner {
  overflow: hidden; position: relative;
  height: clamp(300px, 56vh, 620px);
}
.banner img {
  width: 100%; height: 125%; object-fit: cover;
  will-change: transform;
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; padding: 26px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.marquee-track { display: flex; width: max-content; }
html.motion-ok .marquee-track { animation: marquee 30s linear infinite; }
.marquee-group { display: flex; flex-shrink: 0; }
.marquee-group span {
  font-family: var(--wide); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.95rem; color: var(--muted);
  padding: 0 34px; white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }
html:not(.motion-ok) .marquee-track { flex-wrap: wrap; width: auto; justify-content: center; }
html:not(.motion-ok) .marquee-group:last-child { display: none; }

/* ---------- big section headers ---------- */
.big-head { text-align: center; padding: 0 20px; }
.big-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: 1; color: var(--bone);
  overflow: hidden; display: block;
}
.bt-inner { display: inline-block; will-change: transform; }
.big-caption {
  font-family: var(--body); font-weight: 500;
  font-size: 0.85rem; letter-spacing: 0.14em;
  color: var(--muted); max-width: 52ch;
  margin: 20px auto 0;
}

/* ---------- projects ---------- */
.work { background: var(--bg); padding: clamp(96px, 13vw, 180px) 0 40px; }
.cards { margin-top: clamp(48px, 7vw, 110px); display: grid; gap: clamp(28px, 4vw, 56px); padding: 0 clamp(16px, 3vw, 40px); }
.project-card {
  position: relative;
  width: min(1150px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.08fr 1fr; align-items: center;
  gap: clamp(28px, 4.5vw, 72px);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: clamp(24px, 4vw, 56px);
  will-change: transform;
}
.project-card::after {
  content: ''; position: absolute; inset: 0; border-radius: 24px;
  background: radial-gradient(640px circle at var(--mx, 50%) var(--my, 50%), rgba(232, 229, 222, 0.07), transparent 45%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.project-card:hover::after { opacity: 1; }
.project-card.is-flipped .project-media { order: 2; }
.project-media { border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 2; }
.project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s var(--ease);
  will-change: transform;
}
.project-card:hover .project-media img { transform: scale(1.05); }
.card-kicker {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.project-body h3 {
  font-family: var(--wide); font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  letter-spacing: 0.01em; line-height: 1.05;
}
.project-body p { color: var(--muted); margin-top: 18px; max-width: 46ch; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 26px; }
.tags li {
  font-family: var(--wide); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.1em; color: var(--bone);
}

/* ---------- rules ---------- */
.rules { background: var(--bg-2); padding: clamp(96px, 13vw, 180px) clamp(20px, 6vw, 96px); }
.rules-list { max-width: 900px; margin: clamp(48px, 6vw, 96px) auto 0; }
.rule-row { border-top: 1px solid var(--line); padding: clamp(28px, 4vw, 44px) 0; }
.rule-row:last-child { border-bottom: 1px solid var(--line); }
.rule-row h3 {
  font-family: var(--wide); font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.3rem); letter-spacing: 0.01em;
  transition: transform 0.4s var(--ease), opacity 0.4s;
}
.rule-row:hover h3 { transform: translateX(12px); }
.rule-row p { color: var(--muted); margin-top: 10px; max-width: 58ch; }

/* ---------- contact ---------- */
.contact {
  background: var(--bg); text-align: center;
  padding: clamp(110px, 15vw, 200px) 20px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; overflow: hidden;
}
.contact-bg {
  position: absolute; inset: 0; z-index: 0;
  opacity: 0.2; pointer-events: none;
}
.contact-bg img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.contact > *:not(.contact-bg) { position: relative; z-index: 1; }
.contact-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(5rem, 16vw, 14rem); line-height: 0.9;
  color: var(--bone);
}
.contact-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.contact-title .line-inner { display: inline-block; will-change: transform; }
.contact .pill-btn { margin-top: 44px; padding: 16px 34px; font-size: 0.95rem; border-radius: 8px; }
.pill-solid { background: var(--bone); color: var(--bg); border-color: var(--bone); }
.pill-solid:hover { background: #fff; color: var(--bg); }
.contact-email { margin-top: 18px; color: var(--muted); font-size: 0.92rem; letter-spacing: 0.04em; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px clamp(20px, 3.5vw, 48px);
  font-size: 0.8rem; letter-spacing: 0.12em; color: var(--muted);
}
.footer-name { font-family: var(--wide); font-weight: 700; color: var(--bone); letter-spacing: 0.16em; }
.footer a { color: var(--muted); text-decoration: none; transition: color 0.25s; }
.footer a:hover { color: var(--bone); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 1fr; gap: 22px; }
  .project-card.is-flipped .project-media { order: 0; }
  .hero-meta { flex-direction: column; gap: 10px; bottom: 22px; }
  .hero-meta p + p { text-align: left; }
  .hero-avatar-wrap { width: 108px; margin-left: -54px; margin-top: -54px; border-radius: 16px; }
  .nav-links { display: none; }
  .footer { flex-wrap: wrap; gap: 8px; }
}

/* ---------- char-split spans (added by JS) ---------- */
.ch { display: inline-block; will-change: transform; }

/* ---------- animation initial states (JS + motion only) ---------- */
html.js.motion-ok .hero-name .line-inner,
html.js.motion-ok .st-inner,
html.js.motion-ok .bt-inner,
html.js.motion-ok .contact-title .line-inner { transform: translateY(112%); }
html.js.motion-ok .hero-avatar-wrap { opacity: 0; }
html.js.motion-ok [data-intro] { opacity: 0; transform: translateY(20px); }
html.js.motion-ok [data-reveal] { opacity: 0; transform: translateY(30px); }
html.js.motion-ok [data-card] { opacity: 0; transform: translateY(56px) scale(0.98); }
