/* ==========================================================================
   Tutorial / How-to-use Page
   ========================================================================== */

:root {
  --tut-bg: #f8fafc;
  --tut-surface: #ffffff;
  --tut-brand: #14b8a6;
  --tut-brand-dark: #0d9488;
  --tut-accent: #f59e0b;
  --tut-ink: #0f172a;
  --tut-ink-soft: #64748b;
  --tut-stroke: #e2e8f0;
  --tut-radius: 20px;
  --tut-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

/* ---------- hero ---------- */
.tut-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}
.tut-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(20,184,166,.25) 0%, transparent 60%);
  pointer-events: none;
}
.tut-hero__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--tut-brand);
  background: #fff;
  object-fit: cover;
  margin: 0 auto 24px;
  display: block;
  position: relative;
  box-shadow: 0 0 30px rgba(20,184,166,.35);
}
.tut-hero__title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  line-height: 1.3;
  margin: 0 0 12px;
  position: relative;
}
.tut-hero__title span { color: var(--tut-brand); }
.tut-hero__sub {
  font-size: 18px;
  color: rgba(255,255,255,.6);
  margin: 0;
  position: relative;
}

/* ---------- table of contents ---------- */
.tut-toc {
  max-width: 720px;
  margin: -32px auto 0;
  padding: 28px 32px;
  background: var(--tut-surface);
  border-radius: var(--tut-radius);
  box-shadow: var(--tut-shadow);
  position: relative;
  z-index: 2;
}
.tut-toc__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tut-ink-soft);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tut-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.tut-toc__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #f1f5f9;
  text-decoration: none;
  color: var(--tut-ink);
  font-weight: 600;
  font-size: 15px;
  transition: background .2s, transform .15s;
}
.tut-toc__item:hover {
  background: rgba(20,184,166,.1);
  transform: translateX(4px);
}
.tut-toc__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tut-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- steps container ---------- */
.tut-steps {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---------- single step ---------- */
.tut-step {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 1px solid var(--tut-stroke);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .5s ease, transform .5s ease;
}
.tut-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tut-step:last-child { border-bottom: none; }

.tut-step__aside {
  text-align: center;
  position: sticky;
  top: 100px;
}
.tut-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tut-brand);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
}
.tut-step__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--tut-brand);
  background: #fff;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.tut-step__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tut-brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}
.tut-step__title {
  font-size: 24px;
  font-weight: 900;
  color: var(--tut-ink);
  margin: 0 0 12px;
  line-height: 1.3;
}
.tut-step__desc {
  font-size: 15px;
  color: var(--tut-ink-soft);
  line-height: 1.7;
  margin: 0 0 20px;
}
.tut-step__tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(20,184,166,.08);
  border-left: 4px solid var(--tut-brand);
  font-size: 14px;
  color: var(--tut-ink);
  margin-bottom: 20px;
}
.tut-step__tip-icon {
  flex-shrink: 0;
  font-size: 18px;
}

/* ---------- mock UI ---------- */
.tut-mock {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--tut-stroke);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  background: var(--tut-surface);
}
.tut-mock__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--tut-stroke);
}
.tut-mock__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}
.tut-mock__dot--r { background: #f87171; }
.tut-mock__dot--y { background: #fbbf24; }
.tut-mock__dot--g { background: #34d399; }
.tut-mock__body {
  padding: 20px;
}

/* mock: login */
.tut-mock-login {
  text-align: center;
  padding: 32px 20px;
}
.tut-mock-login__logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--tut-brand);
  margin-bottom: 20px;
}
.tut-mock-login__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  border: 1px solid var(--tut-stroke);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--tut-ink);
}
.tut-mock-login__google {
  width: 18px;
  height: 18px;
}

/* mock: keyword form */
.tut-mock-form {}
.tut-mock-form__row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}
.tut-mock-form__field {
  flex: 1;
}
.tut-mock-form__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--tut-ink-soft);
  margin-bottom: 4px;
}
.tut-mock-form__input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--tut-stroke);
  background: #f8fafc;
  font-size: 13px;
  color: var(--tut-ink);
  box-sizing: border-box;
}
.tut-mock-form__select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--tut-stroke);
  background: #f8fafc;
  font-size: 13px;
  color: var(--tut-ink);
  box-sizing: border-box;
}
.tut-mock-form__btn {
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--tut-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  white-space: nowrap;
}

/* mock: dashboard table */
.tut-mock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tut-mock-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  color: var(--tut-ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--tut-stroke);
}
.tut-mock-table td {
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--tut-ink);
}
.tut-mock-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
}
.tut-mock-rank--top10 {
  background: rgba(16,185,129,.15);
  color: #059669;
}
.tut-mock-rank--top30 {
  background: rgba(245,158,11,.15);
  color: #d97706;
}
.tut-mock-rank--out {
  background: #f1f5f9;
  color: #94a3b8;
}

/* mock: rank history chart placeholder */
.tut-mock-chart {
  height: 120px;
  background: linear-gradient(180deg, rgba(20,184,166,.08) 0%, transparent 100%);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin-top: 12px;
}
.tut-mock-chart__line {
  position: absolute;
  bottom: 20%;
  left: 5%;
  width: 90%;
  height: 2px;
  background: var(--tut-brand);
  border-radius: 2px;
}
.tut-mock-chart__line::before {
  content: "";
  position: absolute;
  right: 0;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tut-brand);
  box-shadow: 0 0 8px rgba(20,184,166,.5);
}
.tut-mock-chart svg {
  width: 100%;
  height: 100%;
}

/* mock: analysis report */
.tut-mock-report__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tut-mock-report__badge {
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(16,185,129,.15);
  color: #059669;
  font-size: 12px;
  font-weight: 700;
}
.tut-mock-report__kw {
  font-size: 16px;
  font-weight: 700;
  color: var(--tut-ink);
}
.tut-mock-report__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tut-mock-report__card {
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.tut-mock-report__card-label {
  font-size: 11px;
  color: var(--tut-ink-soft);
  margin-bottom: 4px;
}
.tut-mock-report__card-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--tut-ink);
}
.tut-mock-report__card-value--good { color: #059669; }
.tut-mock-report__card-value--warn { color: #d97706; }

/* ---------- CTA section ---------- */
.tut-cta {
  text-align: center;
  padding: 60px 24px 80px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
}
.tut-cta__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--tut-brand);
  background: #fff;
  object-fit: cover;
  margin: 0 auto 20px;
  display: block;
  box-shadow: 0 0 24px rgba(20,184,166,.3);
}
.tut-cta__title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  margin: 0 0 12px;
}
.tut-cta__title span { color: var(--tut-brand); }
.tut-cta__sub {
  font-size: 16px;
  color: rgba(255,255,255,.55);
  margin: 0 0 28px;
}
.tut-cta__btn {
  display: inline-block;
  padding: 16px 48px;
  border-radius: 60px;
  background: var(--tut-brand);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 20px rgba(20,184,166,.3);
}
.tut-cta__btn:hover {
  background: var(--tut-brand-dark);
  transform: translateY(-2px);
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .tut-step {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .tut-step__aside {
    display: flex;
    align-items: center;
    gap: 12px;
    position: static;
  }
  .tut-step__num { margin-bottom: 0; }
  .tut-step__avatar { width: 60px; height: 60px; }

  .tut-toc { margin: -24px 16px 0; padding: 20px; }

  /* mock body: tighter padding on mobile */
  .tut-mock__body { padding: 14px; }

  /* keyword form: stack rows vertically, prevent overflow */
  .tut-mock-form__row {
    flex-direction: column;
    gap: 10px;
  }
  .tut-mock-form__field {
    min-width: 0;
    width: 100%;
  }
  .tut-mock-form__input,
  .tut-mock-form__select {
    min-width: 0;
    font-size: 14px;
  }

  /* dashboard mock: stack header */
  .tut-mock-dash-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  /* table: horizontal scroll wrapper */
  .tut-mock-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }
  .tut-mock-table {
    min-width: 380px;
  }

  .tut-mock-report__grid { grid-template-columns: 1fr; }
  .tut-mock-report__header { flex-wrap: wrap; }
}
