/* ============================================
   Design - 日本のデザイナーコミュニティ
   Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Instrument+Serif:ital@0;1&family=Noto+Sans+JP:wght@300;400;500;600;700;800;900&family=Noto+Serif+JP:wght@400;500;700;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ===== DESIGN TOKENS ===== */
:root {
  /* Colors - Light Mode */
  --bg: #FAFAF7;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F2F0E8;
  --bg-hover: #EFEDE3;
  --border: #E5E2D8;
  --border-strong: #C9C5B8;
  --text-primary: #0F0F0F;
  --text-secondary: #5A5A55;
  --text-muted: #8E8B81;
  --text-inverse: #FAFAF7;

  --accent: #FF4521;
  --accent-hover: #E63A1A;
  --accent-soft: #FFE9E2;

  --success: #00A878;
  --warning: #E6A100;
  --info: #2D5BFF;
  --pink: #FF5F8A;
  --purple: #8B5CF6;
  --cyan: #06B6D4;
  --lime: #84CC16;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', 'Noto Serif JP', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;

  /* Sizes */
  --container: 1320px;
  --container-narrow: 980px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow: 0 4px 16px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 15, 15, 0.08);
  --shadow-xl: 0 24px 60px rgba(15, 15, 15, 0.12);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms var(--ease);
  --t: 280ms var(--ease);
  --t-slow: 480ms var(--ease);

  /* Header */
  --header-h: 72px;
}

[data-theme="dark"] {
  --bg: #0A0A09;
  --bg-elevated: #141413;
  --bg-subtle: #1C1C1A;
  --bg-hover: #232321;
  --border: #2A2A28;
  --border-strong: #3A3A38;
  --text-primary: #F5F5F0;
  --text-secondary: #A8A89F;
  --text-muted: #74746B;
  --text-inverse: #0A0A09;
  --accent-soft: #2A1612;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ===== BASE ===== */
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11", "palt";
  letter-spacing: 0.005em;
  overflow-x: hidden;
  transition: background-color var(--t), color var(--t);
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ===== TYPOGRAPHY ===== */
.serif { font-family: var(--font-serif); font-style: italic; }
.mono { font-family: var(--font-mono); }

.display-1 {
  font-size: clamp(56px, 11vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.display-2 {
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-secondary);
}

.lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-tight {
  padding: 56px 0;
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
}

/* ===== HEADER / NAV ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(250, 250, 247, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--t), border-color var(--t);
}

[data-theme="dark"] .site-header {
  background: rgba(10, 10, 9, 0.78);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--text-primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-link.is-active {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-size: 13px;
  color: var(--text-muted);
  min-width: 220px;
  transition: all var(--t-fast);
}

.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 69, 33, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-icon {
  padding: 10px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15px;
}

/* ===== TAG / CHIP ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--t-fast);
}

.tag.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.tag-outline {
  background: transparent;
  border-color: var(--border);
}

.tag.tag-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===== CARD ===== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t-fast), box-shadow var(--t);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* ===== AVATARS ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
  flex-shrink: 0;
  position: relative;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; }

.avatar.online::after {
  content: "";
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-elevated);
}

/* Avatar color variants - generated for variety */
.av-1 { background: linear-gradient(135deg, #FF4521, #FFB800); }
.av-2 { background: linear-gradient(135deg, #2D5BFF, #06B6D4); }
.av-3 { background: linear-gradient(135deg, #8B5CF6, #FF5F8A); }
.av-4 { background: linear-gradient(135deg, #00A878, #84CC16); }
.av-5 { background: linear-gradient(135deg, #1E1E1E, #5A5A55); }
.av-6 { background: linear-gradient(135deg, #FF5F8A, #FF4521); }
.av-7 { background: linear-gradient(135deg, #06B6D4, #2D5BFF); }
.av-8 { background: linear-gradient(135deg, #84CC16, #00A878); }
.av-9 { background: linear-gradient(135deg, #FFB800, #FF4521); }
.av-10 { background: linear-gradient(135deg, #8B5CF6, #2D5BFF); }
.av-11 { background: linear-gradient(135deg, #FF5F8A, #8B5CF6); }
.av-12 { background: linear-gradient(135deg, #FF4521, #FF5F8A); }

/* ===== SECTION HEADER ===== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin-top: 12px;
}

.section-head .lead {
  margin-top: 14px;
  max-width: 540px;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text-primary);
  color: var(--bg);
  padding: 96px 0 48px;
  margin-top: 120px;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "Design";
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(180px, 32vw, 480px);
  font-weight: 900;
  letter-spacing: -0.05em;
  opacity: 0.04;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.footer-col h4 {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.5);
  margin-bottom: 18px;
  font-weight: 500;
}

.footer-col a {
  display: block;
  font-size: 14px;
  padding: 6px 0;
  color: rgba(250, 250, 247, 0.78);
  transition: color var(--t-fast);
}

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

.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.35;
  margin-top: 16px;
  color: rgba(250, 250, 247, 0.85);
}

.footer-bottom {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid rgba(250, 250, 247, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(250, 250, 247, 0.5);
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== UTILITIES ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }

.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.4;
}

/* ===== MOBILE NAV ===== */
.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .search-trigger { display: none; }
  .mobile-nav-toggle { display: inline-flex; }
}

@media (max-width: 600px) {
  .nav { gap: 16px; }
  .nav-actions .btn:not(.btn-accent) { display: none; }
}

/* ===== ANIMATIONS ===== */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeInUp 0.8s var(--ease) both;
}

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

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
  display: inline-block;
}

/* ===== FORMS ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  color: var(--text-primary);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 4px var(--bg-subtle);
}

.textarea { resize: vertical; min-height: 120px; }

/* ===== ICON ===== */
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ===== TOAST ===== */
.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity var(--t), transform var(--t);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast svg { color: var(--accent); }

@media (max-width: 600px) {
  .toast-stack { left: 24px; right: 24px; align-items: center; }
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.is-open { display: flex; }

.modal-bg { position: absolute; inset: 0; cursor: pointer; }

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  animation: fadeInUp 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
