/* ── Cozy palette ── */
:root {
  --bg: #faf6f0;
  --bg-card: #fffdf9;
  --bg-sidebar: #4a3f3a;
  --bg-sidebar-hover: #5c4f48;
  --bg-sidebar-active: #6d5d54;
  --text: #3d322c;
  --text-muted: #7a6b62;
  --text-sidebar: #f5ebe3;
  --text-sidebar-muted: #c9b8ab;
  --accent: #c4846a;
  --accent-soft: #e8c4b4;
  --accent-green: #7a9e7e;
  --accent-green-soft: #d4e5d6;
  --border: #e8ddd3;
  --shadow: 0 4px 24px rgba(74, 63, 58, 0.08);
  --shadow-hover: 0 8px 32px rgba(74, 63, 58, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 260px;
  --font: 'Nunito', system-ui, sans-serif;
  --transition: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(196, 132, 106, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(122, 158, 126, 0.05) 0%, transparent 50%);
  min-height: 100dvh;
}

.layout {
  display: flex;
  min-height: 100dvh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100dvh;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.sidebar__logo {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.sidebar__title {
  margin: 0;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.sidebar__subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-sidebar-muted);
  font-weight: 600;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-group {
  margin-top: 0.75rem;
}

.nav-group__label {
  margin: 0 0 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sidebar-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-sidebar);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), transform var(--transition);
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
}

.nav-item--active {
  background: var(--bg-sidebar-active);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item__icon {
  font-size: 1.1rem;
}

.nav-item__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
  margin-left: 0.35rem;
}

.sidebar__footer {
  padding: 1rem 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-sidebar-muted);
  line-height: 1.5;
}

.sidebar__footer p { margin: 0; }

/* ── Main content ── */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem 3rem;
  max-width: 960px;
}

.lang-switch {
  display: inline-flex;
  gap: 0;
  margin: 0 0 0.85rem;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.lang-switch__btn {
  min-width: 2.6rem;
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-switch__btn:hover {
  color: var(--text);
}

.lang-switch__btn--active {
  background: var(--accent);
  color: #fff;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--text);
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ── Hero (home) ── */
.hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}

.hero__greeting {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.5rem;
}

.hero h2 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
  font-weight: 800;
  position: relative;
}

.hero__bio {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 62ch;
  position: relative;
}

.hero__bio-p {
  margin: 0 0 0.85rem;
  line-height: 1.65;
}

.hero__bio-p:last-child {
  margin-bottom: 0;
}

.hero__link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.hero__link:hover {
  color: #a86a52;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  position: relative;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.social-link:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ── Section ── */
.section {
  margin-bottom: 2.5rem;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.section__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Tabs (in-page for rubric pages) ── */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

.tab--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Project cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.projects-grid--single {
  grid-template-columns: 1fr;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card--expanded {
  max-width: 100%;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.project-card__cover {
  height: 140px;
  background: linear-gradient(135deg, var(--accent-green-soft), var(--accent-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.project-card__cover--image {
  height: auto;
  min-height: 120px;
  padding: 0.5rem;
  background: linear-gradient(135deg, #1a2e2a 0%, #2a3d38 50%, #1e2830 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card__cover--image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--radius-sm) - 2px);
}

.project-card--expanded .project-card__cover--image img {
  max-height: 420px;
}

/* ── Screenshots gallery ── */
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.15rem;
}

.screenshots__item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 2px 12px rgba(74, 63, 58, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.screenshots__item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.screenshots__item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  background: linear-gradient(135deg, #1a2e2a, #1e2830);
}

.project-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.project-card__platform {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-green);
  background: var(--accent-green-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.project-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.project-card__desc {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-card__actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: var(--accent-soft);
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state p {
  margin: 0;
  font-weight: 600;
}

/* ── Mobile menu toggle ── */
.menu-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--bg-sidebar);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar-backdrop[hidden] { display: none; }
  .sidebar-backdrop:not([hidden]) { display: block; }

  .content {
    margin-left: 0;
    padding: 1.5rem 1.25rem 5rem;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    padding: 1.5rem;
  }
}
