/* ============================================
   Dc Mails — Design System
   Concept: Constellation Chart / 星座図・航海図
   白黒モノクローム。色ではなく「線」「座標」「精度」で立体感を出す。
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- カラートークン ---- */
  --bg: #000000;
  --surface: #0A0A0B;
  --surface-raised: #111113;
  --line-faint: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.30);
  --text-primary: #EDEDEC;
  --text-dim: #8C8C92;
  --text-faint: #545458;
  --white: #FFFFFF;
  --danger: #E8E8E6; /* あえて赤を使わず、太字/線で警告を表現 */
  --danger-line: rgba(255, 255, 255, 0.4);

  /* ---- タイポグラフィ ---- */
  --font-display: 'Space Mono', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ---- スペーシング / 形状 ---- */
  --radius: 3px;
  --grid-unit: 8px;

  /* ---- 影(疑似3D用) ---- */
  --lift-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 24px 48px -22px rgba(0,0,0,0.92);
  --lift-shadow-sm: 0 1px 0 rgba(255,255,255,0.05), 0 14px 28px -14px rgba(0,0,0,0.85);

  /* ---- サーフェスの微細な質感グラデーション ---- */
  --surface-sheen: linear-gradient(165deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0) 40%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

/* ---- 背景座標グリッド(常駐する「航海図」の目盛り) ---- */
.coord-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

/* ---- 極薄グレインノイズ(完全なフラット塗りを避け、質感を持たせる) ---- */
.coord-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---- 四隅の座標クロスヘア(航海図らしいディテール) ---- */
.coord-crosshair {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  opacity: 0.55;
}
.coord-crosshair.top-left { top: 76px; left: 24px; }
.coord-crosshair.top-right { top: 76px; right: 24px; text-align: right; }
@media (max-width: 780px) { .coord-crosshair { display: none; } }

.coord-label {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

/* ---- タイポグラフィスケール ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--white);
}

h1 { text-wrap: balance; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.eyebrow::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--white);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

p { color: var(--text-dim); margin: 0; }

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

/* ---- コンテナ ---- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* ============================================
   ナビゲーション
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-faint);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 640px) {
  .nav-inner { padding: 16px 20px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
}

.brand-mark {
  width: 22px;
  height: 22px;
  position: relative;
  flex-shrink: 0;
}

.brand-mark svg { width: 100%; height: 100%; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  color: var(--text-dim);
}

.nav-links a {
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--white); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ============================================
   ボタン(疑似3Dリフト・ホバーで浮き上がる)
   ============================================ */
.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  background-image: var(--surface-sheen);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.32s ease,
              background-color 0.32s ease;
  will-change: transform;
  position: relative;
  text-align: center;
}

.btn:hover {
  transform: translateY(-3px) perspective(700px) rotateX(3.5deg);
  box-shadow: var(--lift-shadow-sm);
  border-color: var(--line-strong);
}

.btn:active {
  transform: translateY(-1px) perspective(600px) rotateX(2deg);
  transition-duration: 0.1s;
}

.btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--white);
  color: #000;
  border-color: var(--white);
  font-weight: 700;
}
.btn-primary:hover {
  box-shadow: 0 1px 0 rgba(255,255,255,0.2), 0 24px 48px -20px rgba(255,255,255,0.25);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--line);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-danger { border-color: var(--danger-line); }
.btn-danger:hover { background: rgba(255,255,255,0.06); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================
   カード(3D perspective ホバーリフト)
   ============================================ */
.card {
  background: var(--surface);
  background-image: var(--surface-sheen);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.45s ease;
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-6px) perspective(1100px) rotateX(1.8deg);
  box-shadow: var(--lift-shadow);
  border-color: var(--line);
}

/* ============================================
   フォーム要素
   ============================================ */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input, .field textarea {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.field .hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

.field .error-text {
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 6px;
  font-family: var(--font-mono);
}
.field .error-text::before { content: '! '; }

/* ============================================
   バッジ / ラベル
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-dim);
}

.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--white); }
.badge-active .badge-dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   ユーティリティ
   ============================================ */
.text-mono { font-family: var(--font-mono); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.divider { height: 1px; background: var(--line-faint); border: none; margin: 32px 0; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ---- スクロールリビール ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- ローディングスピナー(線画テイスト) ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- トースト通知 ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: var(--white);
  color: #000;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.8);
  animation: toast-in 0.4s cubic-bezier(0.16,1,0.3,1);
}

.toast.toast-error {
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- フッター ---- */
.footer {
  border-top: 1px solid var(--line-faint);
  padding: 40px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ---- スクロールバー ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }
