/* ==========================================================================
   FEZAN MUHAMMAD ALI (engcountio.com)
   Design: Human-Crafted Minimalist & Editorial
   Clean typography, hairline borders, no artificial gradients.
   ========================================================================== */

:root {
  --ink: #111111;
  --muted: #666666;
  --faint: #999999;
  --line: #e6e6e6;
  --line-subtle: #f2f2f2;
  --paper: #ffffff;
  --accent: #111111;
  --card-hover: #fafafa;
  --tag-bg: #f4f4f5;
  --tag-text: #52525b;
  --status-green: #10b981;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --ink: #f0f0f0;
  --muted: #8e8e93;
  --faint: #555555;
  --line: #242426;
  --line-subtle: #1c1c1e;
  --paper: #0d0d0e;
  --accent: #ffffff;
  --card-hover: #141416;
  --tag-bg: #1c1c1f;
  --tag-text: #a1a1aa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f0f0f0;
    --muted: #8e8e93;
    --faint: #555555;
    --line: #242426;
    --line-subtle: #1c1c1e;
    --paper: #0d0d0e;
    --accent: #ffffff;
    --card-hover: #141416;
    --tag-bg: #1c1c1f;
    --tag-text: #a1a1aa;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.site-header,
main,
footer {
  width: min(100% - 3rem, 920px);
  margin-inline: auto;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.wordmark {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

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

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  max-width: 740px;
  padding: clamp(3.5rem, 7vw, 5rem) 0 clamp(2.75rem, 5vw, 4rem);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--status-green);
  border-radius: 50%;
  display: inline-block;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  margin: 0 0 1.25rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 640px;
}

.tagline strong {
  color: var(--ink);
  font-weight: 500;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.social-links a span {
  color: var(--muted);
  transition: transform 0.15s ease;
}

.social-links a:hover span {
  color: var(--ink);
  transform: translate(2px, -2px);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.content-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin: 0;
}

.section-intro {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 580px;
}

/* ==========================================================================
   CERTIFICATIONS (SIGNATURE 3-COL MINIMAL GRID)
   ========================================================================== */
.certification-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.certification {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 13rem;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 0.2s ease;
  position: relative;
}

.certification:last-child {
  border-right: 0;
}

.certification:hover {
  background: var(--card-hover);
}

.certification-frame {
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  margin-bottom: 1rem;
}

.certification-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cert-meta {
  text-align: center;
}

.cert-org {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  display: block;
  margin-bottom: 4px;
}

.cert-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.cert-verify {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.certification:hover .cert-verify {
  color: var(--ink);
}

/* ==========================================================================
   PROJECTS (CLEAN EDITORIAL LIST)
   ========================================================================== */
.project-list {
  border-top: 1px solid var(--line);
}

.project-item {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 2rem;
  align-items: baseline;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.15s ease;
}

.project-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.project-header a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-header a span {
  font-size: 0.85rem;
  color: var(--muted);
}

.project-header a:hover span {
  color: var(--ink);
  transform: translate(2px, -2px);
}

.project-body p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 2px 7px;
  border-radius: 3px;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
   EXPERIENCE & EDUCATION (EDITORIAL ROWS)
   ========================================================================== */
.timeline-list {
  border-top: 1px solid var(--line);
}

.timeline-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.timeline-detail h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-company {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.timeline-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-points li {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  position: relative;
  padding-left: 1rem;
}

.timeline-points li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--faint);
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3.5rem;
  padding-bottom: 5rem;
}

.contact-section .section-heading {
  margin: 0;
}

.contact-section .section-heading h2 {
  margin-bottom: 1rem;
}

.contact-direct-info {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.contact-direct-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact-value {
  color: var(--ink);
  font-weight: 500;
}

.contact-value:hover {
  text-decoration: underline;
}

/* Form */
.contact-form {
  display: grid;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

label {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input, textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.75rem 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  outline: 0;
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

input::placeholder, textarea::placeholder {
  color: var(--faint);
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

button[type="submit"] {
  width: fit-content;
  border: 0;
  border-radius: 0.15rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 1.4rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-status.success {
  color: var(--ink);
  font-weight: 500;
}

.form-status.error {
  color: #dc2626;
}

.contact-form.submitted label,
.contact-form.submitted .form-actions {
  display: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a:hover {
  color: var(--ink);
}

/* ==========================================================================
   RESPONSIVE DESIGN (BULLETPROOF ACROSS 320px - 1200px)
   ========================================================================== */
@media (max-width: 860px) {
  .site-header, main, footer {
    width: min(100% - 2.5rem, 920px);
  }

  .project-item {
    grid-template-columns: 180px 1fr;
    gap: 1.25rem;
  }

  .project-category {
    grid-column: 1 / -1;
    text-align: left;
    order: -1;
    font-size: 0.7rem;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 680px) {
  .site-header, main, footer {
    width: min(100% - 2rem, 920px);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.1rem;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
  }

  .nav-group {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 1.15rem;
    padding-bottom: 3px;
    font-size: 0.8rem;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .hero {
    padding-top: 2.75rem;
    padding-bottom: 2.5rem;
  }

  h1 {
    font-size: clamp(2.1rem, 9vw, 3rem);
  }

  .tagline {
    font-size: 0.98rem;
  }

  .social-links {
    gap: 0.9rem 1.25rem;
    font-size: 0.82rem;
  }

  .content-section {
    padding: 2.75rem 0;
  }

  /* Certifications Mobile Stack */
  .certification-list {
    grid-template-columns: 1fr;
  }

  .certification {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: auto;
    padding: 1.75rem 1rem;
  }

  .certification:last-child {
    border-bottom: 0;
  }

  .certification-frame {
    width: 5.5rem;
    height: 5.5rem;
  }

  /* Projects Mobile Stack */
  .project-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }

  /* Timeline Mobile Stack */
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.5rem 0;
  }

  .timeline-period {
    font-size: 0.75rem;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Form Mobile Stack */
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  input, textarea {
    /* 16px font-size prevents iOS Safari from automatically zooming on focus */
    font-size: 16px;
  }

  button[type="submit"] {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 0.88rem;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 2rem 0;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 0.9rem 1.25rem;
  }
}

