/* =========================================================================
   ziafoisal.cloud — Professional Portfolio
   Design: Clean, formal, clutter-free
   Colors: Deep teal/navy (#0f2a3f), Warm slate (#4a5568), Amber (#d69e2e)
   ========================================================================= */

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

:root {
  --color-primary: #0f2a3f;
  --color-primary-light: #1a405e;
  --color-primary-dark: #091e2c;
  --color-accent: #d69e2e;
  --color-accent-light: #ecc55a;
  --color-accent-dark: #b8860b;
  --color-slate: #4a5568;
  --color-slate-light: #718096;
  --color-bg: #f7fafc;
  --color-bg-alt: #edf2f7;
  --color-white: #ffffff;
  --color-text: #1a202c;
  --color-text-light: #4a5568;
  --color-border: #e2e8f0;
  --color-success: #38a169;
  --color-danger: #e53e3e;

  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Menlo', 'Consolas', monospace;

  --max-width: 1100px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Typography --------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
}
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

/* --- Utilities ---------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}
.section-alt {
  background: var(--color-bg-alt);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}
.btn-accent:hover {
  background: var(--color-accent-light);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
}

/* --- Header / Navigation ------------------------------------------------ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.header.scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.header-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  text-decoration: none;
}
.header-logo:hover {
  color: var(--color-accent);
}

.nav-list {
  display: flex;
  gap: 4px;
  list-style: none;
}
.nav-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* --- Hero Section ------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(214,158,46,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 3rem;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}
.hero .title {
  font-size: 1.25rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 1rem;
}
.hero .tagline {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  max-width: 650px;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.hero-actions .btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--color-white);
}
.hero-actions .btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}
.hero-meta a {
  color: rgba(255,255,255,0.8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-meta a:hover {
  color: var(--color-accent);
}
.hero-meta .icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* --- About Section ------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.about-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-light);
}

.info-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.info-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card h3 .icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.info-row:last-child {
  border-bottom: none;
}
.info-row .label {
  color: var(--color-text-light);
  font-weight: 500;
}
.info-row .value {
  text-align: right;
}

.language-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-bg-alt);
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 0 4px 8px 0;
}
.language-tag .level {
  color: var(--color-text-light);
  font-size: 0.8rem;
}

/* --- Experience Timeline ------------------------------------------------ */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 24px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-header {
  margin-bottom: 8px;
}
.timeline-role {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}
.timeline-org {
  font-size: 0.95rem;
  color: var(--color-accent);
  font-weight: 500;
}
.timeline-org a {
  color: var(--color-accent);
}
.timeline-org a:hover {
  color: var(--color-accent-dark);
}
.timeline-period {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 2px;
}
.timeline-body {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.7;
}
.timeline-body ul {
  list-style: none;
  padding: 0;
}
.timeline-body li {
  position: relative;
  padding: 4px 0 4px 20px;
}
.timeline-body li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}
.timeline-body a {
  font-weight: 500;
}

/* --- Skills ------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
}

.skill-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.skill-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.skill-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.skill-card-header .icon {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}
.skill-card h3 {
  font-size: 1rem;
  margin: 0;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-bg-alt);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--color-text);
  font-weight: 500;
}

/* --- Projects ----------------------------------------------------------- */
.project-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-white);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 700px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-card-body {
  padding: 24px;
}
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.project-card-header h3 {
  font-size: 1.05rem;
  margin: 0;
  flex: 1;
}
.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  white-space: nowrap;
  margin-left: 8px;
}

.fork-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #edf2f7;
  color: #718096;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 12px;
}
.project-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.project-outputs {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.project-outputs summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-slate);
  cursor: pointer;
  padding: 4px 0;
}
.project-outputs summary:hover {
  color: var(--color-accent);
}
.project-outputs ul {
  list-style: none;
  padding: 8px 0 0 0;
}
.project-outputs li {
  padding: 3px 0;
}
.project-outputs a {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-outputs a::before {
  content: '📄';
  font-size: 0.8rem;
}

/* --- Publications ------------------------------------------------------- */
.pub-list {
  display: grid;
  gap: 12px;
}
.pub-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.pub-item:hover {
  border-color: var(--color-accent);
}
.pub-info {
  flex: 1;
}
.pub-info h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.pub-info h4 a {
  color: var(--color-text);
}
.pub-info h4 a:hover {
  color: var(--color-accent);
}
.pub-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
}
.pub-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pub-type.report { background: #ebf4ff; color: #2b6cb0; }
.pub-type.atlas { background: #fefcbf; color: #975a16; }
.pub-type.data { background: #e6fffa; color: #234e52; }
.pub-type.presentation { background: #faf5ff; color: #553c9a; }
.pub-type.article { background: #fff5f5; color: #9b2c2c; }

/* --- Contact ------------------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-info-list {
  list-style: none;
}
.contact-info-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}
.contact-info-list li:last-child {
  border-bottom: none;
}
.contact-info-list .icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}
.contact-info-list a {
  color: var(--color-primary-light);
  font-weight: 500;
}

.contact-form {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(214,158,46,0.1);
}
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- Testimonials ------------------------------------------------------- */
.testimonial-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.testimonial-card blockquote {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 12px;
}
.testimonial-card cite {
  font-style: normal;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
}

/* --- Footer ------------------------------------------------------------- */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.6);
  padding: 40px 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer a {
  color: rgba(255,255,255,0.7);
}
.footer a:hover {
  color: var(--color-accent);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

/* --- Admin badge (subtle) ---------------------------------------------- */
.admin-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}
.admin-badge a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(15,42,63,0.85);
  color: rgba(255,255,255,0.6);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}
.admin-badge a:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

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

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .hero h1 { font-size: 2rem; }
  .hero .title { font-size: 1rem; }
  .section { padding: 60px 0; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 8px;
    box-shadow: var(--shadow-md);
  }
  .nav-list.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .pub-item { flex-direction: column; }
}
