* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #07111f;
  --surface: rgba(10, 19, 35, 0.92);
  --surface-2: rgba(15, 24, 43, 0.9);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --accent: #38bdf8;
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 18px 45px rgba(2, 8, 23, 0.35);
}

html {
  scroll-behavior: smooth;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.2), transparent 30%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.18), transparent 32%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.04), transparent 30%, rgba(255,255,255,0.03));
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus states for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.25rem, 3vw, 3rem);
  backdrop-filter: blur(20px);
  background: rgba(7, 17, 31, 0.85);
  border-bottom: 1px solid var(--border);
}

.site-header .brand {
  transition: color 0.2s ease;
}

.site-header .brand:hover {
  color: var(--accent);
}

.brand {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: white;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}

.nav-links a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}

.portfolio-page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero,
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.8rem;
}

.hero h1,
.section-heading h2,
.contact-card h2 {
  font-family: "Poppins", sans-serif;
  color: white;
  line-height: 1.15;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-bottom: 1rem;
}

.hero-content p {
  color: var(--muted);
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.4rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary:hover {
  box-shadow: 0 14px 35px rgba(96, 165, 250, 0.35);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(148, 163, 184, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 10px 25px rgba(96, 165, 250, 0.25);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.hero-stats div {
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}

.hero-stats strong {
  display: block;
  font-size: 1.1rem;
  color: white;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(96, 165, 250, 0.4);
  margin: 0 auto;
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.highlight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: var(--muted);
}

.highlight-list i {
  color: var(--accent);
  margin-right: 0.5rem;
}

.certifications-list {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cert-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.cert-icons {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.cert-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cert-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.cert-name {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: 60px;
  line-height: 1.2;
}

.section {
  padding: clamp(1.25rem, 2.5vw, 1.8rem);
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  margin-bottom: 0.2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.about-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
}

.about-card p {
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.about-card h3 {
  color: white;
  margin-bottom: 0.9rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.skill-chip {
  background: rgba(96, 165, 250, 0.12);
  color: #dbeafe;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  font-size: 0.92rem;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-chip:hover {
  background: rgba(96, 165, 250, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

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

.timeline-item {
  padding: 1rem 1.1rem;
  border-left: 2px solid rgba(96, 165, 250, 0.35);
  background: rgba(255,255,255,0.03);
  border-radius: 0 16px 16px 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.timeline-item:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(4px);
}

.job-title {
  color: white;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.company {
  color: var(--accent);
  font-weight: 600;
}

.timeline-highlights {
  list-style: none;
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.timeline-highlights li {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.2rem;
  position: relative;
}

.timeline-highlights li::before {
  content: "•";
  color: var(--accent);
  position: absolute;
  left: 0.4rem;
  font-weight: bold;
}

.date {
  display: inline-block;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.3rem 0 0.6rem;
}

.job-description {
  color: var(--muted);
}

/* Keiken block styling */
.keiken-block {
  background: rgba(96, 165, 250, 0.04);
  border-left: 3px solid var(--primary);
}

.keiken-missions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mission-subitem {
  padding: 0.9rem;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.mission-title {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.mission-date {
  display: inline-block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.2rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.12);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.project-card p {
  color: var(--muted);
}

.project-tech {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}

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

.contact-card {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 20px;
  padding: 1.5rem;
}

.contact-card p {
  color: var(--muted);
  margin-bottom: 0.7rem;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 0 1rem 2rem;
}

@media (max-width: 900px) {
  .hero,
  .about-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  /* Reorder hero for mobile: card first, content second */
  .hero-card {
    order: -1;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    gap: 0.7rem;
  }

  .portfolio-page {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .hero,
  .section {
    border-radius: 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
