/* ==========================================================================
   Al Muktadir Munam — Portfolio
   ========================================================================== */

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2') format('woff2');
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;550;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

:root {
  --font-sans: "FKGroteskNeue", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", "Charter", "Iowan Old Style", Georgia, serif;
  --font-mono: "Berkeley Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ink: #0f2327;
  --ink-2: #3a4a50;
  --ink-3: #6a7880;
  --paper: #ffffff;
  --paper-2: #ffffff;
  --rule: rgba(19, 52, 59, 0.14);
  --rule-strong: rgba(19, 52, 59, 0.28);
  --teal: #1a6873;
  --teal-deep: #13454d;
  --accent: #8a4b1a;
  --section-mark: "";
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { padding-top: 64px; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-feature-settings: "ss01","cv11"; overflow-x: hidden; }
body p { margin: 0; color: inherit; }
body h1, body h2, body h3, body h4 { margin: 0; font-weight: inherit; letter-spacing: 0; color: inherit; line-height: inherit; }
body a { color: inherit; text-decoration: none; }

body .container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
body .container.narrow { max-width: 880px; }
body .section { padding: 72px 0; border-top: 1px solid var(--rule); }
body .section:first-of-type { border-top: none; }
body .section-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
body .section-label::before { content: ""; display: inline-block; width: 24px; height: 1px; background: var(--teal-deep); vertical-align: middle; margin-right: 10px; transform: translateY(-2px); }
body .section-title { font-family: var(--font-serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 36px; }
body .section-title em { font-style: italic; color: var(--teal-deep); }

/* Navbar */
body .navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); height: 64px; }
body .nav-container { max-width: 1120px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; height: 100%; }
body .nav-brand { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink); letter-spacing: 0; cursor: pointer; }
body .nav-brand .dot { color: var(--teal); }
body .nav-menu { display: flex; list-style: none; gap: 28px; margin: 0; padding: 0; }
body .nav-link { color: var(--ink-2); font-weight: 500; font-size: 13px; cursor: pointer; transition: color 150ms ease; letter-spacing: 0.01em; }
body .nav-link:hover, body .nav-link.active { color: var(--teal-deep); }
body .nav-link.active { position: relative; }
body .nav-link.active:after { content:""; position:absolute; left:0; right:0; bottom:-22px; height:2px; background: var(--teal); }
body .nav-toggle { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; background: transparent; border: 1px solid var(--rule-strong); border-radius: 2px; cursor: pointer; }
body .nav-toggle span { width: 18px; height: 1px; background: var(--ink); transition: transform 160ms ease, opacity 160ms ease; }
body .navbar.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body .navbar.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body .navbar.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
body .hero-section { padding: 90px 0 72px; background: var(--paper); border-top: none; }
body .hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: start; }
body .hero-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
body .hero-eyebrow:before { content: ""; width: 24px; height: 1px; background: var(--teal); }
body .hero-title { font-family: var(--font-serif); font-weight: 500; font-size: 56px; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 20px; }
body .hero-subtitle { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 22px; line-height: 1.35; color: var(--teal-deep); margin: 0 0 24px; }
body .hero-desc { font-size: 15px; color: var(--ink-2); margin: 0 0 32px; line-height: 1.65; max-width: 52ch; }
body .hero-meta { display: grid !important; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 0 0 32px; padding: 20px 0 0; border-top: 1px solid var(--rule); }
body .hero-meta dt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; margin: 0; }
body .hero-meta dd { margin: 0; }
body .hero-meta a { color: var(--teal-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
body .hero-meta a:hover { text-decoration-color: var(--teal); }
body .hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

body .hero-aside { border-left: 1px solid var(--rule); padding-left: 48px; padding-top: 8px; }

/* Editorial portrait figure */
body .portrait-figure { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
body .portrait-frame { position: relative; width: 260px; padding: 14px; background: var(--paper-2); border: 1px solid var(--rule); }
body .portrait-corner { position: absolute; width: 10px; height: 10px; border: 1px solid var(--teal-deep); }
body .portrait-corner--tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
body .portrait-corner--tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
body .portrait-corner--bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
body .portrait-corner--br { bottom: -1px; right: -1px; border-left: none; border-top: none; }
body .portrait-index { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.92); padding: 3px 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--rule); z-index: 2; }
body .portrait-img { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: linear-gradient(135deg, rgba(19,69,77,0.06), rgba(26,104,115,0.02)); }
body .portrait-img:before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(19,69,77,0.025) 6px 7px); z-index: 1; pointer-events: none; }
body .portrait-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
body .portrait-caption { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
body .caption-rule { display: block; width: 18px; height: 1px; background: var(--teal); margin-top: 7px; flex-shrink: 0; }
body .caption-text { font-family: var(--font-serif); font-size: 13px; line-height: 1.45; color: var(--ink); }
body .caption-text em { font-style: italic; color: var(--ink-3); font-size: 12px; }
body .portrait-sidemark { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; gap: 12px; padding: 8px 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
body .sidemark-line { display: inline-block; width: 1px; height: 60px; background: var(--rule-strong); }

/* Buttons */
body .btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 2px; font-weight: 500; font-size: 13px; line-height: 1; border: 1px solid transparent; cursor: pointer; transition: all 180ms ease; font-family: inherit; text-decoration: none; gap: 8px; letter-spacing: 0.01em; }
body .btn-primary { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
body .btn-primary:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
body .btn-secondary { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
body .btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
body .btn .arrow { font-size: 14px; line-height: 1; }
body .toggle-btn { background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-2); padding: 6px 12px; border-radius: 2px; font-weight: 500; font-size: 11px; cursor: pointer; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
body .toggle-btn:hover { color: var(--ink); border-color: var(--ink); }
body .previous-toggle { margin-top: 36px; padding: 18px 20px; border: 1px solid var(--rule-strong); border-left: 3px solid var(--teal-deep); display: flex; justify-content: space-between; align-items: center; gap: 20px; background: rgba(26, 104, 115, 0.035); }
body .previous-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-deep); margin-bottom: 6px; }
body .previous-summary { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; }
body .previous-toggle-btn { min-height: 38px; padding: 10px 14px; background: var(--paper); color: var(--ink); border-color: var(--rule-strong); flex-shrink: 0; }
body .previous-toggle-btn:hover { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
body .toggle-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; line-height: 1; margin-right: 4px; }

/* Entries */
body .entry { display: grid; grid-template-columns: 160px 1fr; gap: 40px; padding: 28px 0; border-top: 1px solid var(--rule); }
body .entry:first-child { border-top: 1px solid var(--rule-strong); }
body .entry:last-child { border-bottom: 1px solid var(--rule-strong); }
body .entry-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); line-height: 1.6; }
body .entry-meta .status { display: inline-block; padding: 2px 6px; border: 1px solid var(--teal); color: var(--teal-deep); border-radius: 2px; margin-top: 4px; }
body .entry-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; line-height: 1.3; margin: 0 0 6px; }
body .entry-org { font-size: 14px; color: var(--teal-deep); margin: 0 0 4px; font-weight: 500; }
body .entry-gpa { font-size: 13px; color: var(--ink-2); margin: 0 0 14px; font-family: var(--font-mono); }
body .entry-notes { list-style: none; padding: 0; margin: 14px 0 0; }
body .entry-notes li { color: var(--ink-2); font-size: 14px; line-height: 1.6; padding-left: 18px; position: relative; margin-bottom: 8px; }
body .entry-notes li:before { content: "\2014"; position: absolute; left: 0; color: var(--ink-3); }
body .entry-notes li em { font-style: italic; color: var(--ink); }

/* Research */
body .research-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
body .research-card { padding: 32px 28px 32px 28px; border-right: 1px solid var(--rule); position: relative; }
body .research-card:first-child { padding-left: 0; }
body .research-card:last-child { border-right: none; padding-right: 0; }
body .research-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; margin-bottom: 14px; }
body .research-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--ink); margin: 0 0 10px; letter-spacing: -0.005em; line-height: 1.25; }
body .research-desc { color: var(--ink-2); line-height: 1.6; font-size: 14px; margin: 0; }

/* Publications */
body .pub-group-title { font-family: var(--font-serif); font-weight: 500; font-size: 16px; color: var(--ink); margin: 36px 0 4px; letter-spacing: 0; }
body .pub-group-title:first-of-type { margin-top: 0; }
body .pub-group-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 18px; }
body .pub-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 20px; padding: 22px 0; border-top: 1px solid var(--rule); align-items: baseline; }
body .pub-item:first-of-type { border-top: 1px solid var(--rule-strong); }
body .pub-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; padding-top: 4px; }
body .pub-authors { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: 0 0 6px; font-family: var(--font-sans); }
body .pub-authors strong { color: var(--ink); font-weight: 600; }
body .pub-title { font-family: var(--font-serif); font-size: 17px; font-weight: 500; color: var(--ink); margin: 0 0 6px; line-height: 1.35; letter-spacing: -0.005em; }
body .pub-journal { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
body .pub-journal .vol { font-style: normal; font-weight: 600; color: var(--ink); }
body .pub-doi { font-family: var(--font-mono); font-size: 11px; color: var(--teal-deep); letter-spacing: 0.02em; text-decoration: none; border-bottom: 1px solid var(--rule-strong); padding-bottom: 1px; }
body .pub-doi:hover { color: var(--teal); border-color: var(--teal); }
body .pub-year { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; padding-top: 4px; white-space: nowrap; }

/* Awards */
body .awards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
body .awards-column h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--ink); margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); letter-spacing: -0.005em; }
body .award-item { display: grid; grid-template-columns: 80px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
body .award-item:last-child { border-bottom: none; }
body .award-year { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; padding-top: 2px; }
body .award-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 3px; line-height: 1.4; font-family: var(--font-sans); }
body .award-title a { color: var(--teal-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
body .award-title a:hover { text-decoration-color: var(--teal); }
body .award-org { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 0; }

/* Certifications */
body .cert-list { border-top: 1px solid var(--rule-strong); columns: 2; column-gap: 56px; }
body .cert-row { break-inside: avoid; display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
body .cert-year { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; padding-top: 3px; }
body .cert-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; font-family: var(--font-sans); }
body .cert-org { font-size: 12px; color: var(--teal-deep); line-height: 1.45; margin: 3px 0 0; }

/* Writing */
body .blog-list { border-top: 1px solid var(--rule-strong); }
body .blog-row { display: grid; grid-template-columns: 80px 1fr 140px; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: baseline; cursor: pointer; transition: background 150ms ease; }
body .blog-row:hover { background: rgba(26, 104, 115, 0.03); }
body .blog-row:hover .blog-row-title { color: var(--teal-deep); }
body .blog-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }
body .blog-row-title { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.005em; line-height: 1.3; transition: color 150ms ease; }
body .blog-row-excerpt { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.5; }
body .blog-tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; text-align: right; }

/* Expertise */
body .personal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; }
body .personal-card h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; font-weight: 600; }
body .personal-card ul { list-style: none; padding: 0; margin: 0; }
body .personal-card li { padding: 7px 0; color: var(--ink); font-size: 14px; border-bottom: 1px solid var(--rule); line-height: 1.45; }
body .personal-card li:last-child { border-bottom: none; }
body .personal-card li .muted { color: var(--ink-3); font-size: 12px; }

/* Contact */
body .contact-section { background: var(--paper); padding: 96px 0 120px; }
body .contact-section .section-title { max-width: 20ch; margin-bottom: 28px; font-size: 36px; }
body .contact-section p { font-size: 16px; color: var(--ink-2); max-width: 56ch; line-height: 1.65; margin: 0 0 36px; }
body .contact-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
body .footer { background: var(--paper); color: var(--ink-3); padding: 32px 0; border-top: 1px solid var(--rule); font-size: 12px; }
body .footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 0 32px; }
body .footer .mono { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }

@media (max-width: 1100px) {
  body .nav-menu { gap: 16px; }
  body .nav-link { font-size: 12px; }
  body .hero-grid { gap: 40px; }
  body .hero-aside { padding-left: 32px; }
  body .research-grid { grid-template-columns: repeat(2, 1fr); }
  body .research-card:nth-child(2) { border-right: none; }
  body .research-card:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}

@media (max-width: 820px) {
  body .nav-container { position: relative; }
  body .nav-toggle { display: inline-flex; flex-shrink: 0; }
  body .nav-menu { display: none; position: fixed; top: 64px; left: 0; right: 0; gap: 0; padding: 10px 32px 18px; background: rgba(255,255,255,0.98); border-bottom: 1px solid var(--rule); box-shadow: 0 16px 30px rgba(15,35,39,0.08); }
  body .navbar.menu-open .nav-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .nav-menu li { min-width: 0; }
  body .nav-link { display: flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 13px; }
  body .nav-link.active:after { display: none; }
}

@media (max-width: 900px) {
  body { padding-top: 60px; }
  body .container { padding: 0 24px; }
  body .section { padding: 56px 0; }
  body .section-title { font-size: 28px; margin-bottom: 28px; }
  body .navbar { height: 60px; }
  body .nav-container { padding: 0 24px; }
  body .nav-brand { font-size: 17px; }
  body .nav-menu { top: 60px; padding-left: 24px; padding-right: 24px; }
  body .hero-section { padding: 60px 0 56px; }
  body .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  body .hero-aside { border-left: none; border-top: 1px solid var(--rule); padding: 24px 0 0; }
  body .hero-title { font-size: 40px; }
  body .hero-subtitle { font-size: 20px; }
  body .portrait-frame { width: min(260px, calc(100vw - 96px)); }
  body .research-grid { grid-template-columns: 1fr; }
  body .research-card { border-right: none; border-bottom: 1px solid var(--rule); padding: 24px 0; }
  body .research-card:last-child { border-bottom: none; }
  body .entry { padding: 24px 0; }
  body .entry-meta { font-size: 10px; }
  body .entry-title { font-size: 19px; }
  body .pub-item { grid-template-columns: 44px 1fr; gap: 6px 14px; align-items: start; }
  body .pub-item > div:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
  body .pub-year { grid-column: 1; grid-row: 2; }
  body .pub-doi { overflow-wrap: anywhere; }
  body .blog-row { padding: 20px 0; }
  body .blog-tag { text-align: left; }
  body .previous-toggle { align-items: flex-start; flex-direction: column; }
  body .previous-toggle-btn { width: 100%; }
  body .cert-list { columns: 1; }
  body .awards-grid, body .personal-grid { grid-template-columns: 1fr; gap: 48px; }
  body .entry, body .pub-item, body .blog-row { grid-template-columns: 1fr; gap: 8px; }
  body .pub-item > div:nth-child(2), body .pub-year { grid-column: auto; grid-row: auto; }
  body .contact-section { padding: 72px 0 88px; }
  body .contact-section .section-title { font-size: 30px; max-width: 24ch; }
}

@media (max-width: 560px) {
  body .container, body .nav-container, body .footer-inner { padding-left: 18px; padding-right: 18px; }
  body .nav-brand { font-size: 16px; max-width: calc(100vw - 86px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body .nav-brand span[style] { display: none; }
  body .navbar.menu-open .nav-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 18px; padding-right: 18px; }
  body .hero-section { padding-top: 48px; }
  body .hero-title { font-size: 34px; }
  body .hero-subtitle { font-size: 18px; }
  body .hero-desc, body .contact-section p { font-size: 14px; line-height: 1.6; }
  body .hero-buttons, body .contact-links { flex-direction: column; }
  body .hero-buttons .btn, body .contact-links .btn { width: 100%; min-height: 42px; }
  body .portrait-figure { grid-template-columns: 1fr; }
  body .portrait-frame { width: min(100%, 300px); }
  body .portrait-sidemark { display: none; }
  body .section { padding: 48px 0; }
  body .section-title { font-size: 25px; }
  body .entry { gap: 10px; padding: 22px 0; }
  body .entry-notes li { font-size: 13px; line-height: 1.55; }
  body .award-item, body .cert-row { grid-template-columns: 1fr; gap: 6px; }
  body .blog-row-title { font-size: 17px; }
  body .footer-inner { align-items: flex-start; flex-direction: column; }
}
