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

:root {
  --font: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --c-bg: #f8f7f5;
  --c-surface: #ffffff;
  --c-border: #e8e6e0;
  --c-text: #1a1a18;
  --c-muted: #6b6b68;
  --c-subtle: #9a9a96;

  /* Phase colors */
  --p1: #1D9E75; --p1-light: #E1F5EE; --p1-dark: #085041;
  --p2: #378ADD; --p2-light: #E6F1FB; --p2-dark: #0C447C;
  --p3: #D85A30; --p3-light: #FAECE7; --p3-dark: #4A1B0C;
  --p4: #639922; --p4-light: #EAF3DE; --p4-dark: #173404;
  --p5: #BA7517; --p5-light: #FAEEDA; --p5-dark: #412402;
  --p6: #D4537E; --p6-light: #FBEAF0; --p6-dark: #4B1528;
  --p7: #7F77DD; --p7-light: #EEEDFE; --p7-dark: #26215C;
  --p8: #534AB7; --p8-light: #ECEAFA; --p8-dark: #1B164A;
  --p9: #888780; --p9-light: #F1EFE8; --p9-dark: #2C2C2A;

  /* Stage colors (基/応/発) */
  --stage-basic:    #1D9E75;
  --stage-applied:  #BA7517;
  --stage-advanced: #7F77DD;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.7; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ===== Layout ===== */
.container { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }

/* ===== Header ===== */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: .875rem 0;
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
}
.site-logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #1D9E75 0%, #378ADD 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.site-logo-text { font-size: 15px; font-weight: 700; line-height: 1.3; }
.site-logo-sub { font-size: 11px; color: var(--c-muted); font-weight: 400; }
.header-badge {
  background: #E1F5EE; color: #0F6E56;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  white-space: nowrap;
}

/* ===== Hero ===== */
.hero {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: #E1F5EE; color: #0F6E56;
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  margin-bottom: 1rem;
}
.hero h1 { font-size: 2rem; font-weight: 700; line-height: 1.35; margin-bottom: .75rem; }
.hero h1 span { color: var(--p1); }
.hero-desc { font-size: 15px; color: var(--c-muted); max-width: 560px; margin: 0 auto 2rem; line-height: 1.8; }
.hero-stats {
  display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.75rem; font-weight: 700; color: var(--p1); }
.hero-stat-label { font-size: 12px; color: var(--c-muted); margin-top: 2px; }

/* ===== Phase Legend ===== */
.legend-section { padding: 2rem 0 0; }
.legend-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.legend-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
  margin-bottom: 1.5rem;
}
.legend-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ===== Month Section ===== */
.month-section { padding: 2rem 0; }
.month-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 1.25rem;
}
.month-title { font-size: 1.125rem; font-weight: 700; }
.month-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.month-badge.kiso { background: #E1F5EE; color: #0F6E56; }
.month-badge.oyo  { background: #EEEDFE; color: #3C3489; }

/* ===== Calendar Grid ===== */
.cal-wrap { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--c-border);
}
.cal-dow-cell {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--c-muted);
  padding: 8px 0; border-right: 1px solid var(--c-border);
}
.cal-dow-cell:last-child { border-right: none; }
.cal-body {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-cell {
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  min-height: 80px; padding: 8px; font-size: 11px;
  position: relative; overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.empty { background: #fafaf8; }
.cal-cell.has-day { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.cal-cell.has-day:hover { box-shadow: var(--shadow-md); z-index: 1; transform: scale(1.02); }
.cal-cell-date { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.cal-cell-daynum { font-size: 10px; font-weight: 500; margin-bottom: 3px; opacity: .75; }
.cal-cell-title { font-size: 10px; line-height: 1.4; }

.cal-cell.survey-day {
  background: #EEEDFE; border-left: 3px solid var(--p7);
}
.survey-day .cal-cell-date { color: var(--p7-dark); }

/* Phase bg + text */
.p1-cell { background: var(--p1-light); }
.p1-cell .cal-cell-date { color: var(--p1-dark); }
.p1-cell .cal-cell-daynum { color: var(--p1); }
.p1-cell .cal-cell-title { color: var(--p1-dark); }

.p2-cell { background: var(--p2-light); }
.p2-cell .cal-cell-date { color: var(--p2-dark); }
.p2-cell .cal-cell-daynum { color: var(--p2); }
.p2-cell .cal-cell-title { color: var(--p2-dark); }

.p3-cell { background: var(--p3-light); }
.p3-cell .cal-cell-date { color: var(--p3-dark); }
.p3-cell .cal-cell-daynum { color: var(--p3); }
.p3-cell .cal-cell-title { color: var(--p3-dark); }

.p4-cell { background: var(--p4-light); }
.p4-cell .cal-cell-date { color: var(--p4-dark); }
.p4-cell .cal-cell-daynum { color: var(--p4); }
.p4-cell .cal-cell-title { color: var(--p4-dark); }

.p5-cell { background: var(--p5-light); }
.p5-cell .cal-cell-date { color: var(--p5-dark); }
.p5-cell .cal-cell-daynum { color: var(--p5); }
.p5-cell .cal-cell-title { color: var(--p5-dark); }

.p6-cell { background: var(--p6-light); }
.p6-cell .cal-cell-date { color: var(--p6-dark); }
.p6-cell .cal-cell-daynum { color: var(--p6); }
.p6-cell .cal-cell-title { color: var(--p6-dark); }

.p7-cell { background: var(--p7-light); }
.p7-cell .cal-cell-date { color: var(--p7-dark); }
.p7-cell .cal-cell-daynum { color: var(--p7); }
.p7-cell .cal-cell-title { color: var(--p7-dark); }

.p8-cell { background: var(--p8-light); }
.p8-cell .cal-cell-date { color: var(--p8-dark); }
.p8-cell .cal-cell-daynum { color: var(--p8); }
.p8-cell .cal-cell-title { color: var(--p8-dark); }

.p9-cell { background: var(--p9-light); }
.p9-cell .cal-cell-date { color: var(--p9-dark); }
.p9-cell .cal-cell-daynum { color: var(--p9); }
.p9-cell .cal-cell-title { color: var(--p9-dark); }

/* Goal badge (中間ゴール / 最終ゴール) */
.cal-cell .goal-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #BA7517; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 8px;
  letter-spacing: .02em;
  line-height: 1.2;
}
.cal-cell .goal-badge.final {
  background: #534AB7;
}
.cal-cell.has-day { position: relative; }

.day-goal-banner {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, #FFF8E1 0%, #FAEEDA 100%);
  border: 1px solid #BA7517;
  color: #5C3A0C;
  font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 16px;
  margin-top: .75rem;
}
.day-goal-banner.final {
  background: linear-gradient(90deg, #EEEDFE 0%, #ECEAFA 100%);
  border-color: #534AB7;
  color: #2D2670;
}
.day-goal-banner-icon { font-size: 16px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--c-border); background: var(--c-surface);
  padding: 2rem 0; text-align: center;
  font-size: 12px; color: var(--c-muted); margin-top: 3rem;
}

/* ===== Day Page ===== */
.day-hero {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 2.5rem 0 2rem;
}
.day-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--c-muted); margin-bottom: 1rem;
}
.day-breadcrumb a:hover { color: var(--c-text); }
.day-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 1rem;
}
.day-phase-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.day-num-badge {
  font-size: 11px; color: var(--c-muted); padding: 3px 8px;
  background: var(--c-bg); border-radius: 20px; border: 1px solid var(--c-border);
}
.day-title { font-size: 1.625rem; font-weight: 700; line-height: 1.4; margin-bottom: .75rem; }
.day-info-row {
  display: flex; flex-wrap: wrap; gap: 1rem; font-size: 13px; color: var(--c-muted);
}
.day-info-item { display: flex; align-items: center; gap: 5px; }

/* Stars */
.stars { display: flex; gap: 2px; }
.star { font-size: 14px; color: #d4d4d0; }
.star.filled { color: #BA7517; }

/* Tools */
.tools-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.tool-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-text);
}

/* Day Content */
.day-content { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.content-section { margin-bottom: 2.5rem; }
.content-section-label {
  font-size: 12px; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .625rem;
}
.content-section h2 {
  font-size: 1rem; font-weight: 700; margin-bottom: .875rem;
}

/* Hook */
.hook-box {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  font-size: 15px; line-height: 1.8; color: var(--c-text);
  border-left: 4px solid var(--p1);
}

/* Concept */
.concept-box {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  font-size: 15px; line-height: 1.8;
}

/* Steps */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.step-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--p1); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text { font-size: 14px; line-height: 1.7; padding-top: 3px; }

/* Before/After */
.ba-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
}
.ba-box {
  border-radius: var(--radius); padding: 1rem 1.25rem;
  border: 1px solid var(--c-border);
}
.ba-box.before { background: #FFF5F5; border-color: #FECACA; }
.ba-box.after  { background: #F0FFF4; border-color: #A7F3D0; }
.ba-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ba-box.before .ba-label { color: #991B1B; }
.ba-box.after  .ba-label { color: #065F46; }
.ba-text { font-size: 14px; line-height: 1.6; }
.ba-arrow { font-size: 24px; color: var(--c-subtle); }

/* First Step CTA */
.firststep-box {
  background: linear-gradient(135deg, #E1F5EE 0%, #E6F1FB 100%);
  border-radius: var(--radius); padding: 1.5rem 1.75rem;
  border: 1px solid #9FE1CB;
}
.firststep-label {
  font-size: 11px; font-weight: 700; color: var(--p1);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.firststep-text { font-size: 15px; font-weight: 600; line-height: 1.7; }

/* Nav arrows */
.day-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 0; margin-top: 2rem;
  border-top: 1px solid var(--c-border);
}
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: .625rem 1rem;
  font-size: 13px; cursor: pointer; transition: background .15s;
}
.nav-btn:hover { background: var(--c-bg); }
.nav-btn.disabled { opacity: .35; pointer-events: none; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { gap: 1.25rem; }
  .cal-cell { min-height: 60px; padding: 5px; }
  .cal-cell-title { display: none; }
  .ba-row { grid-template-columns: 1fr; }
  .ba-arrow { display: none; }
  .day-title { font-size: 1.25rem; }
}
