/* ============================================
   Mohamed Alaa — Architectural Visualizer
   Base styles
   ============================================ */

:root {
  --bg: #0b0b0c;
  --bg-soft: #131314;
  --fg: #f4f3ef;
  --muted: #9a9a95;
  --line: rgba(244,243,239,0.12);
  --accent: #c9a24a;
  --font-display: "Anton", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-size: clamp(48px, 9vw, 140px);
  margin: 0;
}

.dim { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: rgba(10,10,10,.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, black 35%, rgba(0,0,0,.5) 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 35%, rgba(0,0,0,.5) 70%, transparent 100%);
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.header-nav a:hover { color: var(--fg); }

.btn-outline {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-outline:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 160px 40px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(201,162,74,0.18), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 50%);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-portrait {
  width: 320px;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  filter: grayscale(100%);
  transition: filter 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}

.hero-portrait:hover {
  filter: grayscale(0%);
  transform: scale(1.06);
}

.hero-foot {
  position: relative;
  z-index: 1;
  margin-top: 60px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: var(--muted);
  font-size: 15px;
}

.hero-foot p { max-width: 420px; margin: 0; }

/* ---------- Sections ---------- */
.section {
  padding: 120px 40px;
  border-top: 1px solid var(--line);
}

.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1.05;
  font-size: clamp(32px, 5vw, 64px);
  margin: 0 0 24px;
}

.section-sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  margin-top: 60px;
}

.about-grid p { margin: 0 0 18px; }

.skill-block {
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.skill-block:last-child { border-bottom: none; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  margin-top: 40px;
}

.skills-grid .skill-block {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.skill-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-block p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.skill-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-list li {
  color: var(--muted);
  font-size: 15px;
}

.skill-list li strong {
  color: var(--fg);
  font-weight: 500;
}

/* ---------- Work cards ---------- */
.work-card {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 60px 0;
  border-bottom: 1px solid var(--line);
}

.work-card:first-child { padding-top: 0; }
.work-card:last-child { border-bottom: none; }

.work-card.flip { flex-direction: row-reverse; }

.work-text { flex: 1; min-width: 0; }
.work-media { flex: 1.2; min-width: 0; }

.work-media img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.work-text h3 {
  font-size: clamp(22px, 2.4vw, 32px);
  margin: 0 0 14px;
}

.work-text .desc {
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 420px;
}

.work-tags { display: flex; gap: 10px; flex-wrap: wrap; }

.work-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* ---------- Let's Talk ---------- */
.talk {
  padding: 120px 40px;
  border-top: 1px solid var(--line);
}

.talk-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.talk .q {
  font-size: clamp(18px, 2vw, 24px);
  margin: 0 0 16px;
  max-width: 480px;
}

.talk-actions {
  color: var(--muted);
  margin: 0;
}

.talk-actions a {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
}

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.links a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

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

/* ---------- Footer ---------- */
footer {
  display: flex;
  justify-content: space-between;
  padding: 30px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer a { border-bottom: 1px solid var(--line); }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  padding: 200px 40px 80px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

/* ---------- Media grid (images/videos pages) ---------- */
.media-item,
.vgallery-item {
  width: 100%;
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.media-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  margin: 0;
  border-radius: 0;
  cursor: zoom-in;
}

.vgallery-item .media-frame {
  cursor: pointer;
}

.vgallery-item.video-missing .media-frame {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1c1c1e, #2a2a2d);
}

.vgallery-item.video-missing .media-frame video {
  display: none;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #000;
  transition: transform 0.8s ease;
}

.media-frame:hover img,
.media-frame:hover video {
  transform: scale(1.03);
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at bottom left,
              rgba(0,0,0,.75) 0%, rgba(0,0,0,.45) 40%, transparent 75%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: radial-gradient(ellipse at bottom left,
                      black 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at bottom left,
              black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1);
}

.media-frame:hover::before {
  opacity: 1;
}

.media-caption {
  position: absolute;
  left: 24px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.media-frame:hover .media-caption {
  opacity: 1;
  transform: translateY(0);
}

.media-caption .idx {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.media-caption h3 { margin: 0; font-size: 20px; color: var(--fg); }

.media-caption .meta {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  header { padding: 18px 20px; }
  .hero { padding: 120px 20px 40px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 32px; }
  .hero-portrait { width: 200px; height: 250px; }
  .section, .talk, .page-hero { padding: 80px 20px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: 1fr; gap: 32px; }
  .work-card, .work-card.flip { flex-direction: column; gap: 24px; }
  .hero-foot { flex-direction: column; gap: 16px; }
  .hero-foot .right { text-align: left; }
  .talk-row { flex-direction: column; align-items: flex-start; }
  .links { flex-direction: row; text-align: left; flex-wrap: wrap; }
  footer { flex-direction: column; gap: 8px; }
}

/* ---------- Full-bleed gallery ---------- */
.gallery-section {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

/* ---------- Video note ---------- */
.video-note {
  padding: 24px 40px 40px;
  max-width: 700px;
  border-bottom: 1px solid var(--line);
}

.video-note p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.video-note .watch-link {
  display: inline-block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: scale(.96);
  transition: opacity .35s cubic-bezier(.16,1,.3,1),
              transform .35s cubic-bezier(.16,1,.3,1),
              visibility 0s linear .35s;
  padding: 24px;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity .35s cubic-bezier(.16,1,.3,1),
              transform .35s cubic-bezier(.16,1,.3,1),
              visibility 0s linear 0s;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img,
.lightbox-stage video {
  display: block;
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.lightbox-caption .idx {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.lightbox-caption h3 { margin: 0; font-size: 16px; color: var(--fg); }

.lightbox-caption .meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  z-index: 2001;
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  line-height: 1;
  opacity: .8;
  transition: opacity .2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 32px;
  padding: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  padding: 12px;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

@media (max-width: 900px) {
  .lightbox-prev, .lightbox-next { font-size: 30px; padding: 8px; }
  .lightbox-close { font-size: 26px; top: 12px; right: 12px; }
}
