/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== CSS Custom Properties ===== */
:root {
  /* Light theme (default) */
  --bg-primary: #fafaf9;
  --bg-secondary: #f3f4f6;
  --bg-card: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-subtle: rgba(99, 102, 241, 0.08);
  --sub-accent: #10b981;
  --sub-accent-hover: #34d399;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: rgba(17, 24, 39, 0.06);
  --shadow-lg: rgba(17, 24, 39, 0.1);
  --tag-bg: #eef2ff;
  --tag-text: #4f46e5;
  --timeline-line: #e5e7eb;
  --nav-bg: rgba(250, 250, 249, 0.88);
  --code-bg: #f3f4f6;
  --hero-grid: rgba(99, 102, 241, 0.04);
  --gradient-start: #6366f1;
  --gradient-end: #10b981;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Font */
  --font-family: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, monospace;

  /* Layout */
  --max-width: 960px;
  --nav-height: 64px;
  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f1a;
  --bg-secondary: #111827;
  --bg-card: #111827;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-subtle: rgba(129, 140, 248, 0.08);
  --sub-accent: #34d399;
  --sub-accent-hover: #6ee7b7;
  --border: #1f2937;
  --border-light: #1f2937;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --tag-bg: #1e1b4b;
  --tag-text: #a5b4fc;
  --timeline-line: #1f2937;
  --nav-bg: rgba(11, 15, 26, 0.88);
  --code-bg: #111827;
  --hero-grid: rgba(129, 140, 248, 0.03);
  --gradient-start: #818cf8;
  --gradient-end: #34d399;
}

/* ===== Global ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-md));
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Scroll Animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
}

.nav__inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav__logo::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--sub-accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--sub-accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--accent);
  text-decoration: none;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s;
}

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

.theme-toggle svg {
  display: block;
}

.theme-icon-sun {
  display: none !important;
}

[data-theme="dark"] .theme-icon-moon {
  display: none !important;
}

[data-theme="dark"] .theme-icon-sun {
  display: block !important;
}

/* ===== Main Content ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + var(--space-2xl)) var(--space-lg) var(--space-3xl);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: left;
  padding: var(--space-3xl) 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-subtle) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--sub-accent);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) var(--space-md);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
}

.hero__status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--sub-accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__status::before {
    animation: none;
  }
}

.hero__name {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero__tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
  max-width: 600px;
}

.hero__focus {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: var(--space-xs) var(--space-md);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
}

.hero__metrics {
  display: flex;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.hero__metric {
  display: flex;
  flex-direction: column;
}

.hero__metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero__metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero__links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}

.hero__links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Hero animation classes */
.hero__status,
.hero__name,
.hero__tagline,
.hero__focus,
.hero__metrics,
.hero__links {
  opacity: 0;
  transform: translateY(20px);
}

.hero.loaded .hero__status {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero.loaded .hero__name {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.hero.loaded .hero__tagline {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.hero.loaded .hero__focus {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

.hero.loaded .hero__metrics {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero.loaded .hero__links {
  animation: heroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__status,
  .hero__name,
  .hero__tagline,
  .hero__focus,
  .hero__metrics,
  .hero__links {
    opacity: 1;
    transform: none;
  }
  .hero.loaded .hero__status,
  .hero.loaded .hero__name,
  .hero.loaded .hero__tagline,
  .hero.loaded .hero__focus,
  .hero.loaded .hero__metrics,
  .hero.loaded .hero__links {
    animation: none;
  }
}

/* ===== Section ===== */
.section {
  margin-bottom: var(--space-3xl);
}

.section__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  letter-spacing: -0.01em;
}

.section__subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

/* ===== About ===== */
.about-text {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
  max-width: 720px;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow-lg);
  transform: translateY(-3px);
}

.card:hover::before {
  opacity: 1;
}

.card a {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: var(--space-xl);
}

.card__image {
  display: block;
  width: calc(100% + 2 * var(--space-xl));
  max-width: none;
  height: 180px;
  object-fit: cover;
  margin-top: calc(-1 * var(--space-xl));
  margin-left: calc(-1 * var(--space-xl));
  margin-right: calc(-1 * var(--space-xl));
  margin-bottom: var(--space-md);
}

.card--featured .card__image {
  height: 220px;
}

.card__period {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.card__role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Featured card */
.card--featured {
  grid-column: 1 / -1;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--gradient-start), var(--gradient-end)) border-box;
}

.card--featured::before {
  opacity: 1;
  height: 3px;
}

.card--featured .card__title {
  font-size: 1.25rem;
}

.card--featured a {
  display: flex;
  flex-direction: column;
}

.card--featured .card__tags {
  justify-content: flex-start;
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tag:hover {
  transform: scale(1.05);
}

/* ===== Project Detail ===== */
.project-detail {
  max-width: 720px;
}

.project-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.project-detail__meta dt {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project-detail__meta dd {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.project-detail h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--text-primary);
}

.project-detail ul {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.project-detail li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.project-detail li strong {
  color: var(--text-primary);
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.project-nav a {
  font-size: 0.9rem;
}

/* ===== Skills ===== */
.skill-category {
  margin-bottom: var(--space-2xl);
}

.skill-category__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.skill-category__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-subtle);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.9rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: default;
}

.skill-item:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px var(--shadow);
  border-color: var(--accent);
}

/* Cert table */
.cert-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-md);
}

.cert-table th,
.cert-table td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.cert-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cert-table td {
  color: var(--text-primary);
}

.cert-table tr {
  transition: background 0.2s;
}

.cert-table tbody tr:hover {
  background: var(--accent-subtle);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: var(--space-2xl);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 80%, transparent);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-2xl);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 4px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  transition: transform 0.2s;
}

.timeline__item:hover::before {
  transform: scale(1.3);
}

.timeline__period {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
}

.timeline__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.timeline__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.timeline__item--cert::before {
  background: var(--sub-accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.timeline__item--cert .timeline__title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.timeline__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sub-accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Contribution ===== */
.contribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.contribution {
  padding: var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contribution::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

.contribution:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow-lg);
  transform: translateY(-3px);
}

.contribution:hover::before {
  opacity: 1;
}

.contribution__tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  align-self: flex-start;
}

.contribution__tag--green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--sub-accent);
}

.contribution__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.contribution__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
  flex: 1;
}

.contribution__desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

.contribution__list {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: var(--space-lg);
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.contribution__list li {
  margin-bottom: var(--space-xs);
}

.contribution__link {
  font-size: 0.85rem;
  margin-top: auto;
}

/* Featured contribution */
.contribution--featured {
  grid-column: 1 / -1;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--gradient-start), var(--gradient-end)) border-box;
}

.contribution--featured::before {
  opacity: 1;
  height: 3px;
}

.contribution--featured .contribution__title {
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .contribution-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Nav Section (index page) ===== */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow-lg);
  transform: translateY(-3px);
  text-decoration: none;
}

.nav-card:hover::before {
  opacity: 1;
}

.nav-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-lg);
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.nav-card__icon svg {
  width: 24px;
  height: 24px;
}

.nav-card__label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer__links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===== Learnings Gallery ===== */
.learnings-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.learnings-course-overview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.learnings-course-overview__img {
  display: block;
  width: 100%;
  height: auto;
}

.learnings-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.learnings-gallery__item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.learnings-gallery__item:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow-lg);
  transform: translateY(-3px);
}

.learnings-gallery__img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: #fff;
  padding: var(--space-sm);
}

.learnings-gallery__caption {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--border);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__hamburger {
    display: flex;
  }

  .hero__name {
    font-size: 2.2rem;
  }

  .hero__tagline {
    font-size: 1rem;
  }

  .hero__metrics {
    gap: var(--space-lg);
  }

  .hero__metric-value {
    font-size: 1.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card--featured a {
    grid-template-columns: 1fr;
  }

  .card--featured .card__tags {
    justify-content: flex-start;
    max-width: none;
  }

  .project-detail__meta {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .project-nav {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .main {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .nav-cards {
    grid-template-columns: 1fr 1fr;
  }

  .hero__metrics {
    flex-direction: column;
    gap: var(--space-md);
  }
}
