/* ==========================================================================
   Malik Mir Hamza Nayab — Academic & Engineering Portfolio
   Design System & Main Stylesheet (Owlstown Argyle Theme Style)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   Design Tokens & CSS Custom Properties (Owlstown Argyle Palette)
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --blt-font-base: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors matching Owlstown Argyle Theme */
  --theme-link-color: #b12b32;
  --theme-link-hover-color: #8c1d22;
  --theme-header-background-color: #f0f0f0;
  --theme-header-text-color: #212121;
  --theme-header-link-color: #212121;
  --theme-footer-background-color: #f0f0f0;
  --theme-footer-text-color: #212121;
  --theme-footer-link-color: #212121;

  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8f9fa;
  --color-surface-hover: #f1f5f9;

  --color-text: #212121;
  --color-text-muted: #555555;
  --color-text-light: #718096;

  --color-border: #e0e0e0;
  --color-border-subtle: #eeeeee;
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s ease;
}

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

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

body {
  font-family: var(--blt-font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--theme-link-color);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid #000000;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.3;
}

.blt-h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.blt-h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.5rem; }
.blt-h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.35rem; }
.blt-h4 { font-size: 1.1rem; color: var(--color-text-muted); font-weight: 400; line-height: 1.55; }
.blt-p  { font-size: 0.96rem; color: var(--color-text); margin-bottom: 0.75rem; }
.blt-weight-bold { font-weight: 700; }
.blt-align-center { text-align: center; }

p {
  margin-bottom: 1rem;
  color: var(--color-text);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--theme-link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--theme-link-hover-color);
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}
hr.space-xs { margin: 8px 0; }
hr.space-sm { margin: 14px 0; }
hr.space-md { margin: 24px 0; }
hr.space-lg { margin: 36px 0; }
hr.space-xl { margin: 48px 0; }

/* --------------------------------------------------------------------------
   Owlstown Argyle Header & Navigation
   -------------------------------------------------------------------------- */
.argyle-header {
  background-color: var(--theme-header-background-color);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.argyle-header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.argyle-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.argyle-brand-monogram {
  width: 32px;
  height: 32px;
  background-color: var(--theme-link-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.argyle-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--theme-header-text-color);
  text-decoration: none;
}
.argyle-brand-title:hover {
  text-decoration: none;
  color: var(--theme-link-color);
}

/* Nav links */
.argyle-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-navlinks2-item-link {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--theme-header-link-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.theme-navlinks2-item-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--theme-link-color);
  text-decoration: none;
}

.theme-navlinks2-item.is-active .theme-navlinks2-item-link {
  color: var(--theme-link-color);
  border-bottom: 2px solid var(--theme-link-color);
  background-color: rgba(177, 43, 50, 0.06);
}

/* Mobile Hamburger Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--theme-header-text-color);
}
.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  background-color: var(--theme-header-background-color);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
}
.mobile-nav-drawer.open {
  display: flex;
}
.mobile-nav-drawer .theme-navlinks2-item-link {
  padding: 10px 12px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Owlstown Banner Section
   -------------------------------------------------------------------------- */
.argyle-banner {
  height: 220px;
  background-image: url('../img/banner.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.argyle-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.22) 100%);
}

.argyle-banner-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(#ffffff 1px, transparent 1px);
  background-size: 16px 16px;
}

/* --------------------------------------------------------------------------
   Main 2-Column Grid Layout
   -------------------------------------------------------------------------- */
.argyle-main {
  flex: 1;
}

.argyle-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 40px 20px;
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 36px;
}

/* Left Sidebar */
.argyle-sidebar {
  display: flex;
  flex-direction: column;
}

.argyle-site-picture-frame {
  margin-top: -120px;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

.theme-site-avatar-picture {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
  background-color: #ffffff;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.theme-site-avatar-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.argyle-content {
  min-width: 0;
  padding-top: 32px;
}

.theme-contact-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
  margin-bottom: 4px;
}

.theme-contact-role {
  font-size: 0.94rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.theme-contact-affiliation {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text);
}

.theme-contact-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}
.theme-contact-location svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Social Links List */
.theme-contact-social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.theme-contact-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.theme-contact-social-link-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.theme-contact-social-link-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.theme-contact-social-link-text a {
  color: var(--color-text);
  font-weight: 500;
}
.theme-contact-social-link-text a:hover {
  color: var(--theme-link-color);
}

/* Right Main Content Area */
.argyle-content {
  min-width: 0; /* Prevents overflow in grid */
}

.theme-content-title {
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   Owlstown Form Styling (Contact Form)
   -------------------------------------------------------------------------- */
.theme-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.theme-form .form-group {
  margin-bottom: 18px;
}

label.blt-p {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.theme-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--blt-font-base);
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.theme-input:focus {
  outline: none;
  border-color: var(--theme-link-color);
  box-shadow: 0 0 0 3px rgba(177, 43, 50, 0.15);
}

textarea.theme-input {
  resize: vertical;
  min-height: 150px;
  line-height: 1.5;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--theme-link-color);
  color: #ffffff;
  font-family: var(--blt-font-base);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.theme-btn:hover {
  background-color: var(--theme-link-hover-color);
  color: #ffffff;
  text-decoration: none;
}

.theme-btn:active {
  transform: translateY(1px);
}

.theme-btn-secondary {
  background-color: #f1f5f9;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.theme-btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Cards, Badges & Highlight Grids
   -------------------------------------------------------------------------- */
.academic-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.academic-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}
.card-title a {
  color: var(--color-text);
}
.card-title a:hover {
  color: var(--theme-link-color);
}

.card-status-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.card-status-badge.review {
  background-color: #fffbe6;
  color: #d97706;
  border: 1px solid #fef08a;
}
.card-status-badge.live {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.card-meta-line {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.card-bullets {
  padding-left: 20px;
  margin-bottom: 14px;
  font-size: 0.93rem;
}
.card-bullets li {
  margin-bottom: 6px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  font-size: 0.8rem;
  font-weight: 500;
  background-color: #f1f5f9;
  color: #334155;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

/* Highlights Metric Grid */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.highlight-box {
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.highlight-metric {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--theme-link-color);
  display: block;
  line-height: 1.2;
}

.highlight-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
  display: block;
  margin-top: 4px;
}

.highlight-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* Contact Cards Grid */
.contact-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: rgba(177, 43, 50, 0.08);
  color: var(--theme-link-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-card-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.contact-card-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.contact-card-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   Owlstown Footer
   -------------------------------------------------------------------------- */
.argyle-footer {
  background-color: var(--theme-footer-background-color);
  border-top: 1px solid var(--color-border);
  padding: 32px 20px;
  text-align: center;
  margin-top: 48px;
}

.argyle-footer-container {
  max-width: 1140px;
  margin: 0 auto;
}

.argyle-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  list-style: none;
  font-size: 0.9rem;
}

.argyle-footer-links a {
  color: var(--theme-footer-link-color);
  font-weight: 500;
}
.argyle-footer-links a:hover {
  color: var(--theme-link-color);
}

/* --------------------------------------------------------------------------
   Owlstown Floating Tools Button
   -------------------------------------------------------------------------- */
.theme-tools-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
}

.theme-tools-btn {
  background-color: #212121;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.2s, background-color 0.2s;
}
.theme-tools-btn:hover {
  background-color: var(--theme-link-color);
  transform: translateY(-2px);
}

.theme-tools-menu {
  display: none;
  position: absolute;
  bottom: 45px;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  width: 160px;
  overflow: hidden;
  flex-direction: column;
}
.theme-tools-menu.active {
  display: flex;
}

.theme-tools-menu-item {
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--color-text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.theme-tools-menu-item:hover {
  background-color: #f1f5f9;
  color: var(--theme-link-color);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 840px) {
  .argyle-banner {
    height: 160px;
  }

  .argyle-container {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 16px 24px 16px;
  }

  .argyle-sidebar {
    align-items: center;
    text-align: center;
  }

  .argyle-site-picture-frame {
    margin-top: -80px;
    max-width: 180px;
    width: 100%;
  }

  .theme-site-avatar-picture {
    max-width: 180px;
  }

  .theme-contact-social-links {
    align-items: center;
  }

  .argyle-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .card-header-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}
