/**
 * Hafiz Muhammad Usman Khan Portfolio - Design System & Core Styles
 * 100% Faithful UI/UX - Dark Aesthetic with Vibrant Orange Accents
 */

:root {
  --bg: #0a0a0b;
  --bg-alt: #131313;
  --panel: #181818;
  --line: #2a2a29;
  --text: #f3efe7;
  --text-dim: #94918a;
  --orange: #ff5a1f;
  --orange-light: #ff9152;
  --orange-deep: #a83b12;
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--orange);
  color: #0a0a0b;
}

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

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

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--orange);
  display: inline-block;
}

/* ---------- BUTTONS ---------- */
.btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  letter-spacing: .05em;
  padding: 11px 20px;
  border-radius: 100px;
  border: 1px solid var(--orange);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .3s var(--ease);
  white-space: nowrap;
}

.btn.solid {
  background: var(--orange);
  color: #0a0a0b;
  border-color: var(--orange);
}

.btn.solid:hover {
  background: var(--orange-light);
  border-color: var(--orange-light);
  transform: translateY(-2px);
}

.btn:not(.solid):hover {
  background: rgba(255, 90, 31, .1);
  transform: translateY(-2px);
}

/* ---------- HEADER & NAVIGATION ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: linear-gradient(to bottom, rgba(10, 10, 11, .9), rgba(10, 10, 11, 0));
  backdrop-filter: blur(6px);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange);
}

.logo .khan {
  color: var(--orange);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
}

nav a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color .25s var(--ease);
  position: relative;
}

nav a:hover {
  color: var(--text);
}

nav a.active {
  color: var(--orange);
}

.nav-cta {
  display: none;
}

@media (min-width: 820px) {
  .nav-cta {
    display: inline-flex;
  }
}

@media (max-width: 819px) {
  header nav {
    display: none;
  }
}

/* ---------- DESKTOP DROPDOWN ---------- */
nav li.has-dropdown {
  position: relative;
}

nav li.has-dropdown > a::after {
  content: '⌄';
  font-size: 10px;
  margin-left: 5px;
  opacity: .6;
}

.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .75);
  z-index: 120;
}

nav li.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: background .2s, color .2s;
}

.dropdown a:hover {
  background: rgba(255, 90, 31, .1);
  color: var(--text);
}

/* ---------- MOBILE MENU ---------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 110;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 819px) {
  .menu-toggle {
    display: flex;
  }
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 104px 32px 44px;
  display: flex;
  flex-direction: column;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: transform .35s var(--ease), opacity .3s var(--ease), visibility .35s;
  max-height: 100svh;
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu ul li {
  border-bottom: 1px solid var(--line);
}

.mobile-menu a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  color: var(--text);
  display: block;
  padding: 16px 2px;
  transition: color .25s var(--ease);
}

.mobile-menu a:hover {
  color: var(--orange);
}

.mobile-menu a.active {
  color: var(--orange);
}

.mobile-menu .btn {
  align-self: flex-start;
  margin-top: 26px;
}

.mobile-has-sub {
  display: flex;
  flex-direction: column;
}

.mobile-parent-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-parent-link a {
  flex: 1;
}

.mobile-sub-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 8px 10px;
  transition: transform .3s var(--ease), color .3s var(--ease);
}

.mobile-sub-toggle.open {
  transform: rotate(180deg);
  color: var(--orange);
}

.mobile-submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
  padding-left: 14px;
}

.mobile-submenu.open {
  max-height: 500px;
}

.mobile-submenu li {
  border-bottom: none !important;
}

.mobile-submenu a {
  font-size: 16px;
  padding: 9px 2px;
  color: var(--text-dim);
}

.mobile-submenu a:hover {
  color: var(--orange);
}

/* ---------- SHARED CTA SECTION ---------- */
.cta {
  text-align: center;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  padding: 120px 0;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 700px 300px at 50% 100%, rgba(255, 90, 31, .18), transparent 70%);
}

.cta h2 {
  font-size: clamp(30px, 5vw, 58px);
  max-width: 760px;
  margin: 0 auto 30px;
  position: relative;
}

.cta h2 em {
  font-style: normal;
  color: var(--orange);
}

.cta .btn-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ---------- SHARED STATS STRIP ---------- */
.stats-strip {
  padding: 60px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-strip .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 34px;
}

.stats-strip div {
  position: relative;
  padding-left: 18px;
}

.stats-strip div::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 5px;
  width: 1px;
  background: var(--line);
}

.stats-strip b {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  display: block;
  color: var(--orange);
}

.stats-strip span {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .03em;
}

/* ---------- CONTACT SECTION & FORM ---------- */
.contact-section {
  padding: 120px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 60px;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-section {
    padding: 90px 0;
  }
}

.contact-info h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 20px;
}

.contact-info > p {
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 34px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-detail .dot2 {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
  flex-shrink: 0;
}

.contact-detail .label {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 3px;
  letter-spacing: .06em;
}

.contact-detail a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14.5px;
  color: var(--text);
  transition: color .25s var(--ease);
}

.contact-detail a:hover {
  color: var(--orange);
}

.contact-form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 520px) {
  .contact-form-panel {
    padding: 26px;
  }
}

.contact-form-panel::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 220px;
  height: 220px;
  background: var(--orange);
  filter: blur(110px);
  opacity: .22;
  border-radius: 50%;
  pointer-events: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  margin-bottom: 18px;
  position: relative;
}

.form-field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #5c5952;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, .15);
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
  font-family: 'Inter', sans-serif;
}

.form-submit {
  width: 100%;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 15px 20px;
  position: relative;
}

.form-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.form-note {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

.form-status {
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
  display: none;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}

.form-status.success {
  color: #51cf66;
  background: rgba(81, 207, 102, 0.1);
  border: 1px solid rgba(81, 207, 102, 0.25);
  display: block;
}

.form-status.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  display: block;
}

/* ---------- FOOTER ---------- */
footer {
  padding: 50px 0 40px;
}

.foot-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.foot-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.foot-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color .25s;
}

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

.foot-copy {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- REVEAL ANIMATION ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE GLOBAL OVERRIDES ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 20px;
  }
  header {
    padding: 18px 20px;
  }
}
