/* ==========================================================================
   Abdulwahid Ali Portfolio (abdulwahid.et)
   Design System: Clean, Minimalist, Responsive & Editorial
   ========================================================================== */

:root {
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  /* Dark Theme (Default) */
  --bg: #090a0d;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.045);
  --bg-tag: #14161b;
  --bg-badge: #121418;

  --text: #f0f2f5;
  --text-muted: #8b929d;
  --text-faint: #565d68;

  --border: #1e2229;
  --border-subtle: #16181f;
  --border-hover: #2e3540;

  --accent-cyan: #38bdf8;
  --status-green: #10b981;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-card: rgba(0, 0, 0, 0.015);
  --bg-card-hover: rgba(0, 0, 0, 0.035);
  --bg-tag: #f1f3f5;
  --bg-badge: #eef0f3;

  --text: #111418;
  --text-muted: #5e6673;
  --text-faint: #8d95a3;

  --border: #e5e8ec;
  --border-subtle: #edf0f4;
  --border-hover: #cbd2dc;

  --accent-cyan: #0284c7;
  --status-green: #059669;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  min-height: 100vh;
  position: relative;
}

/* Fluid responsive container */
.page-container {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 1.75rem);
}

/* Header */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.name {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}

.role-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: clamp(0.85rem, 2.5vw, 0.925rem);
  color: var(--text-muted);
  font-weight: 400;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-green);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.domain-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-badge);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.01em;
}

.theme-btn {
  background: var(--bg-badge);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.theme-btn svg {
  transition: transform var(--transition-fast);
}

.theme-btn:active svg {
  transform: scale(0.88);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Intro / Bio */
.intro-section {
  margin-bottom: clamp(2.75rem, 6vw, 3.75rem);
}

.lead-text {
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 1.15rem;
}

.sub-text {
  font-size: clamp(0.925rem, 2vw, 1rem);
  line-height: 1.7;
  color: var(--text-muted);
}

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

/* Sections */
.section {
  margin-bottom: clamp(2.75rem, 6vw, 3.75rem);
}

.section-title {
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Timeline (Experience) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 3px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text-faint);
}

.timeline-item.current::after {
  background: var(--status-green);
  border-color: var(--status-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-faint);
  letter-spacing: -0.01em;
}

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-badge);
  border: 1px solid var(--border);
  color: var(--text);
}

.timeline-badge-subtle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  color: var(--text-faint);
  background: var(--bg-badge);
  border: 1px solid var(--border-subtle);
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}

.timeline-company {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.15rem;
  margin-bottom: 0.25rem;
}

.timeline-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-desc strong {
  color: var(--text);
  font-weight: 500;
}

/* Projects */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.project-item {
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.project-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.project-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.project-name {
  font-size: 1.025rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-faint);
  background: var(--bg-tag);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.project-desc {
  font-size: 0.9125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

.project-stack {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-faint);
  letter-spacing: -0.01em;
}

/* Education & Honors */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 580px) {
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

.edu-card {
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.edu-card:hover {
  border-color: var(--border-hover);
}

.edu-degree {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.edu-school {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.edu-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.4rem;
}

.honors-note {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

/* Capabilities Matrix */
.stack-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.25rem 0;
}

.stack-group {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: baseline;
  font-size: 0.9125rem;
}

@media (max-width: 540px) {
  .stack-group {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 500;
}

.stack-items {
  color: var(--text-muted);
  line-height: 1.55;
}

/* Contact Section */
.contact-section {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.contact-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  background: var(--bg-badge);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.email-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.email-btn:active {
  transform: scale(0.99);
}

.email-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.copy-badge {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-faint);
  background: var(--bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.email-btn:hover .copy-badge {
  color: var(--text);
  border-color: var(--border-hover);
}

.social-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.link-item {
  color: var(--text-muted);
  font-size: 0.9125rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--transition-fast);
  padding: 0.25rem 0;
}

.link-item .arrow {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: transform var(--transition-fast);
}

.link-item:hover {
  color: var(--text);
}

.link-item:hover .arrow {
  transform: translate(2px, -2px);
}

/* Footer */
.site-footer {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-faint);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Keyboard accessibility */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .theme-btn, .header-actions, .toast, .copy-badge {
    display: none !important;
  }
  .page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .project-item, .edu-card {
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}
