/* mazrinj.my — CV static site (professional UI/UX) */

:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-card: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-subtle: #6e7681;
  --accent: #3fb950;
  --accent-soft: rgba(63, 185, 80, 0.12);
  --accent-border: rgba(63, 185, 80, 0.35);
  --border: #21262d;
  --link: #58a6ff;
  --link-hover: #79b8ff;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --container: min(92vw, 780px);
  --space: 1.5rem;
  --space-sm: 0.75rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space);
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #0d1117;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space);
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Focus */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #46c35a;
  border-color: #46c35a;
  color: #0d1117;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--text-subtle);
}

.btn-header {
  color: var(--text-muted);
  background: transparent;
}

.btn-header:hover {
  color: var(--accent);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  gap: var(--space);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.logo:hover {
  color: var(--text);
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav a {
  padding: 0.4rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

/* Hero */
.hero {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}

.hero-name {
  margin: 0 0 0.25em;
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.hero-title {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.hero-summary {
  margin: 0 0 1.75rem;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.hero-contact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-sm) var(--space-lg);
  margin-bottom: 1.75rem;
}

.hero-contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a.hero-contact-item:hover {
  color: var(--link);
}

.hero-contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.hero-contact-item span:last-child {
  font-size: 0.9rem;
  color: var(--text-muted);
}

a.hero-contact-item:hover span:last-child {
  color: var(--link);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions .btn-primary {
  padding: 0.6rem 1.25rem;
}

.hero-actions .btn-secondary {
  padding: 0.6rem 1.25rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(33, 38, 45, 0.8);
  box-shadow: var(--shadow);
}

/* Sections */
.section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-border);
  display: inline-block;
}

/* Jobs */
.job {
  margin-bottom: 1.5rem;
}

.job:last-child {
  margin-bottom: 0;
}

.job.card {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}

.job-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.job-title-block {
  flex: 1;
  min-width: 0;
}

.job-header h3 {
  margin: 0 0 0.2em;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.job-company {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.job-meta {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  white-space: nowrap;
}

.job-duties {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.job-duties li {
  margin-bottom: 0.45rem;
}

.job-duties li:last-child {
  margin-bottom: 0;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-grid li {
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  transition: background var(--transition), transform var(--transition);
}

.skills-grid li:hover {
  background: rgba(63, 185, 80, 0.18);
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1rem;
}

.project.card h3 {
  margin: 0 0 0.4em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Education */
.edu-grid {
  display: grid;
  gap: 1rem;
}

.edu.card h3 {
  margin: 0 0 0.25em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.edu-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Certifications */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.cert.card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
}

.cert.card strong {
  font-size: 0.9rem;
  color: var(--text);
}

.cert.card span {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Footer */
.site-footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.copyright {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* Print */
@media print {
  :root {
    --bg: #fff;
    --bg-card: #fafafa;
    --text: #111;
    --text-muted: #333;
    --text-subtle: #555;
    --accent: #0d6e0d;
    --accent-soft: #e8f5e9;
    --accent-border: #a5d6a7;
    --border: #ddd;
    --link: #0550ae;
  }

  .site-header {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid var(--border);
  }

  .btn-header,
  .nav,
  .hero-actions {
    display: none !important;
  }

  .hero,
  .section {
    padding: 1rem 0;
    border-bottom-color: var(--border);
  }

  .card {
    box-shadow: none;
    border-color: var(--border);
  }

  .job-duties,
  .certs-grid .cert,
  .project p,
  .edu-meta {
    color: var(--text-muted);
  }

  .skills-grid li {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-border);
  }

  body {
    background: #fff;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .site-header .container {
    flex-wrap: wrap;
  }

  .btn-header {
    display: none;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav a {
    white-space: nowrap;
  }

  .hero-contact {
    grid-template-columns: 1fr;
  }

  .job-header {
    flex-direction: column;
  }

  .job-meta {
    white-space: normal;
  }

  .certs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
