/* ==========================================================================
   Design System — tayyabcheema.com
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F3F0EB;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-body: #3A3A3A;
  --text-muted: #8A8578;
  --accent: #1A6B5A;
  --accent-hover: #145A4A;
  --accent-light: rgba(26, 107, 90, 0.08);
  --border: #E8E4DF;
  --border-hover: #D0CBC3;

  --font-heading: 'Instrument Serif', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --fs-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  --fs-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
  --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --fs-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --fs-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --fs-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.75rem);
  --fs-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  --max-width: 1120px;
  --nav-height: 64px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-body);
  background-color: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 400;
}

::selection {
  background-color: var(--accent);
  color: #fff;
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-lg);
}

/* --- Animated Link Underline --- */
.link-underline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
  padding-bottom: 2px;
}

.link-underline:hover {
  background-size: 100% 2px;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--text-primary);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: var(--fs-sm);
  color: var(--text-body);
  font-weight: 600;
  transition: color 0.2s;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary,
a.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent-light);
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + var(--space-4xl));
  padding-bottom: var(--space-4xl);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.hero-photo-initials {
  font-family: var(--font-heading);
  font-size: 4rem;
  color: #fff;
  line-height: 1;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-content {
  text-align: center;
}

.hero-name {
  font-size: var(--fs-4xl);
  margin-bottom: var(--space-md);
}

.hero-taglines {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  justify-content: center;
}

.hero-tag {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  background-color: var(--accent-light);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

.hero-oneliner {
  font-size: var(--fs-xl);
  color: var(--text-body);
  max-width: 560px;
  line-height: 1.5;
  margin: 0 auto var(--space-xl);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Newsletter --- */
.newsletter {
  background-color: var(--bg-secondary);
}

.newsletter .container {
  max-width: 640px;
  text-align: center;
}

.newsletter-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-md);
}

.newsletter-desc {
  color: var(--text-body);
  margin-bottom: var(--space-xl);
  line-height: 1.65;
}

.newsletter-form {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.2s;
  outline: none;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.newsletter-trust {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.newsletter-social-proof {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.newsletter-success {
  padding: var(--space-lg);
  background: var(--accent-light);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-lg);
}

/* --- About --- */
.about .container {
  max-width: 680px;
}

.about-text {
  font-size: calc(var(--fs-base) + 1px);
  line-height: 1.7;
  color: var(--text-body);
}

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

.about-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Featured Work --- */
.work-list {
  list-style: none;
}

.work-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
  transition: transform 0.2s;
}

.work-item:first-child {
  padding-top: 0;
}

.work-item:last-child {
  border-bottom: none;
}

.work-item:hover {
  transform: translateX(4px);
}

.work-item-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--text-primary);
}

.work-item-tag {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Ventures --- */
.ventures {
  background-color: var(--bg-secondary);
}

.ventures-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.venture-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.venture-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.venture-card-name {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.venture-card-desc {
  color: var(--text-body);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* --- Research --- */
.research {
  background-color: var(--bg-primary);
}

.research-header {
  margin-bottom: var(--space-2xl);
}

.research-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.research-dissertation {
  font-size: var(--fs-lg);
  color: var(--text-body);
  line-height: 1.6;
  margin-top: var(--space-md);
  max-width: 680px;
}

.research-stat {
  background-color: var(--accent-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin: var(--space-2xl) 0;
  text-align: center;
}

.research-stat-number {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 2.5rem + 2.5vw, 4rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.research-stat-label {
  font-size: var(--fs-base);
  color: var(--text-body);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.research-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.research-links a {
  font-weight: 600;
  font-size: var(--fs-sm);
}

/* --- Connect --- */
.connect {
  background-color: var(--bg-secondary);
}

.connect-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.connect-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--text-body);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background-color 0.2s;
}

.connect-link:hover {
  color: var(--accent);
  background-color: var(--accent-light);
}

.connect-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Footer --- */
.footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer .container {
  max-width: 640px;
  text-align: center;
}

.footer-newsletter-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-md);
}

.footer-newsletter-form {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.footer-newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.2s;
  outline: none;
}

.footer-newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.footer-newsletter-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.footer-copy {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-copy a {
  color: var(--text-muted);
}

.footer-copy a:hover {
  color: var(--accent);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile Nav Toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* 640px+ */
@media (min-width: 640px) {
  .newsletter-form {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-newsletter-form {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-2xl);
  }

  .ventures-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 768px+ */
@media (min-width: 768px) {
  .hero .container {
    grid-template-columns: 240px 1fr;
    gap: var(--space-3xl);
    text-align: left;
  }

  .hero-content {
    text-align: left;
  }

  .hero-photo {
    width: 240px;
    height: 240px;
    margin: 0;
  }

  .hero-taglines {
    justify-content: flex-start;
  }

  .hero-oneliner {
    margin-left: 0;
  }

  .hero-cta {
    justify-content: flex-start;
  }

  .work-item-title {
    font-size: var(--fs-2xl);
  }
}

/* 1024px+ */
@media (min-width: 1024px) {
  .hero .container {
    grid-template-columns: 280px 1fr;
  }

  .hero-photo {
    width: 280px;
    height: 280px;
  }

  .hero-photo-initials {
    font-size: 5.5rem;
  }
}

/* Mobile: <=768px nav */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .nav-links.open {
    display: flex;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-newsletter-form {
    flex-direction: column;
  }
}
