/* ── Fuji-iro design system ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f7f4f0;
  --dark-purple:  #2d1b4e;
  --mid-purple:   #7c5cbf;
  --light-tint:   #e0d4f0;
  --warm-neutral: #a89070;
  --text:         #2a2035;
  --muted:        #64748b;
  --white:        #ffffff;
  --shadow-sm:    0 2px 8px rgba(45, 27, 78, 0.07), 0 1px 2px rgba(45, 27, 78, 0.04);
  --shadow-md:    0 6px 20px rgba(45, 27, 78, 0.13), 0 2px 6px rgba(45, 27, 78, 0.07);
  --radius:       16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Hero header (homepage) ── */
.hero-header {
  background: var(--dark-purple);
  color: var(--bg);
  padding: 4rem 2rem 3rem;
  text-align: center;
}

.hero-header h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--bg);
}

.hero-header p {
  font-size: 1.05rem;
  color: var(--light-tint);
  opacity: 0.85;
}

/* ── Site header (tool/game pages) ── */
.site-header {
  background: var(--dark-purple);
  color: var(--bg);
  padding: 1.75rem 2rem 1.5rem;
}

.site-header .back-link {
  display: inline-block;
  color: var(--light-tint);
  text-decoration: none;
  font-size: 0.875rem;
  opacity: 0.75;
  margin-bottom: 0.5rem;
  transition: opacity 0.15s;
}

.site-header .back-link:hover { opacity: 1; }

.page-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bg);
}

/* ── Layout ── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.container--wide {
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

section + section { margin-top: 3.5rem; }

/* ── Card grid ── */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.grid > .card {
  flex: 1 1 250px;
  max-width: 290px;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(124, 92, 191, 0.1);
}

.card + .card {
  margin-top: 1.25rem;
}

a.card {
  display: block;
  padding: 1.5rem 1.5rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-purple);
  margin-bottom: 0.35rem;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Section label ── */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-neutral);
  margin-bottom: 1rem;
}

/* ── Description text ── */
.description {
  color: var(--muted);
  font-size: 0.925rem;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.description p + p { margin-top: 0.6rem; }

.description ol,
.description ul {
  padding-left: 1.5rem;
  margin: 0.6rem 0;
}

.description li { margin-bottom: 0.3rem; }

/* ── Form ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--light-tint);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--mid-purple);
}

.required { color: #e11d48; }

/* ── Button ── */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--dark-purple), var(--mid-purple));
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--light-tint);
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child { text-align: left; }

.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--light-tint);
  text-align: right;
}

.data-table td:first-child { text-align: left; font-weight: 500; }

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: rgba(224, 212, 240, 0.3); }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { opacity: 0; animation: fadeUp 0.35s ease forwards; }

.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.10s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.20s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
.fade-in:nth-child(6) { animation-delay: 0.30s; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--warm-neutral);
  border-top: 1px solid var(--light-tint);
}
