/* ============================================================
   Portfolio - Dark Theme with Wave Animations
   ============================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #1a7bb5;
  --bg-secondary: #15689a;
  --bg-card: rgba(255, 255, 255, 0.13);
  --bg-card-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #7dd3fc;
  --accent-glow: rgba(125, 211, 252, 0.15);
  --border: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(125, 211, 252, 0.4);
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #0c3d5f 0%, #1a7bb5 30%, #2196c8 60%, #1a7bb5 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #bae6fd;
}

::selection {
  background: rgba(125, 211, 252, 0.3);
  color: #fff;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}


/* ============================================================
   Ocean Background
   ============================================================ */
.ocean {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ocean-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(14, 85, 140, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 30% 90%, rgba(56, 189, 248, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 80% 80%, rgba(125, 211, 252, 0.1) 0%, transparent 50%);
}

/* SVG Waves */
.wave-svg {
  position: absolute;
  left: 0;
  width: 200%;
  height: 180px;
}

.wave-svg-1 {
  bottom: 0;
  animation: waveDrift 8s ease-in-out infinite;
}

.wave-svg-2 {
  bottom: 20px;
  animation: waveDrift 11s ease-in-out infinite reverse;
  animation-delay: -2s;
}

.wave-svg-3 {
  bottom: 50px;
  animation: waveDrift 14s ease-in-out infinite;
  animation-delay: -5s;
}

.wave-svg-4 {
  bottom: -10px;
  animation: waveDrift 6s ease-in-out infinite reverse;
  animation-delay: -1s;
  opacity: 0.7;
}

@keyframes waveDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-25%); }
}

/* Foam - white streaks */
.foam {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.25) 0%, transparent 70%);
  filter: blur(2px);
}

.foam-1 {
  width: 500px;
  height: 12px;
  bottom: 160px;
  left: 10%;
  animation: foamFloat 10s ease-in-out infinite;
}

.foam-2 {
  width: 350px;
  height: 8px;
  bottom: 200px;
  right: 15%;
  animation: foamFloat 13s ease-in-out infinite reverse;
  animation-delay: -3s;
}

.foam-3 {
  width: 420px;
  height: 10px;
  bottom: 120px;
  left: 40%;
  animation: foamFloat 9s ease-in-out infinite;
  animation-delay: -6s;
}

@keyframes foamFloat {
  0%, 100% {
    transform: translateX(0) scaleX(1);
    opacity: 0.3;
  }
  30% {
    opacity: 0.7;
  }
  50% {
    transform: translateX(60px) scaleX(1.15);
    opacity: 0.5;
  }
  70% {
    opacity: 0.8;
  }
}

/* Sparkles - light reflecting on water */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
}

.sparkle-1 {
  top: 18%;
  left: 25%;
  animation: sparkleGlow 3s ease-in-out infinite;
}

.sparkle-2 {
  top: 30%;
  left: 65%;
  animation: sparkleGlow 4s ease-in-out infinite;
  animation-delay: -1.5s;
}

.sparkle-3 {
  top: 50%;
  left: 40%;
  animation: sparkleGlow 3.5s ease-in-out infinite;
  animation-delay: -0.8s;
}

.sparkle-4 {
  top: 12%;
  left: 78%;
  animation: sparkleGlow 5s ease-in-out infinite;
  animation-delay: -2.5s;
}

.sparkle-5 {
  top: 65%;
  left: 15%;
  animation: sparkleGlow 4.5s ease-in-out infinite;
  animation-delay: -3s;
}

@keyframes sparkleGlow {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}


/* ============================================================
   Shimmer Effect (on cards)
   ============================================================ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes shimmerOcean {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(12, 61, 95, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background var(--transition);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* ============================================================
   Hero / Header
   ============================================================ */
.header {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  text-align: center;
  padding: 120px 24px 80px;
}

.hero-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
  position: relative;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c3d5f, #38bdf8);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-title {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.hero-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin-top: 8px;
  line-height: 1.9;
}

.hero-links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.hero-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.hero-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}


/* ============================================================
   Sections
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 0;
}

.section-alt {
  background: rgba(0, 0, 0, 0.1);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}

.section-title-en {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.25), transparent);
}


/* ============================================================
   About
   ============================================================ */
.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.about-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

.about-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.about-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.9;
}


/* ============================================================
   Status
   ============================================================ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.08);
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.status-value {
  font-size: 0.9rem;
  color: var(--text-primary);
}


/* ============================================================
   Projects
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-status {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-status.active {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.project-status.dev {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.project-status.released {
  background: rgba(125, 211, 252, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.3);
}

.project-status.internal {
  background: rgba(168, 162, 158, 0.15);
  color: #d6d3d1;
  border: 1px solid rgba(168, 162, 158, 0.3);
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.8;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.75rem;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
}

.project-links {
  display: flex;
  gap: 16px;
  margin-top: auto;
}

.project-link {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.project-link:hover {
  text-decoration: underline;
}


/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.skill-category {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
}

.skill-category:hover {
  border-color: var(--border-hover);
}

.skill-category-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.skill-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.skill-item:last-child {
  border-bottom: none;
}

.skill-category:hover .skill-item {
  color: var(--text-primary);
}


/* ============================================================
   Articles
   ============================================================ */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: block;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

.article-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-platform {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 500;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}


/* ============================================================
   Links
   ============================================================ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  text-align: center;
  color: var(--text-primary);
}

.link-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.link-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.link-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ============================================================
   Certifications
   ============================================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.cert-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

.cert-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.cert-icon {
  color: var(--accent);
  opacity: 0.8;
}

.cert-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.cert-org {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ============================================================
   Contact
   ============================================================ */
.contact-content {
  text-align: center;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.contact-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.contact-link svg {
  flex-shrink: 0;
}


/* ============================================================
   Footer
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 61, 95, 0.5);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}


/* ============================================================
   Fade-in Animation
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   Scroll to Top Button
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: translateY(-2px);
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .nav {
    padding: 14px 20px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 61, 95, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 99;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .section-title-en {
    font-size: 1.25rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   No-JS Fallback
   ============================================================ */
noscript .fade-in {
  opacity: 1;
  transform: none;
}

noscript .ocean {
  display: none;
}
