/*
 * ═══════════════════════════════════════════════
 *  DESIGN SYSTEM — alaa adil portfolio
 *  One file to rule all pages.
 *  To change the font: update --font-base below.
 *  To change any colour: update the token below.
 * ═══════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Inter+Display:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────────
   TOKENS
   ───────────────────────────────────────────── */
:root {
  /* Fonts */
  --font-heading: "Inter Display", "Inter", sans-serif;
  --font-base: "Inter", sans-serif;

  /* Colours */
  --color-bg:            #ffffff;
  --color-surface:       #f9fafb;
  --color-dark:          #111827;
  --color-dark-rich:     #1C1B18;

  --color-text-primary:  rgb(20, 20, 20);
  --color-text-secondary:#505050;
  --color-text-muted:    rgb(140, 140, 140);

  --color-border:        #e5e7eb;
  --color-border-muted:  #f3f4f6;

  --color-accent:        #603FD6;   /* orange — change here to retheme */

  /* Spacing / radii */
  --radius-card:  22px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-pill:  999px;
}

/* ─────────────────────────────────────────────
   RESET
   ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─────────────────────────────────────────────
   BASE
   ───────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  overflow-x: clip; /* clip doesn't create a scroll container, so sticky still works */
}

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

h1 { font-size: 80px; font-weight: 600; line-height: 1em; }
h2 { font-size: 32px; font-weight: 500; line-height: 1.1em; }
h3 { font-size: 24px; font-weight: 500; line-height: 1.1em; }
h4 { font-size: 20px; font-weight: 500; line-height: 1.2em; }
h5 { font-size: 18px; font-weight: 700; line-height: 1.4em; letter-spacing: -0.04em; }
h6 { font-size: 16px; font-weight: 500; line-height: 1.4em; }

/* ─────────────────────────────────────────────
   PROGRESS BAR
   ───────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--color-accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ─────────────────────────────────────────────
   NAV
   ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 40px;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-pill-float {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 11px 12px;
  background: var(--color-bg);
  border-radius: 30px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  pointer-events: all;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 500;
  color: #4d4d4d;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(0,0,0,0.05); }
.nav-item.active { background: var(--color-dark); color: #ffffff; }
.nav-item.active:hover { background: #333; }

/* ─────────────────────────────────────────────
   PAGE WRAPPER
   ───────────────────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ─────────────────────────────────────────────
   CASE STUDY LAYOUT
   ───────────────────────────────────────────── */
.case-study {
  display: block;
  margin-top: 48px;
  padding-left: 216px; /* space for the fixed TOC */
}

.content { min-width: 0; }

/* ─────────────────────────────────────────────
   TOC
   ───────────────────────────────────────────── */
.toc {
  position: fixed;
  top: 200px;
  left: max(10px, calc((100vw - 1100px) / 2 - 120px));
  width: 155px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
  z-index: 50;
}

.toc a {
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.3;
  padding-left: 14px;
  transition: color 0.35s ease;
  display: block;
}
.toc a.active { color: var(--color-accent); }
.toc a:hover:not(.active) { color: var(--color-text-primary); }

.toc-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 18px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────── */
h1.hero-title {
  font-family: var(--font-heading);
  font-size: 80px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1em;
  color: var(--color-text-primary);
  margin-top: 150px;
  margin-bottom: 36px;
}

@media (max-width: 1199px) {
  h1.hero-title { font-size: 48px; line-height: 1.1em; }
}

@media (max-width: 809px) {
  h1.hero-title { font-size: 40px; line-height: 1.1em; }
}

h2.section-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1em;
  margin-bottom: 14px;
  color: var(--color-text-primary);
}

.body-text {
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.01em;
  color: var(--color-text-secondary);
}
.body-text strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

@media (max-width: 1199px) {
  .body-text { font-size: 15.2px; }
}

@media (max-width: 809px) {
  .body-text { font-size: 14px; line-height: 22px; }
}

.display-text {
  font-family: var(--font-base);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: 0.01em;
  color: var(--color-text-secondary);
  margin-top: 14px;
}

/* ─────────────────────────────────────────────
   HERO IMAGE
   ───────────────────────────────────────────── */
.hero-img {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 48px;
  background: transparent;
}
.hero-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─────────────────────────────────────────────
   PROJECT META STRIP
   ───────────────────────────────────────────── */
.project-meta {
  display: grid;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 56px;
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-label {
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pm-value {
  font-family: var(--font-base);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────── */
section { margin-bottom: 100px; }

/* ─────────────────────────────────────────────
   QUOTE CARD — butter yellow
   ───────────────────────────────────────────── */
.quote-card {
  background: #f9f9f9;

  border-radius: var(--radius-md);
  padding: 36px 40px;
  margin-bottom: 56px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.quote-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}
.quote-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* legacy class name from tamara-smart */
.quote-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quote-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quote-card blockquote {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-primary);
}

.quote-card cite {
  display: block;
  font-family: var(--font-base);
  font-size: 13px;
  font-style: normal;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────
   PAIN / PROBLEM ROWS
   ───────────────────────────────────────────── */
.pain-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 100px;
}
.pain-row:last-child { margin-bottom: 0; }

.pain-img img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 220px;
}
.pain-row.img-left .pain-img  { order: 1; display: flex; justify-content: center; }
.pain-row.img-left .pain-text { order: 2; }
.pain-row.img-right .pain-img  { order: 2; display: flex; justify-content: center; }
.pain-row.img-right .pain-text { order: 1; }

.pain-text h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--color-text-primary);
}
.pain-text p {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────
   PROBLEM CARDS (bordered list)
   ───────────────────────────────────────────── */
.problem-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.problem-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}
.problem-item h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}
.problem-item p {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────
   SUCCESS CARDS
   ───────────────────────────────────────────── */
.success-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.success-card {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
}
.success-card .emoji {
  font-size: 26px;
  margin-bottom: 10px;
}
.success-card p {
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────
   SOLUTION ROWS
   ───────────────────────────────────────────── */
.solution-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 120px;
}
.solution-row:last-child { margin-bottom: 0; }

.solution-row.img-left  .sol-img  { order: 1; }
.solution-row.img-left  .sol-text { order: 2; }
.solution-row.img-right .sol-img  { order: 2; }
.solution-row.img-right .sol-text { order: 1; }

.solution-row.stacked {
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 80px;
}
.solution-row.stacked .sol-text { order: 1; }
.solution-row.stacked .sol-img  { order: 2; max-width: 480px; margin: 0 auto; }

.sol-img {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sol-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.sol-text .sol-tag {
  display: inline-block;
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}
.sol-text h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--color-text-primary);
}
.sol-text p {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────
   IMPACT BLOCK
   ───────────────────────────────────────────── */
.impact-block {
  background: #F9F7FF;
  border-radius: var(--radius-md);
  padding: 48px;
}
.impact-block .impact-stat {
  font-family: var(--font-heading);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 12px;
}
.impact-block p {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 560px;
}

/* ─────────────────────────────────────────────
   INTRO / PROBLEM / SOLUTION BLOCKS
   ───────────────────────────────────────────── */
.cs-block {
  background: #FBF9FF;
  border-radius: var(--radius-md);
  padding: 40px 48px;
  margin-bottom: 20px;
}
.cs-block-label {
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 600;
  color: #603FD6;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
.cs-block-body {
  font-family: var(--font-base);
  font-size: 17px;
  line-height: 1.7;
  color: #000000;
}
.cs-block-body strong { font-weight: 600; }
.cs-blocks-wrapper { margin-bottom: 80px; }

/* ─────────────────────────────────────────────
   LEARNINGS BLOCK
   ───────────────────────────────────────────── */
.learnings-block {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  margin-top: 24px;
}
.learnings-block p {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────
   MORE PROJECTS
   ───────────────────────────────────────────── */
.more-projects {
  margin-top: 80px;
  padding-top: 56px;
  border-top: 1px solid var(--color-border);
}
.more-projects h2 {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 28px;
  color: var(--color-text-primary);
}

.projects-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.proj-card {
  text-decoration: none;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s;
  background: var(--color-bg);
}
.proj-card:hover { opacity: 0.8; }

.proj-card .thumb {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: transparent;
}
.proj-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.proj-card .card-body { padding: 14px 16px 18px; }
.proj-card .card-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.proj-card .card-role,
.proj-card .card-year {
  font-family: var(--font-base);
  font-size: 12px;
  color: var(--color-text-secondary);
}
.proj-card .card-title {
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-text-primary);
}
.proj-card:hover .card-title { color: var(--color-accent); }

/* ─────────────────────────────────────────────
   CASE STUDY FOOTER — dark full-width
   ───────────────────────────────────────────── */
.cs-footer {
  background: var(--color-dark);
  border-radius: 0;
  margin: 40px 0 0;
  padding: 52px 56px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.cs-footer-left p {
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.5;
  max-width: 300px;
}

.cs-footer-right {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

.cs-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-footer-links a {
  font-family: var(--font-base);
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}
.cs-footer-links a:hover { color: #fff; }

.cs-footer-socials {
  display: flex;
  gap: 10px;
  align-items: center;
}
.cs-footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  text-decoration: none;
}
.cs-footer-socials a:hover { background: rgba(255,255,255,0.2); }
.cs-footer-socials svg { display: block; }

/* ─────────────────────────────────────────────
   HOMEPAGE FOOTER
   ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0 40px;
  margin-top: 50px;
  padding-left: 0px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 40px;
  align-items: start;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.footer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.footer-name {
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-base);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.footer-col { display: flex; flex-direction: column; gap: 7px; }
.footer-col a {
  font-family: var(--font-base);
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 200ms;
}
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  margin-top: 28px;
  font-family: var(--font-base);
  font-size: 11px;
  color: #595959 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   SCROLL REVEAL
   ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .page { padding: 0 24px 60px; }
  .case-study { padding-left: 172px; }
  .toc { top: 188px; gap: 12px; left: 24px; width: 136px; }
  .toc a { font-size: 13px; }
  .solution-row { gap: 28px; }
  .impact-block { padding: 36px 32px; }
  .cs-footer { margin: 24px 0 0; padding: 36px 32px; }
  .projects-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .more-projects h2 { font-size: 32px; }
}

@media (max-width: 600px) {
  .page { padding: 0 16px 48px; }
  .case-study { margin-top: 32px; padding-left: 0; }
  .toc { display: none; }

  .pain-row { grid-template-columns: 1fr !important; gap: 16px; }
  .pain-row.img-right .pain-img,
  .pain-row.img-left  .pain-img  { order: 1; justify-content: flex-start; }
  .pain-row.img-right .pain-text,
  .pain-row.img-left  .pain-text { order: 2; }
  .pain-img img { max-width: 140px; }

  .solution-row { grid-template-columns: 1fr !important; gap: 20px; }
  .solution-row.img-left  .sol-img,
  .solution-row.img-right .sol-img  { order: 1; }
  .solution-row.img-left  .sol-text,
  .solution-row.img-right .sol-text { order: 2; }

  .quote-card { flex-direction: column; padding: 24px; }

  .projects-row { grid-template-columns: 1fr; }
  .more-projects h2 { font-size: 28px; }

  .cs-footer { flex-direction: column; gap: 28px; margin: 20px 0 0; padding: 28px 24px; }
  .cs-footer-right { flex-direction: column; gap: 20px; }
  .cs-footer-socials { justify-content: flex-start; }

  .footer-inner { grid-template-columns: 1fr; gap: 20px; }

  .impact-block { padding: 28px 24px; }
  .learnings-block { padding: 24px; }
}
