:root {
  --bg: #f5f6fb;
  --panel: #ffffff;
  --border: rgba(16, 24, 40, 0.08);
  --primary: #4f64ff;
  --accent: #00c2ff;
  --text: #101828;
  --muted: #5f6478;
  --code-bg: #0d1117;
  --code-border: rgba(255, 255, 255, 0.1);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 18% 18%, rgba(79, 210, 255, 0.25), transparent 60%),
    radial-gradient(circle at 80% 10%, rgba(79, 100, 255, 0.2), transparent 55%),
    radial-gradient(circle at 52% 78%, rgba(255, 255, 255, 0.25), transparent 60%);
  filter: blur(70px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.portfolio-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, 94%);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.portfolio-intro {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: clamp(2rem, 6vw, 3.5rem);
  box-shadow: 0 25px 60px rgba(20, 30, 70, 0.1);
}

.intro-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 0.6rem;
}

.portfolio-intro h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.portfolio-intro p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  max-width: 720px;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.intro-tags span {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.gallery {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 1.8rem;
  border: 1px solid rgba(16, 24, 40, 0.05);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.35rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 15px 35px rgba(15, 20, 60, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  cursor: pointer;
  border: none;
  width: 100%;
  font: inherit;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 25px 45px rgba(15, 20, 60, 0.15);
  outline: none;
}

.card-group {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
}

.gallery-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.gallery-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-tech {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.detail-panel[hidden] {
  display: none;
}

.detail-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: clamp(1.75rem, 5vw, 3rem);
  box-shadow: 0 25px 60px rgba(15, 20, 60, 0.12);
}

.detail-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  background: rgba(79, 100, 255, 0.12);
  color: var(--primary);
  font-size: 1.35rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.detail-close:hover {
  background: rgba(79, 100, 255, 0.2);
  transform: scale(1.02);
}

.detail-content section + section {
  margin-top: 1.5rem;
}

.detail-header {
  padding-right: 3rem;
}

.detail-group {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.detail-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.detail-headline {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.detail-tech {
  margin: 0;
  font-weight: 600;
}

section > h3 {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  color: var(--muted);
}

section > p {
  margin: 0 0 0.6rem;
}

.problem-list,
.feature-list,
.workflow-steps,
.value-list {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.problem-list li,
.feature-list li,
.workflow-steps li,
.value-list li {
  margin-bottom: 0.3rem;
}

pre {
  background: var(--code-bg);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  color: #f6f8fa;
  font-size: 0.9rem;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  margin: 0 0 0.75rem;
}

pre code {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.node-card {
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1rem;
  background: rgba(249, 250, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.node-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.node-card p {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.roi-line {
  margin: 0.8rem 0 0;
  padding: 0.85rem 1.2rem;
  border-radius: 1rem;
  background: rgba(79, 100, 255, 0.08);
  border: 1px solid rgba(79, 100, 255, 0.25);
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 720px) {
  .portfolio-shell {
    width: min(95%, 640px);
  }

  .gallery {
    padding: 1.25rem;
  }

  .gallery-card {
    padding: 1rem;
  }

  .detail-panel {
    padding: 1.25rem;
  }

  .detail-close {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.1rem;
  }

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