/* ═══════════════════════════════════════════
   Ahmed Issam — Case Study System
   Design tokens + shared layout
═══════════════════════════════════════════ */

:root {
  --gold:        #C9A840;
  --gold-dim:    #7A6220;
  --gold-glow:   rgba(201,168,64,0.12);
  --bg:          #080808;
  --surface:     #111111;
  --surface-2:   #181818;
  --white:       #F0EBE1;
  --muted:       #6B6560;
  --subtle:      #2A2A2A;
  --border:      rgba(201,168,64,0.10);
  --border-hi:   rgba(201,168,64,0.28);
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Cairo', system-ui, sans-serif;
  --font-mono:   'DM Mono', monospace;
  --ease:        cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* noise */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

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

/* ── wrap ── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* ── NAV ── */
.cs-nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,8,.92);
  backdrop-filter: blur(16px);
  padding: 1.1rem 0;
}
.cs-nav__inner {
  max-width: 1080px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.cs-nav__logo {
  font-family: var(--font-serif); font-size: 1rem;
  color: var(--gold); letter-spacing: .08em; font-weight: 400;
}
.cs-nav__logo span { color: var(--muted); font-size: .78rem; margin-inline-end: .5rem; }
.cs-nav__back {
  font-size: .78rem; color: var(--muted); letter-spacing: .06em;
  display: flex; align-items: center; gap: .4rem;
  transition: color .2s var(--ease);
}
.cs-nav__back:hover { color: var(--gold); }

/* ── HUB GRID ── */
.hub-hero { padding: 9rem 0 5rem; }
.hub-hero__tag {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .18em; color: var(--gold); text-transform: uppercase;
  display: flex; align-items: center; gap: .8rem; margin-bottom: 2rem;
}
.hub-hero__tag::before { content:''; width:32px; height:1px; background:var(--gold-dim); display:block; }
.hub-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 300; line-height: 1.1; margin-bottom: 1.2rem;
}
.hub-hero__title em { font-style: italic; color: var(--gold); }
.hub-hero__sub {
  font-size: 1.05rem; color: var(--muted);
  max-width: 520px; line-height: 1.85; margin-bottom: 3rem;
}
.hub-divider {
  width: 48px; height: 1px; background: var(--gold-dim); margin-bottom: 3rem;
}

/* stat strip */
.hub-stats {
  display: flex; gap: 3rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 2rem;
  margin-bottom: 6rem;
}
.hub-stat__num {
  font-family: var(--font-serif); font-size: 2rem;
  color: var(--gold); font-weight: 300; line-height: 1;
}
.hub-stat__label { font-size: .72rem; color: var(--muted); letter-spacing: .08em; margin-top: .2rem; }

/* grid */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 6rem;
}
.hub-card {
  background: var(--surface);
  padding: 2.2rem;
  display: flex; flex-direction: column;
  cursor: pointer; position: relative; overflow: hidden;
  transition: background .25s var(--ease);
  text-decoration: none; color: inherit;
}
.hub-card::before {
  content:''; position:absolute; inset:0 auto 0 0;
  width: 3px; background: var(--gold);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .35s var(--ease);
}
.hub-card:hover { background: var(--surface-2); }
.hub-card:hover::before { transform: scaleY(1); }

.hub-card__type {
  font-family: var(--font-mono); font-size: .62rem;
  color: var(--gold); letter-spacing: .15em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.hub-card__thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 2px; margin-bottom: 1.5rem;
  border: 1px solid var(--subtle);
  filter: grayscale(20%);
  transition: filter .3s;
}
.hub-card:hover .hub-card__thumb { filter: none; }
.hub-card__title {
  font-family: var(--font-serif); font-size: 1.6rem;
  font-weight: 300; line-height: 1.2; margin-bottom: .6rem;
}
.hub-card__tagline { font-size: .85rem; color: var(--muted); line-height: 1.7; flex: 1; margin-bottom: 1.5rem; }
.hub-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 1rem;
}
.hub-card__tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.hub-card__tag {
  font-family: var(--font-mono); font-size: .58rem;
  padding: .18rem .5rem; border: 1px solid var(--border);
  color: var(--muted); border-radius: 2px; letter-spacing: .06em;
}
.hub-card__arrow { color: var(--gold-dim); font-size: .9rem; transition: transform .2s; }
.hub-card:hover .hub-card__arrow { transform: translateX(4px); }

/* ── CASE STUDY PAGE ── */
.cs-hero { padding: 8rem 0 4rem; border-bottom: 1px solid var(--border); }
.cs-hero__type {
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--gold); letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: .8rem;
}
.cs-hero__type::before { content:''; width:28px; height:1px; background:var(--gold-dim); }
.cs-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem,6vw,5rem);
  font-weight: 300; line-height: 1.1; margin-bottom: .8rem;
}
.cs-hero__title em { font-style:italic; color:var(--gold); }
.cs-hero__tagline { font-size: 1.1rem; color: var(--muted); max-width: 560px; line-height: 1.8; }

/* kpi row */
.cs-kpis {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.cs-kpi__num {
  font-family: var(--font-serif); font-size: 2rem;
  color: var(--gold); font-weight: 300; line-height: 1;
}
.cs-kpi__label { font-size: .7rem; color: var(--muted); letter-spacing: .08em; margin-top: .2rem; }

/* section */
.cs-section { padding: 5rem 0; border-bottom: 1px solid var(--border); }
.cs-section:last-child { border-bottom: none; }

.cs-section__label {
  font-family: var(--font-mono); font-size: .62rem;
  color: var(--gold); letter-spacing: .2em; text-transform: uppercase;
  display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem;
}
.cs-section__label::after { content:''; flex:1; max-width:50px; height:1px; background:var(--gold-dim); }

.cs-section__title {
  font-family: var(--font-serif); font-size: clamp(1.8rem,3.5vw,2.6rem);
  font-weight: 300; line-height: 1.2; margin-bottom: 1.5rem;
}
.cs-section__title em { font-style:italic; color:var(--gold); }

.cs-body { font-size: 1rem; line-height: 1.9; color: var(--muted); }
.cs-body p + p { margin-top: 1rem; }
.cs-body strong { color: var(--white); font-weight: 600; }

/* steps */
.cs-steps { display: flex; flex-direction: column; gap: 0; margin-top: 2rem; }
.cs-step {
  display: flex; gap: 1.5rem; padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-inline-start .25s;
}
.cs-step:hover { padding-inline-start: .6rem; }
.cs-step:last-child { border-bottom: none; }
.cs-step__n {
  font-family: var(--font-mono); font-size: .6rem;
  color: var(--gold); min-width: 2rem; flex-shrink: 0;
  padding-top: .2rem; letter-spacing: .1em;
}
.cs-step__text { font-size: .9rem; color: var(--muted); line-height: 1.75; }
.cs-step__text strong { color: var(--white); }

/* tools */
.cs-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.cs-tool {
  font-family: var(--font-mono); font-size: .65rem;
  padding: .3rem .75rem; border: 1px solid var(--border-hi);
  color: var(--gold); border-radius: 2px; letter-spacing: .06em;
}

/* results */
.cs-results {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  margin-top: 2rem;
}
.cs-result {
  background: var(--surface); padding: 1.8rem 1.5rem;
}
.cs-result__num {
  font-family: var(--font-serif); font-size: 2.4rem;
  color: var(--gold); font-weight: 300; line-height: 1;
  margin-bottom: .3rem;
}
.cs-result__label { font-size: .75rem; color: var(--muted); letter-spacing: .07em; }

/* gallery */
.cs-gallery {
  columns: 2; column-gap: 1rem; margin-top: 2rem;
}
.cs-gallery-item {
  break-inside: avoid; margin-bottom: 1rem;
  border: 1px solid var(--subtle); overflow: hidden;
  border-radius: 2px; cursor: pointer; position: relative;
  transition: border-color .25s;
}
.cs-gallery-item:hover { border-color: var(--border-hi); }
.cs-gallery-item img { width:100%; display:block; transition: transform .4s var(--ease); }
.cs-gallery-item:hover img { transform: scale(1.03); }
.cs-gallery-item__overlay {
  position:absolute; inset:0; background:rgba(8,8,8,.6);
  display:flex; align-items:flex-end; padding:.7rem;
  opacity:0; transition:opacity .25s;
}
.cs-gallery-item:hover .cs-gallery-item__overlay { opacity:1; }
.cs-gallery-item__label {
  font-family: var(--font-mono); font-size: .58rem;
  color: var(--white); background: var(--gold);
  padding: .15rem .45rem; border-radius: 2px; letter-spacing: .07em;
}

/* next */
.cs-next { padding: 4rem 0 6rem; text-align: center; }
.cs-next__title {
  font-family: var(--font-serif); font-size: clamp(1.6rem,3vw,2.2rem);
  font-weight: 300; margin-bottom: 1rem;
}
.cs-next__title em { color:var(--gold); font-style:italic; }
.cs-next__sub { font-size: .9rem; color: var(--muted); margin-bottom: 2rem; }
.cs-next__links { display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.cs-next__btn {
  font-family: var(--font-sans); font-size: .85rem; font-weight: 600;
  padding: .8rem 1.8rem; border-radius: 2px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: opacity .2s, background .2s;
}
.cs-next__btn--primary { background:var(--gold); color:#080808; border:none; }
.cs-next__btn--primary:hover { opacity:.85; }
.cs-next__btn--ghost {
  background:none; color:var(--white);
  border: 1px solid var(--border-hi);
}
.cs-next__btn--ghost:hover { background:var(--gold-glow); border-color:var(--gold); }

/* lightbox */
#lightbox {
  position:fixed; inset:0; z-index:200;
  background:rgba(8,8,8,.97);
  display:none; align-items:center; justify-content:center;
  flex-direction:column;
}
#lightbox.open { display:flex; }
#lb-img { max-width:90vw; max-height:82vh; object-fit:contain; border:1px solid var(--border); }
#lb-caption { margin-top:.8rem; font-family:var(--font-mono); font-size:.68rem; color:var(--muted); }
.lb-close {
  position:absolute; top:1.5rem; right:2rem;
  background:none; border:none; color:var(--muted);
  font-size:1.6rem; cursor:pointer; transition:color .2s;
}
.lb-close:hover { color:var(--gold); }
.lb-nav {
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(8,8,8,.7); border:1px solid var(--border);
  color:var(--white); width:42px; height:42px; border-radius:50%;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:1.2rem; transition:border-color .2s, color .2s;
}
.lb-nav:hover { border-color:var(--gold); color:var(--gold); }
.lb-prev { left:1.5rem; }
.lb-next { right:1.5rem; }

/* footer */
.cs-footer {
  border-top:1px solid var(--border); padding:1.8rem 0;
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:.5rem;
}
.cs-footer__note { font-family:var(--font-mono); font-size:.68rem; color:var(--muted); }

/* reveal */
.reveal { opacity:0; transform:translateY(18px); transition:opacity .65s var(--ease), transform .65s var(--ease); }
.reveal.in { opacity:1; transform:none; }

/* responsive */
@media(max-width:700px) {
  .hub-grid { grid-template-columns:1fr; }
  .cs-gallery { columns:1; }
  .cs-kpis { gap:1.5rem; }
  .hub-stats { gap:1.5rem; }
  .cs-results { grid-template-columns:1fr 1fr; }
}
