/* ============================================================
   madebyabdulhadi.com
   ============================================================ */

:root {
  --bg:        #0a0a0c;
  --bg-soft:   #101014;
  --panel:     #141419;
  --line:      #24242c;
  --line-soft: #1b1b22;

  --text:      #ececf1;
  --muted:     #9a9aa8;
  --faint:     #6a6a78;

  --accent:    #ff7a2f;
  --accent-2:  #ffb057;
  --accent-dim: rgba(255,122,47,.14);

  --radius:    14px;
  --radius-lg: 22px;

  --maxw: 1240px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

/* Flex/grid display values otherwise beat the hidden attribute */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--accent-dim);
  color: var(--accent-2);
  padding: .12em .42em;
  border-radius: 5px;
}

::selection { background: var(--accent); color: #14100c; }

/* Subtle film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(14px);
  background: rgba(10,10,12,.55);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line-soft);
  background: rgba(10,10,12,.82);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 600; letter-spacing: -.02em;
}
.nav__mark {
  width: 26px; height: 26px; color: var(--accent);
  display: grid; place-items: center;
}
.nav__mark svg { width: 100%; height: 100%; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: color .2s var(--ease);
}
.nav__links a:hover { color: var(--text); }

@media (max-width: 560px) {
  .nav__links { gap: 18px; }
  .nav__brand span:last-child { display: none; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(64px, 12vw, 150px) clamp(20px, 5vw, 56px) clamp(56px, 9vw, 110px);
  overflow: hidden;
}
.hero__glow {
  position: absolute; z-index: 0;
  top: -320px; left: 50%; transform: translateX(-50%);
  width: min(1100px, 130vw); height: 720px;
  background: radial-gradient(ellipse at center, rgba(255,122,47,.20), rgba(255,122,47,.05) 42%, transparent 68%);
  filter: blur(20px);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; }

.eyebrow {
  margin: 0 0 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0;
  font-size: clamp(38px, 7.2vw, 82px);
  line-height: 1.03;
  letter-spacing: -.035em;
  font-weight: 700;
}
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, #ffd9a8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.hero__lede {
  max-width: 620px;
  margin: 26px 0 0;
  font-size: clamp(16px, 1.7vw, 18.5px);
  color: var(--muted);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #ff9540);
  color: #14100c;
  box-shadow: 0 6px 24px -8px rgba(255,122,47,.6);
}
.btn--primary:hover { box-shadow: 0 10px 34px -8px rgba(255,122,47,.75); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: clamp(28px, 6vw, 64px);
  margin: 56px 0 0; padding-top: 30px;
  border-top: 1px solid var(--line-soft);
}
.hero__stats div { margin: 0; }
.hero__stats dt {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
}
.hero__stats dd {
  margin: 6px 0 0;
  font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; letter-spacing: -.02em;
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 110px) clamp(20px, 5vw, 56px);
}
.section__head { margin-bottom: 30px; }
.section__title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -.03em; font-weight: 700;
}
.section__sub { margin: 10px 0 0; color: var(--muted); font-size: 15.5px; }

.prose { color: var(--muted); max-width: 60ch; font-size: 16.5px; }
.prose--center { margin-inline: auto; text-align: center; }

/* ── Filters ─────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 34px; }
.filter {
  padding: 8px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.filter:hover { color: var(--text); border-color: #34343f; }
.filter.is-active {
  background: var(--accent); border-color: var(--accent); color: #14100c; font-weight: 600;
}

/* ── Work grid ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; gap: 16px; } }

.card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit; color: inherit;
  opacity: 0; transform: translateY(18px);
  animation: rise .55s var(--ease) forwards;
  transition: border-color .28s var(--ease), transform .28s var(--ease), box-shadow .28s var(--ease);
}
.card:hover {
  border-color: #3a3a46;
  transform: translateY(-4px);
  box-shadow: 0 18px 48px -22px rgba(0,0,0,.9);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card.is-wide { grid-column: span 2; }
@media (max-width: 1000px) { .card.is-wide { grid-column: span 1; } }

@keyframes rise { to { opacity: 1; transform: none; } }

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(145deg, #17171d, #0e0e12);
}
.card.is-wide .card__media { aspect-ratio: 16 / 9; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease), filter .4s var(--ease);
}
.card:hover .card__media img { transform: scale(1.055); }

.card__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,10,.88) 0%, rgba(8,8,10,.15) 46%, transparent 72%);
}

.card__tag {
  position: absolute; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10,10,12,.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.09);
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: #dcdce4;
}
.card__blend {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,122,47,.92);
  color: #14100c;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
}
.card__blend svg { width: 12px; height: 12px; }

.card__foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 22px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.card__title {
  margin: 0;
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
}
.card__meta { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.card__arrow {
  flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.card:hover .card__arrow { background: var(--accent); color: #14100c; transform: rotate(-45deg); }
.card__arrow svg { width: 15px; height: 15px; }

/* Shown while the gallery has nothing in it yet */
.empty {
  text-align: center;
  padding: clamp(48px, 9vw, 92px) 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255,122,47,.035), transparent 60%);
}
.empty__icon {
  display: inline-grid; place-items: center;
  width: 62px; height: 62px;
  color: var(--accent); opacity: .8;
  margin-bottom: 18px;
}
.empty__icon svg { width: 100%; height: 100%; }
.empty h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.empty p { margin: 10px auto 0; max-width: 44ch; color: var(--muted); font-size: 15.5px; }

/* ── About split ─────────────────────────────────────────── */
.section--split {
  display: grid; grid-template-columns: 1.35fr .95fr; gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 860px) { .section--split { grid-template-columns: 1fr; } }

.tools { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 26px 0 0; }
.tools li {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}

.card-note {
  background: linear-gradient(160deg, var(--panel), #0f0f14);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card-note h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.01em; }
.card-note ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.card-note li { margin-bottom: 9px; }
.fine { margin: 18px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.55; }

/* ── Contact ─────────────────────────────────────────────── */
.section--contact { text-align: center; }
.contact__actions { margin-top: 26px; }
.socials {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 26px; padding: 0; margin: 40px 0 0;
}
.socials a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.socials a:hover { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 2;
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 34px 20px 46px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 13.5px;
}
.footer__dot { opacity: .5; }

/* ── Modal ───────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: clamp(0px, 3vw, 34px); }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(4,4,6,.86);
  backdrop-filter: blur(6px);
  animation: fade .25s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.modal__panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: 94vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: clamp(0px, 2vw, var(--radius-lg));
  animation: pop .32s var(--ease);
  scrollbar-width: thin;
}
@keyframes pop { from { opacity: 0; transform: translateY(22px) scale(.985); } }

.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10,10,12,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff; cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.modal__close:hover { background: var(--accent); color: #14100c; transform: rotate(90deg); }
.modal__close svg { width: 17px; height: 17px; }

.modal__stage {
  position: relative;
  background: #08080a;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  overflow: hidden;
}
.modal__img { width: 100%; height: 100%; object-fit: contain; }

.stagebtn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10,10,12,.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff; cursor: pointer;
  transition: background .2s var(--ease);
}
.stagebtn:hover { background: var(--accent); color: #14100c; }
.stagebtn svg { width: 19px; height: 19px; }
.stagebtn--prev { left: 14px; }
.stagebtn--next { right: 14px; }

.modal__counter {
  position: absolute; bottom: 14px; right: 16px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(10,10,12,.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: #cfcfd8;
}

.modal__body { padding: clamp(22px, 3.4vw, 38px); }
.modal__headrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal__headrow h3 { margin: 0; font-size: clamp(22px, 3vw, 31px); letter-spacing: -.03em; }
.modal__headrow .eyebrow { margin-bottom: 8px; }
.pill {
  flex: none;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  font-family: "JetBrains Mono", monospace; font-size: 12.5px;
}
.modal__desc { color: var(--muted); max-width: 68ch; margin: 18px 0 0; font-size: 16px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.thumbs:empty { display: none; }
.thumb {
  width: 92px; height: 62px; padding: 0;
  border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: #0d0d11;
  cursor: pointer; opacity: .5;
  transition: opacity .2s var(--ease), border-color .2s var(--ease);
}
.thumb:hover { opacity: .85; }
.thumb.is-active { opacity: 1; border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 26px;
  margin: 28px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--line-soft);
}
.specs:empty { display: none; border: 0; padding: 0; margin: 0; }
.specs dt { font-size: 11.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); }
.specs dd { margin: 5px 0 0; font-size: 15px; font-weight: 500; }

.modal__dl { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dl-note { font-size: 13px; color: var(--faint); }

/* ── Comments ────────────────────────────────────────────── */
.comments {
  margin-top: 34px; padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}
.comments__title {
  margin: 0 0 18px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.comments__off {
  margin: 0; padding: 20px;
  border: 1px dashed var(--line); border-radius: 12px;
  text-align: center; color: var(--faint); font-size: 13.5px;
}
.giscus, .giscus-frame { width: 100%; }
.giscus-frame { border: 0; color-scheme: normal; }

/* ── Motion preference ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .card { opacity: 1; transform: none; }
}
