/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --bg-sub: #1a1a1a;
  --bg-card: #141414;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.4);
  --border: rgba(0, 212, 255, 0.2);
  --radius: 6px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}
a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.navbar-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.navbar-logo span {
  color: var(--text-dim);
}

.navbar-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.navbar-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--accent);
}

/* 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: var(--text-dim);
  transition: all 0.3s;
}

/* ===== PAGE WRAPPER ===== */
.page {
  padding-top: 56px;
}

/* ===== HERO ===== */
.hero {
  padding: 96px 0 80px;
  position: relative;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-name .accent { color: var(--accent); }

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--accent);
  color: #0f0f0f;
  font-weight: 700;
}
.btn-primary:hover {
  background: #00b8d9;
  color: #0f0f0f;
  opacity: 1;
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text-dim);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

/* ===== SECTION ===== */
.section {
  padding: 72px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 200px;
}

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
  transform: translateY(-2px);
}

/* ===== GRID ===== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ===== TAGS ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--accent-dim);
  letter-spacing: 0.03em;
}

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.badge-green { background: rgba(0, 200, 100, 0.15); color: #00c864; border: 1px solid rgba(0, 200, 100, 0.3); }
.badge-yellow { background: rgba(255, 200, 0, 0.15); color: #ffc800; border: 1px solid rgba(255, 200, 0, 0.3); }
.badge-blue { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border); }

/* ===== SKILLS GRID ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.skill-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.skill-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-item {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-item::before {
  content: '›';
  color: var(--accent);
  font-weight: bold;
}

/* ===== WORKS ===== */
.work-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.work-summary {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.work-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.work-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-points li {
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}

.work-points li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
}

.work-links {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.work-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.work-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-position {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.timeline-description {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.6;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.timeline-list li {
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}

.timeline-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.philosophy-block {
  background: var(--bg-sub);
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 24px;
}

/* ===== CONTACT ===== */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  color: var(--text);
}

.contact-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-dim);
  color: var(--accent);
  opacity: 1;
}

.contact-icon {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  min-width: 64px;
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: 14px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.page-header-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.page-header-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 8px;
  max-width: 480px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.footer a {
  color: var(--text-dim);
}
.footer a:hover { color: var(--accent); }

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* ===== FADE-IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 15, 15, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }
  .navbar-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }

  .hero { padding: 72px 0 56px; }
  .section { padding: 48px 0; }
  .page-header { padding: 48px 0 32px; margin-bottom: 40px; }
}

@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .stats-row { gap: 24px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== ANIMATIONS ===== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent-glow); }
  50% { box-shadow: 0 0 18px var(--accent-glow), 0 0 36px rgba(0, 212, 255, 0.1); }
}

@keyframes scan {
  0% { top: 0; opacity: 0.4; }
  50% { opacity: 0.15; }
  100% { top: 100%; opacity: 0; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
}

/* ===== CURSOR ===== */
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* ===== STATUS DOT ===== */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #00c864;
  background: rgba(0, 200, 100, 0.08);
  border: 1px solid rgba(0, 200, 100, 0.25);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00c864;
  box-shadow: 0 0 8px #00c864;
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ===== TERMINAL PROMPT ===== */
.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.terminal-prompt .path { color: var(--accent); }
.terminal-prompt .dollar { color: #888; margin-left: 6px; }

/* ===== STATS ROW ===== */
.stats-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ===== HERO SCAN LINE ===== */
.hero {
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
  animation: scan 5s linear infinite;
  pointer-events: none;
  opacity: 0.2;
}

/* ===== NAVBAR SCROLL STATE ===== */
.navbar.scrolled {
  background: rgba(8, 8, 8, 0.97);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.6);
  border-bottom-color: rgba(0, 212, 255, 0.15);
}

/* ===== GLOW PULSE ON TIMELINE DOT ===== */
.timeline-item::before {
  animation: glow-pulse 2.5s ease-in-out infinite;
}

/* ===== SECTION ALT ===== */
.section-alt {
  background: var(--bg-sub);
}

/* ===== HERO NAME FLICKER ===== */
.hero-name {
  animation: flicker 8s ease-in-out infinite;
}

/* ===== ACCENT LINE ===== */
.accent-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 48px 0;
  opacity: 0.3;
}

/* ===== WORK CARD ACCENT ===== */
.card.work-card {
  border-left: 2px solid var(--border);
  transition: border-left-color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.card.work-card:hover {
  border-left-color: var(--accent);
}

/* ===== PAGE LABEL ICON ===== */
.page-header-label::before {
  content: '> ';
  color: var(--accent);
}

/* ===== CONTACT ICON GLOW ===== */
.contact-item:hover .contact-icon {
  text-shadow: 0 0 10px var(--accent);
}

/* ===== HERO LABEL OVERRIDE ===== */
.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

/* ===== CODE BLOCK ===== */
.code-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.code-line .ln {
  color: rgba(0, 212, 255, 0.3);
  user-select: none;
  min-width: 20px;
}

.code-line .kw { color: #c792ea; }
.code-line .str { color: #c3e88d; }
.code-line .fn { color: var(--accent); }
