/* =====================================================================
   Affan Sagri portfolio — styles
   Colours and spacing live in the :root block, so a change there
   updates the whole site.
   ===================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --surface: #131315;
  --border: #26262a;
  --border-strong: #3a3a40;
  --text: #f4f0e8;          /* warm white */
  --muted: #a9a59c;         /* ~8:1 on --bg */
  --accent: #4d8dff;        /* the one blue */
  --danger: #ffb4a8;
  --radius: 14px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.08; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 12, 0.94);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { font: 650 1.15rem/1 var(--display); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.bar-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 8px 2px; transition: color .15s; }
.nav-link:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--text); color: #101012;
  font: 600 0.98rem/1 var(--body);
  padding: 15px 22px; border-radius: 999px;
  text-decoration: none; border: 1px solid transparent;
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: #ffffff; }
.btn:active { transform: translateY(1px); }
.btn .wa { width: 22px; height: 22px; flex: none; }
.btn-sm { padding: 9px 14px 9px 11px; font-size: 0.88rem; gap: 8px; }
.btn-sm .wa { width: 20px; height: 20px; }
.btn-lg { padding: 18px 28px; font-size: 1.05rem; }
.btn-lg .wa { width: 26px; height: 26px; }

.text-link { color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; transition: border-color .15s, color .15s; }
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(28px, 5vw, 56px); text-align: center; }
.hero-title { font-size: clamp(2.1rem, 6.2vw, 4rem); text-wrap: balance; }
.accent { color: var(--accent); }
.hero-sub { max-width: 40rem; margin: 14px auto 0; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); text-wrap: balance; }

.intro { margin: clamp(22px, 3.5vw, 36px) auto 0; }
.intro[hidden] { display: none; }
.intro .player { margin-inline: auto; }
.intro-caption {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px auto 0; padding: 9px 14px; max-width: max-content;
  border: 1px dashed #8a6d2f; border-radius: 10px;
  color: #f0cf86; font-size: 0.88rem; line-height: 1.4; text-align: left;
}
.intro-caption svg { flex: none; width: 16px; height: 16px; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: clamp(22px, 3.5vw, 32px); }

/* ---------- Video players ---------- */
.player { position: relative; width: 100%; background: #000; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; aspect-ratio: var(--ar, 16 / 9); }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; color: inherit; display: block; }
.player-poster img { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.player-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,0) 45%); pointer-events: none; }
.play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: clamp(58px, 9vw, 84px); aspect-ratio: 1; translate: -50% -50%;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--text); color: #101012;
  box-shadow: 0 6px 28px rgba(0,0,0,.45);
  transition: scale .18s, background-color .18s, color .18s;
}
.play svg { width: 42%; height: 42%; margin-left: 6%; }
.player-poster:hover .play { scale: 1.06; background: var(--accent); color: #fff; }
.player-poster:hover img { opacity: .92; }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; border: 0; object-fit: contain; }

.player-error {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(8,8,9,.94); padding: 20px; text-align: center; font-size: 0.95rem;
}
.player-error p { color: var(--danger); max-width: 28ch; }
.player-error button { font: 600 0.9rem var(--body); color: var(--text); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.player-error button:hover { border-color: var(--text); }

/* ---------- Selected work ---------- */
.work { padding-top: clamp(64px, 10vw, 112px); }
.section-title { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin-bottom: clamp(26px, 4vw, 44px); }

.group + .group { margin-top: clamp(52px, 8vw, 88px); }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.group-head h3 { font-size: 1.3rem; }
.group-head p { color: var(--muted); font-size: 0.95rem; }

/* Long-form: pairs side by side. flex-grow = aspect ratio, so mixed 3:2 and 16:9 share one height. */
.row { display: flex; gap: clamp(16px, 2.4vw, 28px); }
.row + .row { margin-top: clamp(28px, 4vw, 40px); }
.row > .card { flex: var(--ar-num) 1 0; min-width: 0; }
.row.single > .card { flex: 0 1 calc(50% - 14px); }

.card .meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin-top: 12px; }
.card h4 { margin: 0; font: 600 1rem/1.35 var(--body); }
.card .sub { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }

/* Short-form: text on the left, portrait reel(s) on the right */
.short-layout { display: grid; grid-template-columns: minmax(0, 300px) auto; justify-content: center; gap: clamp(32px, 7vw, 96px); align-items: center; padding-top: 8px; }
.short-copy h3 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.short-copy p { margin-top: 14px; color: var(--muted); max-width: 30ch; font-size: 1.05rem; }
.portrait-list { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.portrait-list .card { width: min(320px, 100%); }

.contact { padding-top: clamp(72px, 11vw, 128px); }
.contact-card { text-align: center; border-top: 1px solid var(--border); padding: clamp(44px, 7vw, 72px) 0 clamp(8px, 2vw, 16px); }
.contact-title { font-size: clamp(2rem, 5.4vw, 3.4rem); }
.contact-text { max-width: 36rem; margin: 16px auto 0; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); text-wrap: balance; }
.contact-actions { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.email-link { color: var(--muted); }
.email-link:hover { color: var(--text); }
.email-link[hidden], #email-footer[hidden] { display: none; }

.site-footer { margin-top: clamp(56px, 9vw, 96px); border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--muted); font-size: 0.9rem; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.noscript { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .row { flex-direction: column; }
  .row > .card, .row.single > .card { flex: none; width: 100%; }
  .row + .row { margin-top: 28px; }
  .row > .card + .card { margin-top: 4px; }
  .short-layout { grid-template-columns: 1fr; gap: 24px; }
  .short-copy { text-align: center; }
  .short-copy p { margin-inline: auto; }
}
@media (max-width: 460px) {
  .bar { height: 56px; }
  .btn-sm .long { display: none; }
  .hero-actions .btn { width: 100%; }
}
@media (min-width: 461px) { .btn-sm .long { display: inline; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .player-poster:hover .play { scale: 1; }
}
