/* =========================================================
   Mahmoud — personal portfolio
   Palette: cream / near-black / three reds / one yellow
   Type:    Martian Mono everywhere (display + body)
   ========================================================= */

:root {
  --cream:   #F2F0EA;
  --ink:     #231F20;
  --red:     #D02019;
  --red-mid: #E03D2E;
  --red-lt:  #EF4C3E;
  --yellow:  #FFD800;

  --shell:  1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --rule:   3px;

  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(14px, 0.95vw, 16px);
  line-height: 1.75;
  letter-spacing: -0.02em;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.055em;
}

p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: var(--rule) solid var(--red);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------
   Nav — static (scrolls away), transparent, flush to top
   --------------------------------------------------------- */
.nav-wrap {
  position: static;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
}

.nav {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-logo,
.nav-links a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.05em;
  letter-spacing: -0.06em;
}

.nav-links {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  flex-wrap: wrap;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.86em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-logo:hover,
.nav-links a:hover { color: var(--red-lt); }
.nav-links a:hover { border-bottom-color: var(--red-lt); }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  padding-block: clamp(48px, 9vh, 96px) clamp(64px, 11vh, 128px);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-eyebrow {
  margin: 0 0 18px;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--red);
  letter-spacing: -0.01em;
}

.hero-heading {
  max-width: 22ch;
  font-size: clamp(1.45rem, 3.4vw, 2.5rem);
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.btn {
  display: inline-block;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  border: var(--rule) solid var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.btn-primary {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn-secondary {
  background: var(--red);
  color: var(--cream);
  border-color: var(--red);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-secondary:hover { background: var(--red-lt); border-color: var(--red-lt); }

/* secondary to the CTAs: quiet outline chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 5px 11px;
  font-size: 0.68em;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid rgba(35, 31, 32, 0.32);
}

.hero-avatar { justify-self: end; }

.avatar {
  display: block;
  width: clamp(170px, 20vw, 250px);
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 5px solid var(--red);
}

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */
.section { padding-block: clamp(56px, 9vh, 104px); }

.section-heading {
  max-width: 28ch;
  font-size: clamp(1.3rem, 2.6vw, 1.95rem);
  margin-bottom: clamp(30px, 5vh, 52px);
}

/* ---------------------------------------------------------
   About
   --------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.about-prose p {
  max-width: 62ch;
  font-size: 0.95em;
}
.about-prose p:last-child { margin-bottom: 0; }

.stats {
  margin: 0;
  border-top: var(--rule) solid var(--ink);
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(96px, 30%) 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(35, 31, 32, 0.22);
}

.stat-row dt {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--red);
  line-height: 1.6;
}

.stat-row dd {
  margin: 0;
  font-size: 0.8em;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   Projects
   --------------------------------------------------------- */
.project-list {
  display: grid;
  gap: clamp(22px, 3.5vw, 34px);
}

.project {
  position: relative;
  padding: clamp(24px, 3.4vw, 38px);
  background: var(--cream);
  border: var(--rule) solid var(--ink);
  box-shadow: 9px 9px 0 var(--red-mid);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.project:hover {
  transform: translate(-3px, -3px);
  box-shadow: 14px 14px 0 var(--red-lt);
}

.project-num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.08em;
  color: var(--red);
  margin-bottom: 12px;
}

.project-cat {
  margin: 0 0 6px;
  font-size: 0.68em;
  font-weight: 500;
  color: rgba(35, 31, 32, 0.62);
}

.project-title {
  font-size: clamp(1.02rem, 1.9vw, 1.35rem);
  margin-bottom: 10px;
}

.project-tagline {
  max-width: 56ch;
  margin-bottom: 18px;
  font-size: 0.86em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tags li {
  padding: 5px 10px;
  font-size: 0.66em;
  font-weight: 500;
  background: var(--yellow);
  color: var(--ink);
}

.project-link {
  display: inline-block;
  font-size: 0.76em;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
  word-break: break-all;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.project-link:hover { color: var(--red-lt); border-bottom-color: var(--red-lt); }

.project-status {
  margin: 0;
  font-size: 0.76em;
  font-weight: 500;
  padding: 9px 13px;
  background: var(--ink);
  color: var(--cream);
  display: inline-block;
}

/* ---------------------------------------------------------
   Skills
   --------------------------------------------------------- */
.skill-group {
  display: grid;
  grid-template-columns: minmax(130px, 24%) 1fr;
  gap: clamp(14px, 3vw, 36px);
  padding: 20px 0;
  border-top: 1px solid rgba(35, 31, 32, 0.22);
  align-items: start;
}
.skill-group:first-of-type { border-top: var(--rule) solid var(--ink); }
.skill-group:last-of-type { border-bottom: 1px solid rgba(35, 31, 32, 0.22); }

.skill-cat {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.03em;
  line-height: 1.7;
}

.tags-lg { margin-bottom: 0; }

.tags-lg li {
  background: none;
  border: 2px solid var(--ink);
  font-size: 0.7em;
  padding: 6px 12px;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.tags-lg li:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--cream);
}

/* ---------------------------------------------------------
   Contact — near-black band
   --------------------------------------------------------- */
.contact {
  background: var(--ink);
  color: var(--cream);
  padding-block: clamp(56px, 9vh, 104px);
}

.contact-heading { color: var(--cream); }

.contact-list {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(242, 240, 234, 0.3);
  margin-bottom: 40px;
}

.contact-list li {
  display: grid;
  grid-template-columns: minmax(96px, 22%) 1fr;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(242, 240, 234, 0.3);
}

.contact-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--red-lt);
  line-height: 1.7;
}

.contact-list a {
  font-size: 0.82em;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  word-break: break-all;
  justify-self: start;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.contact-list a:hover {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}
.contact-list a:focus-visible { outline-color: var(--yellow); }

.contact-foot {
  margin: 0;
  font-size: 0.68em;
  color: rgba(242, 240, 234, 0.6);
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-inner,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .hero-inner { gap: 36px; }
  .hero-avatar { justify-self: start; }
  .hero-heading { max-width: 26ch; }
  .skill-group { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 560px) {
  .nav { align-items: flex-start; gap: 12px; }
  .nav-links { gap: 14px; }
  .btn { flex: 1 1 auto; text-align: center; }
  .stat-row,
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
  .project { box-shadow: 6px 6px 0 var(--red-mid); }
  .project:hover { box-shadow: 9px 9px 0 var(--red-lt); }
}

/* ---------------------------------------------------------
   Motion preferences
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover, .project:hover { transform: none; }
}
