/* =========================================================
   Md Mahfuzur Rahman — Portfolio
   Theme: "Research Console" — dark lab-notebook aesthetic
   Type:  Space Grotesk (display) / IBM Plex Sans (body) / IBM Plex Mono (data)
   ========================================================= */

:root {
  /* --- color tokens --- */
  --bg:            #0a0c10;
  --bg-raised:     #12151b;
  --bg-raised-2:   #171b22;
  --border:        #262b33;
  --border-soft:   #1c2028;
  --border-strong: #3d4453;   /* used on interactive controls for real visibility */

  --text:          #e8eaed;
  --text-dim:      #9aa3af;
  --text-faint:    #5b6472;

  --accent:        #ffb454;   /* phosphor amber — primary signature color */
  --accent-soft:   #ffb45422;
  --accent-line:   #ffb45455;
  --accent-strong: #ffcf8a;

  --syntax-cyan:   #7dd3fc;   /* used sparingly, like IDE syntax color */
  --syntax-green:  #86efac;   /* status / success dot */

  --nav-bg:    rgba(10,12,16,0.82);
  --glow-color: rgba(255,180,84,0.14);

  --radius:  10px;
  --radius-sm: 6px;

  /* --- type tokens --- */
  --font-display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;

  --maxw: 1060px;
}

/* --- light theme overrides --- */
html[data-theme="light"] {
  --bg:            #f6f4ee;
  --bg-raised:     #ffffff;
  --bg-raised-2:   #efece1;
  --border:        #dedad0;
  --border-soft:   #e8e4d8;
  --border-strong: #b9b2a0;

  --text:          #1c1f26;
  --text-dim:      #4b5262;
  --text-faint:    #848c9c;

  --accent:        #c07a1f;
  --accent-soft:   #c07a1f16;
  --accent-line:   #c07a1f4d;
  --accent-strong: #9c630f;

  --syntax-cyan:   #0e7a95;
  --syntax-green:  #158049;

  --nav-bg:    rgba(246,244,238,0.86);
  --glow-color: rgba(192,122,31,0.10);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body,
.topnav, .terminal, .terminal-bar, .cell, .tag, .project-cat,
.edu-card, .contact-box, .social-row a,
.nav-links a, .logo, .theme-toggle, .nav-toggle {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ambient background: faint grid + top vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 75%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(255,180,84,0.10), transparent 60%);
  transition: background 0.25s ease;
}
html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
}
html[data-theme="light"] body::after {
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(192,122,31,0.10), transparent 60%);
}

/* cursor-tracking spotlight — subtle, follows the pointer over the grid */
#cursor-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--x, 50%) var(--y, 18%), var(--glow-color), transparent 72%);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

::selection { background: var(--accent); color: #10131a; }

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   Top nav
   ========================================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-strong);
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}
.logo .caret { color: var(--accent); }
.logo .blink-cursor { color: #fff6d8; text-shadow: 0 0 6px rgba(255,214,110,0.65); animation: blink 1.1s step-end infinite; }

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

.nav-links {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-links a { color: var(--text-faint); transition: color 0.2s ease; position: relative; }
.nav-links a:hover { color: var(--accent); }
.nav-links .idx { color: var(--text-faint); margin-right: 2px; }

.nav-toggle {
  display: none;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 38px; height: 34px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--text-dim); margin: 3px auto; }

.theme-toggle {
  width: 38px; height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle svg { width: 17px; height: 17px; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 90px 0 70px;
}
.hero-grid {
  display: grid;
  gap: 42px;
}
@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
  }
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--syntax-green);
  box-shadow: 0 0 8px var(--syntax-green);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 16px;
}
.hero-role {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: 30px;
}
.hero-role strong { color: var(--text); font-weight: 500; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #14100a;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: var(--bg-raised); font-weight: 500; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

.social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.social-row a {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: all 0.2s ease;
}
.social-row a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.social-row svg { width: 16px; height: 16px; flex-shrink: 0; }

/* terminal card */
.terminal {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
  transition: border-color 0.25s ease;
}
.terminal:hover { border-color: var(--accent-line); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-raised-2);
}
.terminal-bar .tdot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.terminal-bar .tdot:nth-child(1) { background: #ff5f57; }
.terminal-bar .tdot:nth-child(2) { background: #febc2e; }
.terminal-bar .tdot:nth-child(3) { background: #28c840; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-body {
  padding: 20px 22px 26px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  height: 232px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.terminal-line { display: flex; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.terminal-line .prompt { color: var(--syntax-cyan); flex-shrink: 0; }
.terminal-line .out { color: var(--text-dim); padding-left: 20px; margin-bottom: 14px; }
.terminal-line .out strong { color: var(--text); font-weight: 500; }
.typed-cursor {
  display: inline-block;
  width: 7px; height: 1em;
  background: linear-gradient(180deg, #fff9e6, #ffd67a);
  box-shadow: 0 0 7px rgba(255, 214, 110, 0.7);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

/* =========================================================
   Notebook cell layout (shared by all sections)
   ========================================================= */
.cell {
  padding: 56px 0;
  border-top: 1px solid var(--border-soft);
}
.cell-inner {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 24px;
}
.cell-marker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 4px;
  white-space: nowrap;
}
.cell-comment {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: block;
}
.cell-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* =========================================================
   About
   ========================================================= */
.about-text { max-width: 66ch; color: var(--text-dim); font-size: 1.02rem; }
.about-text strong { color: var(--text); font-weight: 500; }

/* =========================================================
   Experience
   ========================================================= */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--accent-line), var(--border-soft));
}
.exp-item { position: relative; padding-left: 34px; margin-bottom: 34px; }
.exp-item:last-child { margin-bottom: 0; }
.exp-item::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.exp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }
.org-logo {
  width: 42px; height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #f4f1e8;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
  padding: 5px;
  flex-shrink: 0;
}
.exp-item h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--text); }
.exp-meta { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); margin-bottom: 12px; }
.exp-meta span { color: var(--syntax-cyan); }
.exp-bullets { padding-left: 18px; }
.exp-bullets li { color: var(--text-dim); margin-bottom: 8px; font-size: 0.95rem; position: relative; padding-left: 4px; }
.exp-bullets li::marker { color: var(--accent); }
.exp-desc { color: var(--text-dim); font-size: 0.95rem; }

/* =========================================================
   Skills
   ========================================================= */
.skills-grid { display: flex; flex-direction: column; gap: 30px; }
.skill-card {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
  transition: border-color 0.25s ease;
}
.skill-card:last-child { padding-bottom: 0; border-bottom: none; }
.skill-card h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tech-card {
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-raised-2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  text-align: center;
}
.tech-badge {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f1e8;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
  transition: width 0.3s ease, height 0.3s ease;
  flex-shrink: 0;
}
.tech-badge img { width: 19px; height: 19px; object-fit: contain; }
.tech-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  font-size: 0.62rem;
  font-weight: 700;
  color: #2c2f36;
  letter-spacing: -0.02em;
}
.tech-label {
  font-size: 0.66rem;
  color: var(--text-dim);
  line-height: 1.25;
  transition: color 0.3s ease;
}

/* grows on mouse hover (and keyboard focus) — not on click */
.tech-card:hover,
.tech-card:focus-visible {
  transform: scale(1.28);
  z-index: 6;
  border-color: var(--accent);
  background: var(--bg-raised);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.5), 0 0 0 3px var(--accent-soft);
  outline: none;
}
.tech-card:hover .tech-badge,
.tech-card:focus-visible .tech-badge { width: 42px; height: 42px; }
.tech-card:hover .tech-badge img,
.tech-card:focus-visible .tech-badge img { width: 23px; height: 23px; }
.tech-card:hover .tech-label,
.tech-card:focus-visible .tech-label { color: var(--text); font-weight: 600; }

/* =========================================================
   Projects
   ========================================================= */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #14100a; border-color: var(--accent); font-weight: 600; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .project-grid { grid-template-columns: repeat(3, 1fr); }
}
.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: none;
  flex-direction: column;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.project-card.show { display: flex; }
.project-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.project-cat {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}
.project-card p { color: var(--text-dim); font-size: 0.9rem; flex-grow: 1; margin-bottom: 14px; }
.project-tech {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-bottom: 16px;
  line-height: 1.6;
}
.project-links { display: flex; gap: 10px; }
.project-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised-2);
  color: var(--text-dim);
  transition: all 0.2s ease;
}
.project-links a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.project-links svg { width: 14px; height: 14px; }

/* =========================================================
   Hackathons / Publications / Education — shared card list
   ========================================================= */
.stack-list { display: flex; flex-direction: column; gap: 16px; }
.info-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.info-card:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.info-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin-bottom: 4px; }
.info-card .sub { font-family: var(--font-mono); font-size: 0.76rem; color: var(--syntax-cyan); margin-bottom: 10px; display: block; }
.info-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 12px; }

.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cert-grid .info-card { display: flex; flex-direction: column; }
.cert-grid .project-links { margin-top: auto; }
@media (max-width: 720px) { .cert-grid { grid-template-columns: 1fr; } }
.cert-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cert-head .sub { margin-bottom: 0; }
.cert-id { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); display: block; margin-bottom: 12px; word-break: break-all; }

.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.edu-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.edu-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.edu-card .org { color: var(--text-dim); font-size: 0.92rem; }
.edu-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.edu-head h3 { margin-bottom: 4px; }
.edu-head .org-logo { width: 42px; height: 42px; }
.edu-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); display: block; margin-bottom: 3px; }
.edu-meta.highlight { color: var(--accent); }

/* =========================================================
   Footer / contact
   ========================================================= */
.footer-cell { padding-bottom: 90px; }
.contact-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 34px;
  text-align: center;
}
.contact-box p.lead {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 10px;
}
.contact-box p.sub { color: var(--text-dim); margin-bottom: 26px; }
.contact-box .hero-cta { justify-content: center; margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 26px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}
.site-footer .caret { color: var(--accent); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    gap: 16px;
  }
  .cell-inner { grid-template-columns: 1fr; gap: 8px; }
  .cell-marker { padding-top: 0; }
  .hero { padding: 60px 0 50px; }
  .exp-head { align-items: flex-start; gap: 10px; }
}
