/* ══════════════════════════════════════════
   Abdeen — Digital Portfolio
   styles.css
   ══════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────── */
:root {
  --ink:       #09090f;
  --ink2:      #111118;
  --surface:   #16161f;
  --border:    rgba(255, 255, 255, 0.07);
  --border2:   rgba(255, 255, 255, 0.13);
  --gold:      #c8a84b;
  --gold-lt:   #e4cf88;
  --gold-dim:  rgba(200, 168, 75, 0.14);
  --white:     #f0ede6;
  --muted:     rgba(240, 237, 230, 0.36);
  --muted2:    rgba(240, 237, 230, 0.58);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

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

/* ── Custom Cursor ──────────────────────── */
#cur {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

#cur-dot {
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.15s;
}

#cur-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(200, 168, 75, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

body:has(a:hover) #cur-ring,
body:has(button:hover) #cur-ring {
  width: 54px;
  height: 54px;
}

/* ── Navigation ─────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(6vw, calc((100% - 1280px) / 2));
  height: 64px;
  background: rgba(9, 9, 15, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 1px;
  text-decoration: none;
  cursor: none;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  cursor: none;
  transition: color 0.2s;
}

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

/* ── Hero ───────────────────────────────── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 100px max(6vw, calc((100% - 1280px) / 2)) 80px;
  gap: 64px;
  position: relative;
}

.hero-vline {
  position: absolute;
  top: 80px;
  bottom: 80px;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--border2) 20%,
    var(--border2) 80%,
    transparent
  );
}

/* Eyebrow text */
.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 22px;
  opacity: 0;
  animation: fadeUp 0.8s 0.25s ease forwards;
}

/* Headline */
h1.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(38px, 3.2vw, 52px);
  line-height: 1.07;
  letter-spacing: -1.5px;
  opacity: 0;
  animation: fadeUp 0.9s 0.38s ease forwards;
}

h1.hero-title em {
  font-style: italic;
  color: var(--gold-lt);
}

/* Sub-heading */
.hero-sub {
  margin-top: 22px;
  max-width: 430px;
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--muted2);
  opacity: 0;
  animation: fadeUp 0.9s 0.52s ease forwards;
}

/* CTAs */
.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s 0.65s ease forwards;
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 2px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: none;
  transition: all 0.22s;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--gold-lt);
}

.btn-ghost {
  border: 1px solid var(--border2);
  color: var(--muted2);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Hero Stats Panel ───────────────────── */
.hero-stats {
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fadeUp 1s 0.5s ease forwards;
}

.stat-item {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}

.stat-item:first-child {
  border-top: 1px solid var(--border);
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: -2px;
}

.stat-num sup {
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0;
  vertical-align: super;
}

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── Section Base ───────────────────────── */
section {
  position: relative;
  padding: 96px max(6vw, calc((100% - 1280px) / 2));
}

section + section {
  border-top: 1px solid var(--border);
}

.sec-hdr {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 60px;
}

.sec-num {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  opacity: 0.55;
}

.sec-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sec-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 14px;
}

/* ── Project Grid ───────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.proj-card {
  background: var(--ink);
  padding: 32px 28px 28px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: none;
  transition: background 0.3s;
}

.proj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, var(--gold-dim), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}

.proj-card:hover {
  background: var(--ink2);
}

.proj-card:hover::before {
  opacity: 1;
}

/* Card internals */
.card-group {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-group::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  opacity: 0.6;
  background: currentColor;
}

.card-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  overflow: hidden;
  flex-shrink: 0;
}

.card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.22;
  margin-bottom: 10px;
  transition: color 0.22s;
}

.proj-card:hover .card-title {
  color: var(--gold-lt);
}

.card-desc {
  font-size: 13.5px;
  color: var(--muted2);
  line-height: 1.65;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.card-url {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--muted);
}

.card-arrow {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  transition: all 0.22s;
  flex-shrink: 0;
}

.proj-card:hover .card-arrow {
  border-color: var(--gold);
  color: var(--gold);
  transform: translate(2px, -2px);
}

/* ── Contact Section ────────────────────── */
#contact-section {
  background: var(--ink2);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.42;
  color: var(--white);
}

.contact-tagline em {
  font-style: italic;
  color: var(--gold-lt);
}

.contact-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.7;
}

.contact-rows {
  display: flex;
  flex-direction: column;
}

.contact-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.contact-row:first-child {
  border-top: 1px solid var(--border);
}

.contact-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.65;
  margin-bottom: 5px;
}

.contact-val {
  font-size: 14.5px;
  color: var(--white);
}

.contact-val a {
  color: var(--white);
  text-decoration: none;
  cursor: none;
  transition: color 0.2s;
}

.contact-val a:hover {
  color: var(--gold-lt);
}

/* ── Footer ─────────────────────────────── */
footer {
  padding: 28px max(6vw, calc((100% - 1280px) / 2));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  color: var(--gold);
}

.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Scroll Reveal ──────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

/* ── Language Toggle ────────────────────── */
.lang-toggle {
  font-family: 'Cairo', 'DM Mono', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(200, 168, 75, 0.45);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: none;
  transition: background 0.22s, border-color 0.22s, color 0.22s;
  flex-shrink: 0;
  white-space: nowrap;
}

.lang-toggle:hover {
  background: rgba(200, 168, 75, 0.28);
  border-color: var(--gold);
  color: var(--gold-lt);
}

/* ── RTL / Arabic overrides ─────────────── */
[dir="rtl"] body,
[dir="rtl"] .hero-sub,
[dir="rtl"] .card-desc,
[dir="rtl"] .contact-note,
[dir="rtl"] .contact-val {
  font-family: 'Cairo', sans-serif;
}

[dir="rtl"] h1.hero-title,
[dir="rtl"] .contact-tagline,
[dir="rtl"] .sec-title,
[dir="rtl"] .footer-brand,
[dir="rtl"] .card-title {
  font-family: 'Cairo', sans-serif;
  letter-spacing: 0;
}

[dir="rtl"] .hero-eyebrow,
[dir="rtl"] .nav-links a,
[dir="rtl"] .lang-toggle,
[dir="rtl"] .btn,
[dir="rtl"] .stat-label,
[dir="rtl"] .sec-num,
[dir="rtl"] .card-group,
[dir="rtl"] .card-url,
[dir="rtl"] .contact-lbl,
[dir="rtl"] .footer-copy {
  font-family: 'Cairo', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

[dir="rtl"] .sec-rule {
  margin-left: 0;
  margin-right: 14px;
}

[dir="rtl"] .proj-card:hover .card-arrow {
  transform: translate(-2px, -2px);
}

/* ── Responsive ─────────────────────────── */
@media (min-width: 1024px) {
  #hero {
    gap: 64px;
    padding-top: 80px;
    padding-bottom: 64px;
  }

  section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .stat-num {
    font-size: 36px;
  }

  .stat-item {
    padding: 20px 0;
  }
}

@media (max-width: 768px) {
  #hero {
    grid-template-columns: 1fr;
    padding: 90px 6vw 60px;
    gap: 50px;
  }

  .hero-vline {
    display: none;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .proj-grid {
    grid-template-columns: 1fr;
  }

  nav .nav-links {
    display: none;
  }
}
