:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-alt: #eef3eb;
  --text: #1d2a1f;
  --muted: #556257;
  --accent: #4b7d2d;
  --accent-dark: #355b1f;
  --border: #d6dfd1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  position: relative;
}

.container {
  width: min(1000px, 92%);
  margin: 0 auto;
}

.data-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
}

.hero {
  background: linear-gradient(170deg, #e8efe3 0%, #f8faf7 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

.role {
  margin: 0.5rem 0 1rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.intro {
  margin: 0;
  max-width: 750px;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.2rem;
}

.hero-links a,
.hero-links span {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.section {
  padding: 3rem 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
}

h3 {
  margin: 0 0 0.6rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 2px 10px rgba(32, 49, 34, 0.04);
}

.timeline {
  display: grid;
  gap: 0.9rem;
}

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.timeline-head span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
}

.project-sub {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(32, 49, 34, 0.04);
}

.data-flow-section .container {
  display: grid;
  gap: 1rem;
}

.flow-intro {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
}

.systems-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 1rem;
}

.lab-graph {
  position: relative;
  min-height: 280px;
  background: linear-gradient(165deg, #f9fcf8 0%, #edf5e9 100%);
  border: 1px solid #cedac9;
  border-radius: 14px;
  overflow: hidden;
}

.lab-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lab-links line {
  stroke: #86a27a;
  stroke-width: 0.7;
  stroke-opacity: 0.8;
}

.lab-links path {
  fill: none;
  stroke: #89a783;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 3 4;
  opacity: 0.9;
}

.layer-card {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 1px solid #c6d3c0;
  color: #2c4730;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  width: 160px;
  max-width: 42%;
  box-shadow: 0 3px 10px rgba(24, 39, 27, 0.06);
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.layer-card h3 {
  margin: 0;
  font-size: 0.84rem;
}

.layer-card p {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: #4f6652;
}

.layer-card.is-focus {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: #7ba36a;
  box-shadow: 0 8px 18px rgba(45, 72, 34, 0.14);
}

.layer-bronze { left: 18%; top: 20%; }
.layer-silver { left: 50%; top: 42%; }
.layer-gold { left: 57%; top: 66%; }
.layer-serve { left: 82%; top: 40%; }

.packet {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 30% 30%, #c6f58f, #4b7d2d 65%, #2b4c1a);
  box-shadow: 0 0 12px rgba(86, 150, 49, 0.5);
}

.lab-side {
  display: grid;
  gap: 0.8rem;
}

.story-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.story-step h3 {
  margin: 0;
  font-size: 1rem;
}

.story-step p {
  margin: 0.32rem 0 0;
  color: var(--muted);
}

.story-step.is-active {
  border-color: #8db47e;
  box-shadow: 0 8px 16px rgba(40, 67, 33, 0.09);
  transform: translateY(-2px);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.6rem;
  border: 1px solid #c8d5c1;
  border-radius: 999px;
  background: #f4f8f1;
  color: #334236;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.section-cta {
  text-align: center;
}

.button {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.button:hover {
  background: var(--accent-dark);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 550ms ease, transform 550ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .hero {
    padding-top: 3.3rem;
  }

  .systems-lab {
    grid-template-columns: 1fr;
  }

  .layer-card {
    width: 150px;
    max-width: 62%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .data-canvas {
    display: none;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .packet {
    display: none;
  }

  .story-step {
    transition: none;
  }
}
