/* ===========================
   ALI ATTIA — PORTFOLIO STYLES
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,700;12..96,800&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Variables ──────────────────────────────────────── */
:root {
  --bg:         #f7f9fc;
  --bg-2:       #ffffff;
  --bg-3:       #edf1f7;
  --border:     #d4dde9;
  --border-2:   #b0c1d4;
  --teal:       #00897b;
  --teal-dim:   #006b60;
  --blue:       #2563eb;
  --amber:      #d97706;
  --red:        #dc2626;
  --text:       #1d3044;
  --text-2:     #4a6a84;
  --text-3:     #8aa8c0;
  --white:      #1d3044;
  --font-head:  'Bricolage Grotesque', sans-serif;
  --font-body:  'Crimson Pro', serif;
  --font-mono:  'JetBrains Mono', monospace;
  --radius:     6px;
  --glow:       0 0 30px rgba(0, 137, 123, 0.15);
  --glow-blue:  0 0 30px rgba(37, 99, 235, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--white); }

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

/* ── Grid Background ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,137,123,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,137,123,.05) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

section { padding: 5rem 0; }

/* ── NAV ───────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 249, 252, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: -.02em;
}

.nav-logo span { color: var(--teal); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-2);
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
}

.nav-links a:hover { color: var(--teal); }

/* ── Utility Classes ───────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .7rem;
  border-radius: 99px;
  background: rgba(0,137,123,.1);
  border: 1px solid rgba(0,137,123,.3);
  color: var(--teal);
}

.tag.blue {
  background: rgba(37,99,235,.1);
  border-color: rgba(37,99,235,.3);
  color: var(--blue);
}

.tag.amber {
  background: rgba(217,119,6,.1);
  border-color: rgba(217,119,6,.3);
  color: var(--amber);
}

.label {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--teal);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
  letter-spacing: -.02em;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color .3s, transform .3s, box-shadow .3s;
}

.card:hover {
  border-color: var(--border-2);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all .25s;
}

.btn-primary {
  background: var(--teal);
  color: #ffffff;
}

.btn-primary:hover {
  background: #00a896;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0,137,123,.35);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}

.btn-outline:hover {
  background: rgba(0,137,123,.08);
  color: var(--teal);
  box-shadow: 0 0 20px rgba(0,137,123,.2);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border-2);
  transform: translateY(-2px);
}

/* ── Skill Chips ───────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: .3rem .7rem;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .2s;
}

.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ── Image Placeholder ─────────────────────────────── */
.img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-3);
  border: 2px dashed var(--border-2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-align: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,137,123,.04), rgba(37,99,235,.04));
}

.img-placeholder svg {
  width: 36px;
  height: 36px;
  opacity: .3;
  flex-shrink: 0;
}

.img-placeholder p {
  position: relative;
  z-index: 1;
}

/* ── Project Screenshots ──────────────────────────── */
.proj-screenshot {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
}

/* ── Stat Block ────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}

.stat-block {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stat-num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--teal);
  display: block;
  line-height: 1;
  margin-bottom: .5rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Feature Grid ──────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition: all .3s;
}

.feature-card:hover {
  border-color: var(--teal-dim);
  box-shadow: var(--glow);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(0,137,123,.1);
  border: 1px solid rgba(0,137,123,.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--white);
}

.feature-card p {
  font-size: .95rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── Two-col layout ────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }

/* ── Footer ────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}

footer p {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-3);
}

/* ── Back link ─────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: color .2s;
  margin-bottom: 3rem;
}

.back-link:hover { color: var(--teal); }

/* ── Project hero ──────────────────────────────────── */
.proj-hero {
  padding: 10rem 0 5rem;
}

.proj-hero .label { margin-bottom: 1.5rem; }

.proj-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 1.25rem;
}

.proj-hero p.lead {
  font-size: 1.2rem;
  color: var(--text-2);
  max-width: 600px;
  margin-bottom: 2rem;
}

.proj-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col.reverse { direction: ltr; }
  .nav-links { display: none; }
  section { padding: 3.5rem 0; }
}

/* ── Animations ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp .7s ease both; }
.fade-up-2 { animation: fadeUp .7s ease .15s both; }
.fade-up-3 { animation: fadeUp .7s ease .3s both; }
.fade-up-4 { animation: fadeUp .7s ease .45s both; }

@keyframes pulse {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1; }
}

.pulse { animation: pulse 2.5s ease infinite; }
