/* Amir Sohel, portfolio v6. Subtle blue and white, light and dark themes, tabbed sections. */

:root {
  --bg: #fbfdff;
  --panel: #f2f7fe;
  --panel-2: #edf4fd;
  --ink: #0a1e3c;
  --ink-soft: #2c4258;
  --muted: #50627c;
  --line: #d9e6f5;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.35);
  --glow: rgba(37, 99, 235, 0.10);
  --grid: rgba(37, 99, 235, 0.045);
  --nav-bg: rgba(251, 253, 255, 0.85);
  --shadow: 0 24px 54px rgba(10, 40, 90, 0.12);
  --wrap: 1080px;
}

:root[data-theme="dark"] {
  --bg: #071120;
  --panel: #0b1a33;
  --panel-2: #0a1730;
  --ink: #e9f1fc;
  --ink-soft: #c7d6ea;
  --muted: #9db1cc;
  --line: rgba(157, 186, 224, 0.18);
  --accent: #6ea8fe;
  --accent-ink: #9cc2ff;
  --accent-soft: rgba(110, 168, 254, 0.12);
  --accent-border: rgba(110, 168, 254, 0.40);
  --glow: rgba(80, 140, 255, 0.14);
  --grid: rgba(140, 180, 255, 0.05);
  --nav-bg: rgba(7, 17, 32, 0.85);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 85% -5%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, var(--glow), transparent 60%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.25) 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.25) 70%, transparent);
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: clamp(22px, 5vw, 44px);
  padding-right: clamp(22px, 5vw, 44px);
  position: relative;
}

/* ---------- header ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-dot { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-resume {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 6px 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-resume:hover { background: var(--accent-soft); border-color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.theme-toggle svg { width: 19px; height: 19px; }

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

/* ---------- tabs ---------- */
.tabbar {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabbar::-webkit-scrollbar { display: none; }

.tab {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab:hover { color: var(--ink); }

.tab.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent-border);
  font-weight: 600;
}

/* ---------- type ---------- */
.kicker {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 26px;
}

h1, h2, h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(40px, 7.2vw, 84px); line-height: 1.04; }

h2 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
  margin-bottom: 18px;
}

h3 { font-size: 21px; line-height: 1.25; }

.sub {
  margin-top: 28px;
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 36em;
}

.body {
  margin-top: 24px;
  font-size: clamp(16.5px, 1.9vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 38em;
}

/* ---------- hero ---------- */
.hero {
  padding-top: clamp(70px, 11vh, 120px);
  padding-bottom: clamp(56px, 8vh, 90px);
}

.hero-meta {
  margin-top: 32px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--accent-border); }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.stat { background: var(--panel-2); padding: 26px 22px 22px; }

.stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-prefix, .stat-suffix { color: var(--accent); }

.stat-label {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.pill-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: 2px;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
  flex: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- sections ---------- */
.section {
  padding-top: clamp(80px, 11vh, 120px);
  padding-bottom: clamp(30px, 5vh, 50px);
}

.section.panel-top { padding-top: clamp(48px, 7vh, 72px); }

.tab-panel { padding-bottom: clamp(80px, 11vh, 120px); }

/* ---------- journey ---------- */
.journey {
  margin-top: 48px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}

.jstop {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: clamp(16px, 3vw, 36px);
  padding: 0 0 38px 30px;
}

.jstop:last-child { padding-bottom: 6px; }

.jstop::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.jstop-when {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  padding-top: 3px;
}

.jstop h3 { margin-bottom: 8px; }

.jstop p { font-size: 15.5px; line-height: 1.6; color: var(--muted); max-width: 44em; }

/* ---------- why pillars ---------- */
.pillars {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.pillar {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
}

.pillar h3 { margin-bottom: 10px; }

.pillar p { font-size: 15.5px; line-height: 1.6; color: var(--muted); }

/* ---------- cases ---------- */
.case {
  margin-top: 52px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(26px, 4vw, 44px);
}

.case-index {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.case h3 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 26px; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}

.case-label {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.case-grid p { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }

.growth-line {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------- cards ---------- */
.cards {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}

.card-top { margin-bottom: 18px; min-height: 24px; }

.card-tag {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 4px 12px;
}

.card h3 { margin-bottom: 12px; }

.card p { font-size: 15.5px; line-height: 1.6; color: var(--muted); }

.card-link { margin-top: 18px; }

.card-link a {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.card-link a:hover { color: var(--accent-ink); }

/* ---------- toolkit chips ---------- */
.tools-kicker { margin-top: 64px; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips li {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 8px 16px;
}

/* ---------- notes / posts ---------- */
.post-cards {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.post-card {
  display: block;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 26px;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}

.post-meta {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.post-card h3 { color: var(--ink); margin-bottom: 10px; }

.post-card p { font-size: 15.5px; line-height: 1.6; color: var(--muted); }

.post-card .post-read {
  margin-top: 16px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

/* ---------- contact ---------- */
.contact-panel { padding-bottom: clamp(40px, 6vh, 70px); }

.email {
  display: inline-block;
  margin-top: 34px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(21px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 4px;
}

.email:hover { color: var(--accent-ink); }

.links { margin-top: 30px; display: flex; gap: 26px; }

.links a {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); position: relative; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: 38px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- post pages ---------- */
.post-wrap { max-width: 760px; }

.post-page { padding-top: clamp(56px, 8vh, 90px); padding-bottom: clamp(90px, 12vh, 140px); }

.back-link {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 44px;
}

.back-link:hover { color: var(--accent-ink); }

.post-page h1 {
  font-size: clamp(32px, 5.5vw, 54px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 18px;
}

.post-page .post-meta { margin-bottom: 40px; }

.post-body p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.post-body p strong { color: var(--ink); }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot { animation: none; }
  .btn:hover, .card:hover, .post-card:hover { transform: none; }
  body { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  
  .case-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .post-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .jstop { grid-template-columns: 1fr; gap: 6px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- skills groups (v4.1) ---------- */
.group-head {
  margin-top: 54px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.group-head + .cards { margin-top: 22px; }

.card-wide { grid-column: 1 / -1; }

.dash-list {
  list-style: none;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.dash-list li {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.dash-list strong { color: var(--ink); font-weight: 600; }

.dash-list span { color: var(--muted); }

@media (max-width: 560px) {
  .dash-list li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- v6 additions: brand mark and post dates ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }

.brand-mark { width: 27px; height: 27px; flex: none; display: block; }

.post-date {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.post-page .post-date { margin-bottom: 40px; }
