/* ===========================
   Variables
=========================== */
:root {
  --bg:          #ffffff;
  --bg-sub:      #f4fdf9;
  --bg-card:     #ffffff;
  --text:        #111111;
  --text-dim:    #666666;
  --accent:      #10b981;
  --accent-dark: #059669;
  --accent-dim:  rgba(16, 185, 129, 0.10);
  --accent-glow: rgba(16, 185, 129, 0.30);
  --border:      rgba(16, 185, 129, 0.22);
  --border-base: #ebebeb;
  --radius:      8px;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans:   -apple-system, BlinkMacSystemFont, "Hiragino Sans",
                 "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

/* ===========================
   Background System
=========================== */
.bg-container {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.bg-slide.active {
  opacity: 1;
}

/* 白＋エメラルド系のオーバーレイ：画像がうっすら透けて見える */
.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.91) 0%,
    rgba(240, 253, 248, 0.87) 50%,
    rgba(255, 255, 255, 0.91) 100%
  );
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: transparent;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s, opacity 0.2s;
}

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

/* ===========================
   Layout
=========================== */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  flex: 1;
  padding-bottom: 72px;
}

/* ===========================
   Hero
=========================== */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  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 6s linear infinite;
  pointer-events: none;
  opacity: 0.25;
}

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

.hero-inner {
  text-align: center;
  padding: 60px 24px 40px;
}

/* ステータスドット */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  padding: 5px 16px;
  border-radius: 100px;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

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

/* ターミナルプロンプト */
.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.terminal-prompt .path   { color: var(--accent); }
.terminal-prompt .dollar { color: #aaa; }

/* アバター */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  border: 2px solid var(--border);
  box-shadow:
    0 0 0 5px var(--accent-dim),
    0 6px 24px rgba(16, 185, 129, 0.15);
  background: var(--bg-sub);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* 見出し */
h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--text);
  animation: flicker 10s ease-in-out infinite;
}

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

@keyframes flicker {
  0%, 100% { opacity: 1; }
  93%  { opacity: 1; }
  94%  { opacity: 0.85; }
  95%  { opacity: 1; }
  97%  { opacity: 0.9; }
  98%  { opacity: 1; }
}

.hero-sub {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-tagline {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* スクロールヒント */
.scroll-hint {
  margin-top: 52px;
  display: flex;
  justify-content: center;
}

.scroll-hint span {
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ===========================
   Section
=========================== */
.section {
  padding: 64px 0 0;
}

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

.section-label::before {
  content: '> ';
}

.section-title {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text);
}

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

/* フェードイン */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* アクセントライン */
.accent-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 64px 0 0;
  opacity: 0.25;
}

/* ===========================
   Link Buttons
=========================== */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

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

/* Primary */
.link-btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.link-btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.5);
  opacity: 1;
}

.link-btn-primary .link-desc {
  color: rgba(255, 255, 255, 0.65);
}

/* Outline */
.link-btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-base);
}

.link-btn-outline:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  color: var(--accent);
  opacity: 1;
}

.link-btn-outline .link-desc {
  color: var(--text-dim);
}

.link-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
}

.link-btn-primary .link-icon {
  background: rgba(255, 255, 255, 0.2);
}

.link-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-label {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.3;
}

.link-desc {
  font-size: 0.74rem;
  line-height: 1.3;
}

.link-arrow {
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.15s, transform 0.15s;
}

.link-btn:hover .link-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ===========================
   Work Cards
=========================== */
.works {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-left: 2px solid var(--border-base);
  border-radius: var(--radius);
  padding: 18px 18px 18px 16px;
  transition: border-color 0.22s, border-left-color 0.22s, box-shadow 0.22s, transform 0.22s;
}

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

.work-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.work-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-base);
  background: var(--bg-sub);
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.work-info {
  flex: 1;
}

.work-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.work-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.4;
}

.work-link {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.work-link:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  opacity: 1;
}

/* ===========================
   SNS
=========================== */
.section-sns {
  text-align: center;
}

.sns-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sns-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  padding: 11px 32px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  letter-spacing: 0.06em;
}

.sns-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
  opacity: 1;
}

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

/* ===========================
   Scrollbar
=========================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: rgba(16, 185, 129, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===========================
   Responsive
=========================== */
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }

  .hero { min-height: 80vh; }

  .work-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .work-thumb {
    width: 100%;
    height: 120px;
  }

  .work-link {
    align-self: flex-start;
  }

  .link-btn {
    padding: 13px 14px;
  }
}
