/* =========================================================
   Portfolio: Emad Mustafa Hamad
   Concept: "light on the dark". A band of warm light, taken
   from the portrait, falls across a dark umber page. Gold is
   the light (and the red team), steel blue is the shadow
   (and the blue team). All colours in oklch().
   ========================================================= */


/* =========================================================
   1. BASE STYLES: reset, theme, typography
   ========================================================= */

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

/* Theme: colours, fonts and spacing */
:root {
  --umber-950: oklch(0.14 0.01 55);
  --umber-900: oklch(0.17 0.012 60);
  --umber-850: oklch(0.2 0.013 60);
  --umber-800: oklch(0.235 0.014 60);
  --umber-700: oklch(0.29 0.016 60);
  --line: oklch(0.37 0.02 60);
  --bone: oklch(0.94 0.015 75);
  --sand: oklch(0.78 0.025 70);
  --gold: oklch(0.83 0.12 75);
  --gold-glow: oklch(0.83 0.12 75 / 0.35);
  --gold-ring: oklch(0.83 0.12 75 / 0.25);
  --gold-haze: oklch(0.83 0.12 75 / 0.15);
  --steel-dim: oklch(0.78 0.07 250 / 0.45);
  --umber-glass: oklch(0.14 0.01 55 / 0.94);
  --umber-veil: oklch(0.14 0.01 55 / 0.7);
  --steel: oklch(0.78 0.07 250);
  --shadow: oklch(0.08 0.01 55 / 0.6);

  /* Condensed DIN-style display face from system fonts */
  --font-display: "DIN Condensed", "Bahnschrift", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(4rem, 9vw, 7rem);
  --radius: 0.5rem;
  --header-height: 4rem;
}

html {
  scroll-behavior: smooth;
}

/* Readable text for the whole page */
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--bone);
  background-color: var(--umber-900);
}

/* Group selector: headings share the condensed display face */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

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

a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Shared layout helpers */
.container {
  width: min(100% - 2rem, 70rem);
  margin: 0 auto;
}

.section {
  padding-block: var(--space-xl);
  scroll-margin-top: var(--header-height);
}

/* Descendant selector: every section heading */
.section .section-title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  text-transform: uppercase;
  margin-bottom: var(--space-l);
}

/* Gold button used in the hero and the form */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background-color: var(--gold);
  color: var(--umber-950);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background-color: transparent;
  color: var(--gold);
}


/* =========================================================
   2. NAVBAR: name left, links right, sticky, Flexbox
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--umber-glass);
  border-bottom: 1px solid var(--umber-700);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem var(--space-s);
  width: min(100% - 2rem, 70rem);
  min-height: var(--header-height);
  margin: 0 auto;
  padding-block: 0.4rem;
}

.brand {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
}

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

.nav-links a {
  display: block;
  padding: 0.35rem clamp(0.35rem, 1.4vw, 0.85rem);
  border-radius: 0.3rem;
  color: var(--sand);
  font-size: clamp(0.85rem, 2.6vw, 0.95rem);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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


/* =========================================================
   3. HERO: name and role centred in a band of light
   ========================================================= */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(30rem, 76vh, 42rem);
  padding: var(--space-xl) var(--space-s);
  overflow: hidden;
  text-align: center;
  /* Film-grain photo texture over a dark gradient */
  background-image:
    url("../images/grain.svg"),
    linear-gradient(180deg, var(--umber-950), var(--umber-900));
  background-position: center;
  background-size: cover;
}

/* The band of light that falls across the name, like across the eyes in the portrait */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    174deg,
    transparent 22%,
    oklch(0.83 0.12 75 / 0.06) 28%,
    oklch(0.84 0.12 76 / 0.22) 33%,
    oklch(0.9 0.08 80 / 0.3) 36%,
    oklch(0.84 0.12 76 / 0.22) 39%,
    oklch(0.83 0.12 75 / 0.06) 44%,
    transparent 50%
  );
  animation: light-in 1.8s ease-out both;
}

@keyframes light-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Content sits above the light */
.hero-content {
  position: relative;
  max-width: 48rem;
}

.hero h1 {
  font-size: clamp(3.75rem, 15vw, 9.5rem);
  line-height: 0.88;
  text-transform: uppercase;
  color: var(--bone);
  text-shadow: 0 0 2.5rem var(--gold-glow), 0 0.3rem 1rem var(--shadow);
}

.hero-role {
  max-width: 32rem;
  margin: var(--space-m) auto var(--space-l);
  color: var(--sand);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.5;
  text-shadow: 0 0.1rem 0.5rem var(--shadow);
}

/* Badge pinned to the top-right corner */
.badge {
  position: absolute;
  top: var(--space-s);
  right: var(--space-s);
  z-index: 1;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--steel);
  border-radius: 999px;
  background-color: var(--umber-veil);
  color: var(--steel);
  font-size: 0.85rem;
  font-weight: 600;
}


/* =========================================================
   4. ABOUT: bio wrapping around a round, floated photo
   ========================================================= */

/* Centred reading column */
.narrow {
  max-width: 40rem;
  margin: 0 auto;
}

.about .section-title {
  text-align: center;
}

/* flow-root contains the floated photo */
.about-text {
  display: flow-root;
  text-align: left;
  color: var(--sand);
}

.about-text p + p {
  margin-top: var(--space-s);
}

.about-photo {
  float: left;
  width: 42%;
  max-width: 14rem;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 22%;
  margin: 0 var(--space-m) var(--space-s) 0;
  border: 3px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 2.5rem var(--gold-glow);
}

/* Large first letter of each paragraph */
.about-text p::first-letter {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 0.8;
}


/* =========================================================
   5. CV: timeline beside grouped skill tags
   ========================================================= */

.cv {
  background-color: var(--umber-850);
}

/* Two columns that wrap on narrow screens */
.cv-layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-l) clamp(2rem, 6vw, 5rem);
}

.cv-timeline {
  flex: 3 1 22rem;
}

.cv-skills {
  flex: 2 1 18rem;
}

/* Timeline line */
.timeline {
  list-style: none;
  border-left: 2px solid var(--line);
  padding-left: var(--space-m);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-l);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot on the line for each entry */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: calc(-1 * var(--space-m) - 0.5rem - 1px);
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--steel);
  border-radius: 50%;
  background-color: var(--umber-850);
}

/* Current roles get a lit, gold dot */
.timeline-item.is-current::before {
  border-color: var(--gold);
  background-color: var(--gold);
  box-shadow: 0 0 0.8rem var(--gold-glow);
}

.timeline-item h3 {
  font-size: 1.6rem;
  text-transform: uppercase;
}

.timeline-meta {
  margin-block: 0.3rem 0.5rem;
  color: var(--steel);
  font-size: 0.9rem;
}

.timeline-meta strong {
  color: var(--gold);
  font-weight: 700;
}

.timeline-item p:last-child {
  color: var(--sand);
  max-width: 34rem;
}

/* Tag groups */
.tag-heading {
  margin-bottom: 0.75rem;
  color: var(--sand);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: var(--space-l);
}

.tags:last-child {
  margin-bottom: 0;
}

.tags li {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--umber-800);
  color: var(--bone);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Tools are on the "blue" side */
.tags-tools li {
  border-color: var(--steel-dim);
  color: var(--steel);
}


/* =========================================================
   6. PROJECTS: auto-fit card grid, cards lift on hover
   ========================================================= */

/* Reflows with no media queries */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-m);
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--umber-700);
  border-radius: var(--radius);
  background-color: var(--umber-800);
  box-shadow: 0 0.3rem 0.8rem var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-0.4rem);
  border-color: var(--gold);
  box-shadow: 0 1.2rem 2.5rem var(--shadow), 0 0 1.5rem var(--gold-haze);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--umber-700);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.75rem;
  padding: var(--space-m);
}

.card-body h3 {
  font-size: 1.6rem;
  text-transform: uppercase;
}

.card-body p {
  flex-grow: 1;
  color: var(--sand);
  font-size: 0.95rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.card-tags li {
  padding: 0.15rem 0.6rem;
  border-radius: 0.3rem;
  background-color: var(--umber-700);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Alternate cards switch their tags to the steel "blue team" tone */
.card:nth-child(even) .card-tags li {
  color: var(--steel);
}

.card-body a {
  font-size: 0.95rem;
  font-weight: 700;
}


/* =========================================================
   7. CONTACT AND FOOTER: form grid, footer flex, fixed button
   ========================================================= */

.contact {
  background-color: var(--umber-850);
}

/* Details beside the form */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-l) clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contact-details > p {
  max-width: 28rem;
  margin-bottom: var(--space-l);
  color: var(--sand);
}

.contact-list {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.6rem var(--space-m);
}

.contact-list dt {
  color: var(--steel);
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Form: Name and Email share a row */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-s);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--umber-700);
  border-radius: var(--radius);
  background-color: var(--umber-900);
}

.field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

/* Message and button span both columns */
.field-wide,
.btn-wide {
  grid-column: 1 / -1;
}

.field label {
  color: var(--sand);
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background-color: var(--umber-800);
  color: var(--bone);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
}

/* Email field marked with a steel edge */
input[type="email"] {
  border-left: 3px solid var(--steel);
}

/* Focus: gold border and glow */
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-ring);
}

/* Footer: three columns with Flexbox */
.site-footer {
  border-top: 1px solid var(--umber-700);
  background-color: var(--umber-950);
  padding-block: var(--space-l) calc(var(--space-l) + 2.5rem);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-l);
  width: min(100% - 2rem, 70rem);
  margin: 0 auto;
}

.footer-col {
  flex: 1;
  min-width: min(100%, 13rem);
}

.footer-col h2 {
  margin-bottom: var(--space-xs);
  color: var(--gold);
  font-size: 1.3rem;
  text-transform: uppercase;
}

.footer-col p {
  color: var(--sand);
  font-size: 0.9rem;
}

.footer-col a {
  color: var(--bone);
  overflow-wrap: anywhere;
}

/* Back to top button fixed to the bottom-right corner */
.to-top {
  position: fixed;
  right: var(--space-s);
  bottom: var(--space-s);
  z-index: 50;
  padding: 0.55rem 1rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background-color: var(--umber-950);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0.3rem 1rem var(--shadow);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.to-top:hover {
  background-color: var(--gold);
  color: var(--umber-950);
}
