/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── TOKENS ─── */
:root {
  --bg: #ffffff;
  --surface: #f7f7f6;
  --text: #111110;
  --muted: #6c6c6c;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --accent-light: #edfbf2;
  --border: #e8e8e6;
  --radius: 12px;
  --max-w: 900px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0a;
    --surface: #141413;
    --text: #f0f0ee;
    --muted: #717171;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --accent-light: #052e16;
    --border: #242422;
  }
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

@media (prefers-color-scheme: dark) {
  nav { background: rgba(11, 11, 10, 0.9); }
}

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

.nav-logo {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--accent); }

.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
  border-radius: 1px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }

.nav-cmd-hint {
  font-size: 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--font-mono);
  letter-spacing: 0;
}
.nav-cmd-hint:hover { border-color: var(--accent); color: var(--accent); }

/* ─── SECTIONS ─── */
section { max-width: var(--max-w); margin: 0 auto; padding: 88px 2rem; }

/* ─── HERO ─── */
.hero {
  padding-top: 118px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

/* subtle asymmetric dot grid — data analyst / technical aesthetic */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: -2rem;
  bottom: 0;
  left: 52%;
  background-image: radial-gradient(circle, var(--text) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.3px;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.6s var(--ease) both;
  font-family: var(--font-mono);
}
.hero-status .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.75); }
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1.02;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s 0.08s var(--ease) both;
  text-wrap: balance;
}

/* underline accent on name — distinctive without being loud */
.hero h1 span {
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero h1 span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  opacity: 0.2;
  border-radius: 2px;
}

.hero p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 2.25rem;
  min-height: 1.75em;
  line-height: 1.7;
  animation: fadeUp 0.6s 0.16s var(--ease) both;
}

.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.24s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ─── STAT COUNTERS ─── */
.hero-stats {
  display: flex;
  gap: 2.25rem;
  margin-top: 4rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.36s var(--ease) both;
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--accent);
}
.stat-label {
  font-size: 0.67rem;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--font-mono);
  letter-spacing: 0.1px;
}
.stat-divider { width: 1px; background: var(--border); align-self: stretch; margin: 4px 0; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.35rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.btn:active { transform: scale(0.98) !important; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { opacity: 0.8; transform: translateY(-1px); }

.btn-outline { border-color: var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--text); color: var(--text); transform: translateY(-1px); }

/* ─── SECTION HEADER ─── */
.section-header { margin-bottom: 2.5rem; }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
}
.section-label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--accent);
  flex-shrink: 0;
  border-radius: 1px;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  text-wrap: balance;
}

/* ─── ABOUT ─── */
#about {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4.5rem;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  line-height: 1.75;
}
.about-text p:last-child { margin-bottom: 0; }

.about-photo { position: relative; }

/* offset shadow frame — gives depth to the photo without heavy UI */
.photo-img {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  box-shadow: 8px 8px 0px color-mix(in srgb, var(--accent) 14%, transparent);
  transition: box-shadow 0.35s var(--ease);
}
.about-photo:hover .photo-img {
  box-shadow: 10px 10px 0px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ─── NOW ─── */
#now { padding-top: 0; padding-bottom: 0; }
.now-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.now-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 2.25rem;
}
.now-item:not(:first-child) {
  border-left: 1px solid var(--border);
}
.now-item-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
}
.now-item-text { font-size: 0.9rem; color: var(--text); font-weight: 500; line-height: 1.45; }
.now-item-sub { font-size: 0.78rem; color: var(--muted); }

/* ─── CATEGORY HEADINGS ─── */
.category-block { margin-bottom: 3rem; }
.category-block:last-child { margin-bottom: 0; }
.category-heading { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.25rem; }
.category-heading-icon { font-size: 0.85rem; line-height: 1; }
.category-heading-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.category-heading-line { flex: 1; height: 1px; background: var(--border); }

/* ─── PROJECT CARDS ─── */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

/* left accent stripe — appears on hover for visual punch */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  border-radius: 0 2px 2px 0;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.project-card:hover::before { opacity: 1; }
.project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.project-title { font-size: 0.92rem; font-weight: 600; line-height: 1.4; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.project-tag {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.61rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.project-arrow {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  align-self: flex-start;
  margin-top: auto;
  opacity: 0.45;
  transition: color 0.2s, opacity 0.2s, transform 0.22s var(--ease);
}
.project-card:hover .project-arrow {
  color: var(--accent);
  opacity: 1;
  transform: translateX(4px);
}

/* ─── MEDIUM CARDS ─── */
.medium-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
.medium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.medium-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.medium-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.medium-card-tag {
  font-size: 0.61rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
}
.medium-card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.38; color: var(--text); }
.medium-card-excerpt { font-size: 0.83rem; color: var(--muted); flex: 1; line-height: 1.6; }
.medium-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  transition: color 0.2s;
}
.medium-card:hover .medium-card-footer { color: var(--accent); }
.medium-card-footer span { font-weight: 500; }

.medium-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.medium-all-link:hover { color: var(--accent); }

/* ─── CONNECT ─── */
#connect { text-align: center; }
#connect .section-label { justify-content: center; }

.connect-desc {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.7;
}
.connect-links {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}
.connect-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.connect-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.connect-card:active { transform: scale(0.98); }
.connect-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.connect-card svg { flex-shrink: 0; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
footer p {
  font-size: 0.78rem;
  color: var(--muted);
}
.back-to-top {
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.back-to-top:hover { color: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .medium-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  section { padding: 64px 1.5rem; }
  .hero { padding-top: 80px; padding-bottom: 64px; }
  .hero h1 { letter-spacing: -1.5px; }
  .hero::after { display: none; }
  .hero h1 span::after { bottom: 3px; height: 2px; }
  .about-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .photo-img { max-width: 100%; box-shadow: 6px 6px 0px color-mix(in srgb, var(--accent) 12%, transparent); }
  .projects-grid { grid-template-columns: 1fr; }
  .medium-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-stats { gap: 1.25rem; }
  .stat-divider { display: none; }
  .now-card { grid-template-columns: 1fr; padding: 1.25rem 0; gap: 0; }
  .now-item { padding: 1rem 1.5rem; }
  .now-item:not(:first-child) { border-left: none; border-top: 1px solid var(--border); }
  .footer-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
}

/* ─── COMMAND PALETTE ─── */
#cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
#cmd-backdrop.open { opacity: 1; pointer-events: all; }

#cmd-box {
  width: 100%;
  max-width: 500px;
  margin: 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
  transform: translateY(-8px) scale(0.99);
  transition: transform 0.15s var(--ease);
}
#cmd-backdrop.open #cmd-box { transform: none; }

#cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
#cmd-input-wrap svg { color: var(--muted); flex-shrink: 0; }
#cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.93rem;
  color: var(--text);
  font-family: inherit;
}
#cmd-input::placeholder { color: var(--muted); }
#cmd-esc {
  font-size: 0.63rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
  font-family: var(--font-mono);
}
#cmd-results { max-height: 300px; overflow-y: auto; padding: 0.4rem; }

.cmd-group-label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.75rem 0.2rem;
  font-family: var(--font-mono);
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
  transition: background 0.1s;
}
.cmd-item:hover, .cmd-item.active { background: var(--accent-light); color: var(--accent); }

.cmd-item-icon {
  width: 29px;
  height: 29px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.cmd-item-text { flex: 1; }
.cmd-item-title { font-weight: 600; font-size: 0.875rem; }
.cmd-item-sub { font-size: 0.7rem; color: var(--muted); }
.cmd-item:hover .cmd-item-sub, .cmd-item.active .cmd-item-sub { color: var(--accent); opacity: 0.75; }
.cmd-item-shortcut { font-size: 0.65rem; color: var(--muted); }

#cmd-footer { padding: 0.5rem 1.1rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; }
#cmd-footer span { font-size: 0.63rem; color: var(--muted); display: flex; align-items: center; gap: 0.25rem; }
#cmd-footer kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
}
