/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:         #111111;
  --card-bg:    #1a1a1a;
  --sidebar-bg: #161616;
  --toggle-bg:  #1a1a1a;
  --accent:     #e63946;
  --accent2:    #ff6b6b;
  --text:       #ffffff;
  --muted:      #888888;
  --border:     #2a2a2a;
  --glow:       rgba(230,57,70,0.2);
}
[data-theme="light"] {
  --bg:         #f9f5f1;
  --card-bg:    #ffffff;
  --sidebar-bg: #f0ebe5;
  --toggle-bg:  #ffffff;
  --accent:     #c1121f;
  --accent2:    #e63946;
  --text:       #111111;
  --muted:      #666666;
  --border:     #e0d8d8;
  --glow:       rgba(193,18,31,0.1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem;
  gap: 2rem;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-name {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sidebar-name span {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}
.sidebar-nav a {
  display: block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--accent);
  background: rgba(230,57,70,0.08);
  border-color: rgba(230,57,70,0.3);
}
.sidebar-social {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
}
.sidebar-social a {
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.2s;
}
.sidebar-social a:hover { color: var(--accent); }

/* ── Theme Toggle ──────────────────────────────────── */
#theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 200;
  background: var(--toggle-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Page Layout ───────────────────────────────────── */
.page-content {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.main { flex: 1; }

/* ── Container ─────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero ──────────────────────────────────────────── */
#hero {
  padding: 7rem 2rem 6rem;
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5rem;
  align-items: center;
}
.hero-overline {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero-h1 {
  font-family: Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.hero-h1 .stroke-name {
  -webkit-text-stroke: 2px var(--accent);
  color: transparent;
}
.hero-bio {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 2.25rem;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cta-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.cta-primary:hover { background: var(--accent2); transform: translateY(-2px); color: #fff; }
.cta-secondary {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}
.cta-secondary:hover { border-color: var(--accent); color: var(--accent); }
.hero-right { flex-shrink: 0; }
.hero-photo-wrap {
  position: relative;
  width: 240px;
  height: 280px;
}
.hero-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -12px;
  border: 2px solid var(--accent);
  transform: rotate(3deg);
  border-radius: 4px;
}
.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(8px 12px 24px var(--glow));
}

/* ── Section Base ──────────────────────────────────── */
section.full-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.section-number {
  font-family: Georgia, serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  user-select: none;
}
.section-label-sm {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
h2.editorial-title {
  font-family: Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

/* ── Projects Card Grid ────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--glow);
  border-color: var(--accent);
}
.card-image {
  height: 150px;
  background: rgba(230,57,70,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-family: Georgia, serif;
}
.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.card-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.btn {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); color: #fff; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Skills Grouped Pills ──────────────────────────── */
.skills-group { margin-bottom: 1.75rem; }
.skills-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: default;
}
.skill-pill:hover { transform: translateY(-1px); }
.skill-pill.lang {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  color: var(--accent2);
}
.skill-pill.lang:hover { background: rgba(230,57,70,0.2); }
.skill-pill.framework {
  background: rgba(100,180,255,0.08);
  border: 1px solid rgba(100,180,255,0.25);
  color: #64b4ff;
}
.skill-pill.framework:hover { background: rgba(100,180,255,0.15); }
.skill-pill.db {
  background: rgba(80,220,160,0.08);
  border: 1px solid rgba(80,220,160,0.25);
  color: #50dcb0;
}
.skill-pill.db:hover { background: rgba(80,220,160,0.15); }

/* ── Contact ───────────────────────────────────────── */
.contact-big {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.contact-big h3 {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.contact-big p { color: var(--muted); line-height: 1.7; margin-bottom: 1.5rem; }
.contact-big .cta-primary { display: inline-block; }
.contact-right { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 0.5rem; }
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.contact-item:last-child { border-bottom: none; }
.contact-item-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  min-width: 70px;
  padding-top: 2px;
}
.contact-item-value a {
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.2s;
}
.contact-item-value a:hover { color: var(--accent); }

/* ── Mobile Nav ────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  justify-content: space-around;
  z-index: 100;
}
.mobile-nav a { font-size: 0.72rem; color: var(--muted); }
.mobile-nav a:hover { color: var(--accent); }

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1200px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-content { margin-left: 0; }
  #hero { grid-template-columns: 1fr; text-align: center; padding: 4rem 1.5rem; gap: 3rem; }
  .hero-bio { margin: 0 auto 2rem; }
  .hero-ctas { justify-content: center; }
  .hero-photo-wrap { margin: 0 auto; width: 220px; height: 260px; }
  .contact-big { grid-template-columns: 1fr; gap: 2rem; }
  .container { padding: 0 1.25rem; }
  #theme-toggle { top: 0.75rem; right: 1rem; }
  .site-footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem; }
  section.full-section { padding: 4rem 0 5rem; }
  .mobile-nav { display: flex; }
}
@media (max-width: 600px) {
  .hero-h1 { font-size: 2.5rem; }
  .section-number { font-size: 2.5rem; }
  h2.editorial-title { font-size: 1.6rem; }
  .projects-grid { grid-template-columns: 1fr; }
}
