/* ============================================
   YUKI Portfolio – Terminal Dark Theme
   ============================================ */

:root {
  --bg-deep: #06060e;
  --bg-primary: #0a0a14;
  --bg-surface: #111122;
  --bg-elevated: #181830;
  --border-color: #222240;
  --border-subtle: #1a1a32;

  --accent: #5eead4;
  --accent-rgb: 94, 234, 212;
  --accent-dim: rgba(94, 234, 212, 0.07);
  --accent-glow: rgba(94, 234, 212, 0.25);

  --text-primary: #e2e2ec;
  --text-secondary: #9898b0;
  --text-muted: #555570;

  --mono: 'JetBrains Mono', monospace;
  --sans: 'Noto Sans JP', sans-serif;

  --radius: 8px;
  --radius-lg: 12px;
  --max-w: 1100px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-deep);
}

body {
  font-family: var(--sans);
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle, rgba(var(--accent-rgb), 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

::selection {
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--text-primary);
}

/* ── Navigation ────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border-subtle);
}

.nav-logo {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.5px;
}

.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex; gap: 2.2rem; align-items: center;
}

.nav-link {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.25s;
  position: relative; letter-spacing: 0.3px;
}

.nav-link::before {
  content: '>';
  margin-right: 4px;
  color: transparent;
  transition: color 0.25s;
}

.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link:hover::before, .nav-link.active::before { color: var(--accent); }

/* Mobile hamburger */
.nav-hamburger {
  display: none; width: 32px; height: 32px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-secondary);
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: currentColor; border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(6, 6, 14, 0.96);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  padding: 2rem clamp(1.5rem, 5vw, 3rem);
  gap: 0.5rem; z-index: 99;
  transform: translateY(-10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.mobile-menu .nav-link {
  font-size: 1.1rem; padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Hero ──────────────────────────────────── */
.hero {
  min-height: 100vh; position: relative;
  display: flex; align-items: center;
  padding: 80px clamp(1.5rem, 5vw, 3rem) 3rem;
  overflow: hidden;
}

.hero-canvas {
  position: absolute; inset: 0;
  z-index: 0;
}

.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-text { display: flex; flex-direction: column; gap: 0; }

.hero-greeting {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.6rem; letter-spacing: 1px;
  opacity: 0; animation: fadeSlideUp 0.6s 0.2s forwards;
}

.hero-name {
  font-family: var(--mono);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 700; line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  opacity: 0; animation: fadeSlideUp 0.6s 0.35s forwards;
}

.hero-tagline {
  font-family: var(--mono); font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  min-height: 1.5em;
  opacity: 0; animation: fadeSlideUp 0.6s 0.5s forwards;
}

.hero-tagline .cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
}

.hero-desc {
  font-size: 0.92rem; color: var(--text-secondary);
  max-width: 440px; line-height: 1.8;
  margin-bottom: 1.8rem;
  opacity: 0; animation: fadeSlideUp 0.6s 0.65s forwards;
}

.hero-social {
  display: flex; gap: 0.6rem;
  opacity: 0; animation: fadeSlideUp 0.6s 0.8s forwards;
}

.hero-social-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.hero-social-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.15);
}

.hero-social-btn svg { width: 18px; height: 18px; }

/* Neofetch card */
.neofetch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0; overflow: hidden;
  max-width: 340px;
  justify-self: end;
  opacity: 0; animation: fadeSlideUp 0.8s 0.5s forwards;
  transition: box-shadow 0.4s;
}

.neofetch-card:hover {
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.06);
}

.neofetch-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}

.neofetch-dots { display: flex; gap: 5px; }
.neofetch-dots span {
  width: 9px; height: 9px; border-radius: 50%;
}
.neofetch-dots span:nth-child(1) { background: #ff5f57; }
.neofetch-dots span:nth-child(2) { background: #febc2e; }
.neofetch-dots span:nth-child(3) { background: #28c840; }

.neofetch-title {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted);
}

.neofetch-body {
  padding: 16px 18px;
  font-family: var(--mono); font-size: 0.75rem;
  line-height: 1.9; color: var(--text-secondary);
}

.neofetch-body .nf-label { color: var(--accent); }
.neofetch-body .nf-sep { color: var(--text-muted); margin: 0 4px; }

.neofetch-divider {
  display: block; color: var(--border-color);
  margin: 2px 0; user-select: none;
}

.hero-scroll {
  position: absolute; bottom: 2rem;
  left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted); letter-spacing: 2px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: gentleBounce 2.5s ease-in-out infinite;
  z-index: 1;
}

.hero-scroll svg { width: 16px; height: 16px; color: var(--text-muted); }

/* ── Terminal Window Component ─────────────── */
.terminal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.4s;
}

.terminal-window:hover {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.terminal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}

.terminal-dots { display: flex; gap: 6px; }
.terminal-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title-text {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 24px 28px;
  font-family: var(--mono); font-size: 0.82rem;
  line-height: 1.9; color: var(--text-secondary);
}

.t-line { margin-bottom: 4px; }

.t-prompt {
  color: var(--accent); margin-right: 8px;
  user-select: none;
}

.t-cmd { color: var(--text-primary); font-weight: 500; }
.t-flag { color: var(--accent); opacity: 0.7; }

.t-output {
  padding-left: 18px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 0.88rem;
}

.t-env-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-left: 18px; margin-bottom: 8px;
}

.t-env-tag {
  font-family: var(--mono); font-size: 0.72rem;
  padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 4px;
  color: var(--accent);
}

/* ── Sections common ──────────────────────── */
.section {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 5vw, 3rem);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

.section-label .sl-accent { color: var(--accent); }

/* ── About ─────────────────────────────────── */
.about-section {
  background: var(--bg-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 720px;
}

/* ── Works ─────────────────────────────────── */
.works-section {
  background: var(--bg-deep);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 220px;
  gap: 14px;
}

.work-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.3s;
}

.work-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
}

.work-card-featured {
  grid-column: span 2;
  grid-row: span 2;
}

.work-card-visual {
  width: 100%; height: 100%;
  position: relative; overflow: hidden;
}

.work-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card:hover .work-card-img { transform: scale(1.06); }

.work-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-surface));
}

.work-card-placeholder-icon {
  font-family: var(--mono); font-size: 2.5rem;
  color: var(--border-color); font-weight: 300;
}

.work-card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(6, 6, 14, 0.92) 0%, rgba(6, 6, 14, 0.4) 55%, transparent 100%);
}

.work-card-overlay-title {
  font-family: var(--mono); font-size: 0.95rem;
  font-weight: 600; color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 0.25s;
}

.work-card:hover .work-card-overlay-title { color: var(--accent); }

.work-card-period {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.work-card-detail {
  font-size: 0.8rem; color: var(--text-secondary);
  line-height: 1.6;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.work-card-tech {
  display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  margin-top: 8px;
}

.work-card:hover .work-card-period,
.work-card:hover .work-card-detail,
.work-card:hover .work-card-tech {
  max-height: 200px; opacity: 1;
}

.work-tech-tag {
  font-family: var(--mono); font-size: 0.62rem;
  padding: 2px 7px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 3px;
  color: var(--accent); white-space: nowrap;
}

/* ── Works: WIP & repo link ─────────────────── */
.work-card-wip {
  opacity: 0.55;
  filter: saturate(0.3);
  pointer-events: none;
}

.work-card-wip-badge {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 4px;
}

.work-card-repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  width: 28px; height: 28px;
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
  pointer-events: all;
}

.work-card-repo-link:hover { color: var(--accent); }
.work-card-repo-link svg { width: 18px; height: 18px; }

/* ── Skills ────────────────────────────────── */
.skills-section {
  background: var(--bg-primary);
}

.skills-desc {
  font-size: 0.88rem; color: var(--text-secondary);
  max-width: 620px; line-height: 1.8;
  margin-bottom: 2.5rem;
}

.skills-bars {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 3rem;
  max-width: 600px;
}

.skill-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  gap: 14px;
  align-items: center;
}

.skill-bar-name {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-secondary); text-align: right;
  white-space: nowrap;
}

.skill-bar-track {
  height: 5px;
  background: var(--border-color);
  border-radius: 3px; overflow: hidden;
}

.skill-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-bar-val {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted);
}

.skills-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

.skill-group-label {
  font-family: var(--mono); font-size: 0.68rem;
  font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 0.6rem;
  opacity: 0.8;
}

.skill-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.skill-chip {
  font-family: var(--mono); font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.skill-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Timeline (Git Log) ───────────────────── */
.timeline-section {
  background: var(--bg-deep);
}

.git-log {
  max-width: 600px;
}

.git-entry {
  display: flex; gap: 16px;
  position: relative;
}

.git-graph {
  display: flex; flex-direction: column; align-items: center;
  width: 18px; flex-shrink: 0;
  padding-top: 3px;
}

.git-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.35);
  flex-shrink: 0;
}

.git-connector {
  flex: 1; width: 2px;
  background: var(--border-color);
  margin: 4px 0;
}

.git-content {
  flex: 1;
  padding-bottom: 2rem;
}

.git-meta {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 4px;
}

.git-hash {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent); opacity: 0.7;
}

.git-year {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text-muted);
}

.git-title {
  font-family: var(--mono); font-size: 0.92rem;
  font-weight: 500; color: var(--text-primary);
  margin-bottom: 4px;
}

.git-desc {
  font-size: 0.84rem; color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Footer ────────────────────────────────── */
.footer {
  padding: 3rem clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}

.footer-left {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-prompt { color: var(--accent); margin-right: 6px; }

.footer-links {
  display: flex; gap: 1.2rem;
}

.footer-link {
  color: var(--text-muted);
  transition: color 0.25s;
}

.footer-link:hover { color: var(--accent); }
.footer-link svg { width: 18px; height: 18px; }

/* ── Scroll to Top ─────────────────────────── */
.scroll-top-btn {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 38px; height: 38px; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-muted);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, color 0.25s, border-color 0.25s;
}

.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }
.scroll-top-btn:hover { color: var(--accent); border-color: var(--accent); }
.scroll-top-btn svg { width: 16px; height: 16px; }

/* ── Fade-in on scroll ─────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Keyframes ─────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes gentleBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .neofetch-card { justify-self: start; max-width: 300px; }

  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
  .work-card-featured {
    grid-column: span 2;
    grid-row: span 1;
  }

  .skills-groups { grid-template-columns: 1fr; }
  .skill-bar-row { grid-template-columns: 90px 1fr 40px; }
}

@media (max-width: 600px) {
  .nav-links-desktop { display: none !important; }
  .nav-hamburger { display: flex; }

  .hero { padding-top: 100px; }
  .hero-name { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .neofetch-card { display: none; }

  .works-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .work-card-featured {
    grid-column: span 1;
    grid-row: span 1;
  }

  .skill-bar-row {
    grid-template-columns: 80px 1fr 36px;
    gap: 8px;
  }
  .skill-bar-name { font-size: 0.68rem; }

  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (min-width: 601px) {
  .nav-hamburger { display: none; }
  .mobile-menu { display: none !important; }
}
