/* ============================================================
   Mehedi Mostafa Hafiz — portfolio
   plain CSS, no build step. engineer's-terminal aesthetic.
   ============================================================ */

:root {
  --bg: #f8f9fa;
  --bg-raise: #ffffff;
  --ink: #1c2321;
  --ink-soft: #4a5552;
  --dim: #8a948f;
  --accent: #0d8065;
  --accent-soft: rgba(13, 128, 101, 0.08);
  --accent-line: rgba(13, 128, 101, 0.35);
  --line: #e3e7e5;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 960px;
  --radius: 6px;
  --nav-bg: rgba(248, 249, 250, 0.88);
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-raise: #161b22;
  --ink: #e6e6e6;
  --ink-soft: #adb5bd;
  --dim: #6e7681;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.12);
  --accent-line: rgba(74, 222, 128, 0.4);
  --line: #30363d;
  --nav-bg: rgba(13, 17, 23, 0.88);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  /* faint grid, like editor gutter paper */
  background-image:
    linear-gradient(rgba(28, 35, 33, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 35, 33, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

::selection { background: var(--accent); color: var(--bg); }

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

.accent { color: var(--accent); }
.dim { color: var(--dim); font-weight: 400; }
.amp { color: var(--dim); }

a { color: inherit; }

/* ============ nav ============ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  color: var(--ink-soft);
  transition: color 0.18s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-links a.is-active {
  color: var(--accent);
  font-weight: 700;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-raise);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  transform: translateY(-2px);
}

.theme-toggle svg { width: 16px; height: 16px; display: none; }

.theme-toggle .icon-moon { display: block; }

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ reveal animation ============ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }
.d5 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .nav-cursor, .contact-cursor { animation: none; }
}

/* ============ hero ============ */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 64px;
  position: relative;
}

.hero-prompt {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.prompt-sign { color: var(--accent); font-weight: 500; }

.hero-name {
  font-size: clamp(42px, 8vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 20px;
}

.hero-tagline em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  max-width: 620px;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

.hero-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  text-decoration: none;
  font-size: 13px;
  color: var(--ink-soft);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-links a:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(13, 128, 101, 0.1);
}

.hero-links svg { width: 16px; height: 16px; }

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  font-size: 12px;
}

.hero-scroll svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ============ sections ============ */

.section { padding: 96px 0; }

.section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  translate: 0 -6px;
}

/* ============ experience timeline ============ */

.timeline {
  position: relative;
  padding-left: 28px;
}

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

.timeline-item {
  position: relative;
  padding-bottom: 56px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-date {
  font-size: 12px;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.timeline-role {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.timeline-role .at { color: var(--dim); font-weight: 400; }

.timeline-loc {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 14px;
}

.timeline-points {
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.timeline-points li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 14px;
}

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

.timeline-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-line);
  padding-bottom: 1px;
  transition: border-color 0.18s ease;
}

.timeline-link:hover { border-bottom-style: solid; border-color: var(--accent); }

.timeline-item--compact .timeline-oneliner {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px;
}

/* ============ projects ============ */

.projects {
  display: grid;
  gap: 28px;
}

.project-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 8px 28px rgba(28, 35, 33, 0.07);
  transform: translateY(-4px);
}

.project-card:hover::before { opacity: 1; }

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.project-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-links a {
  display: inline-flex;
  color: var(--ink-soft);
  transition: color 0.18s ease, transform 0.18s ease;
}

.project-links a:hover { color: var(--accent); transform: translateY(-2px); }

.project-links svg { width: 20px; height: 20px; }

.project-summary {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  max-width: 720px;
}

.project-points {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.project-points li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.project-points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-points code {
  font-family: inherit;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12.5px;
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags li {
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.01em;
}

/* ============ hackathons ============ */

.hack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.hack-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hack-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(28, 35, 33, 0.06);
}

.hack-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hack-head h3 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

.hack-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  padding: 2px 9px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hack-card p {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ============ about ============ */

.about {
  display: grid;
  gap: 32px;
  max-width: 720px;
}

.about-label {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 8px;
}

.about-block p { color: var(--ink-soft); font-size: 14.5px; }
.about-block strong { color: var(--ink); font-weight: 700; }
.about-modules { margin-top: 6px; font-size: 13.5px; }

/* ============ skills ============ */

.section--skills { padding-top: 0; }

.skills {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  overflow: hidden;
}

.skill-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 16px 24px;
  font-size: 13.5px;
}

.skill-row + .skill-row { border-top: 1px solid var(--line); }

.skill-key {
  color: var(--accent);
  font-weight: 700;
}

.skill-val { color: var(--ink-soft); }

/* ============ contact ============ */

.section--contact { padding-bottom: 120px; }

.contact {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding-top: 16px;
}

.contact-prompt {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.contact-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  font-size: 12px;
}

.contact-copy {
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.contact-cta {
  display: inline-block;
  padding: 14px 28px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.contact-cta:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 128, 101, 0.25);
}

.contact-links {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 28px;
}

.contact-links a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.18s ease;
}

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

/* ============ footer ============ */

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ============ responsive ============ */

@media (max-width: 720px) {
  .section { padding: 72px 0; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .nav-links.is-open { display: flex; }

  .nav-links li { border-top: 1px solid var(--line); }

  .nav-links a {
    display: block;
    padding: 16px 24px;
    font-size: 14px;
  }

  .hero { padding-top: 96px; }

  .hack-grid { grid-template-columns: 1fr; }

  .project-card { padding: 24px 20px; }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline { padding-left: 24px; }
  .timeline-marker { left: -24px; }
}
