/* Hadhi Tech — Heritage-Tech Synthesis design system */
:root {
  --surface: #fbf9f4;
  --surface-container: #f0eee9;
  --surface-container-low: #f5f3ee;
  --paper: #fcfaf7;
  --on-surface: #1b1c19;
  --on-surface-variant: #56423e;
  --outline: #89726d;
  --outline-variant: #ddc0ba;
  --primary: #6d1b0b;
  --secondary: #016a6a;

  --font-headline: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-label: "IBM Plex Sans", sans-serif;

  --container-max: 1280px;
  --margin: 20px;
  --section-gap: 120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--margin);
  padding-right: var(--margin);
}

h1, h2, h3, h4 { font-family: var(--font-headline); }

.label {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.muted { color: var(--on-surface-variant); }

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

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid rgba(221, 192, 186, 0.3);
}

.topnav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.brand {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

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

.nav-link {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  padding-bottom: 4px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero-banner {
  width: 100%;
  height: 240px;
  overflow: hidden;
}
.hero-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-content {
  margin-top: -96px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-pfp {
  width: 192px;
  height: 192px;
  border-radius: 50%;
  border: 8px solid var(--surface);
  overflow: hidden;
  background: var(--surface-container);
  box-shadow: 0 1px 3px rgba(61, 30, 22, 0.1);
}
.hero-pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-text { margin-top: 32px; }

.display {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 8px;
}

/* ---------- Sections ---------- */
.section { padding-top: var(--section-gap); padding-bottom: var(--section-gap); }

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 64px;
}
.section-heading h2 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.rule { flex-grow: 1; height: 1px; background: rgba(221, 192, 186, 0.5); }

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.project-card {
  max-width: 80%;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid rgba(221, 192, 186, 0.3);
  overflow: hidden;
  border-radius: 0.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 20px -5px rgba(109, 27, 11, 0.08);
}

.project-image { overflow: hidden; }
.project-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s;
}
.project-card:hover .project-image img { transform: scale(1.05); }

.project-body { padding: 26px; }

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.chip {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--secondary);
  border: 1px solid var(--secondary);
  padding: 4px 12px;
}

.project-body h3 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary);
  margin-bottom: 16px;
}

.project-desc {
  font-size: 18px;
  color: var(--on-surface-variant);
  max-width: 42rem;
  margin-bottom: 32px;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--surface);
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  border-radius: 0.25rem;
  transition: opacity 0.2s;
}
.btn-solid:hover { opacity: 0.9; }
.btn-solid .arrow { transition: transform 0.2s; }
.btn-solid:hover .arrow { transform: translateX(4px); }

/* ---------- Connect modal ---------- */
.connect-modal {
  border: 1px solid var(--outline-variant);
  border-radius: 0.25rem;
  background: var(--surface);
  color: var(--on-surface);
  padding: 32px;
  width: min(480px, calc(100vw - 40px));
  margin: auto;
}
.connect-modal::backdrop { background: rgba(27, 28, 25, 0.5); }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-head h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--on-surface-variant);
  cursor: pointer;
}
.modal-close:hover { color: var(--primary); }

.modal-email { margin-top: 24px; }
.modal-email a {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--on-surface);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.modal-email a:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid rgba(221, 192, 186, 0.3);
  padding: 64px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.brand-name {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
}

.footer-social a {
  display: inline-flex;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--primary); }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  :root { --margin: 64px; }

  .hero-banner { height: 320px; }
  .hero-content { align-items: flex-start; text-align: left; }
  .display { font-size: 64px; }
  .section-heading h2 { font-size: 48px; }

  .footer-inner { flex-direction: row; justify-content: space-between; }
  .footer-brand { align-items: flex-start; }
}

@media (min-width: 1024px) {
  .project-body { padding: 38px; }
}

/* ---------- Mobile nav ---------- */
@media (max-width: 767px) {
  .nav-link:not(.nav-btn) { display: none; }
}
