/* VibeForge LP — layout helpers on top of Polaris */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--p-color-bg, #f1f1f1);
}

a {
  color: inherit;
}

.lp-wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* ---------- Nav ---------- */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--p-color-border, #e3e3e3);
}

.lp-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.lp-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
}

.lp-nav__mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #005bd3;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
}

.lp-nav__links {
  display: none;
  align-items: center;
  gap: 24px;
}

.lp-nav__links a {
  font-size: 14px;
  text-decoration: none;
  color: #303030;
}

.lp-nav__links a:hover {
  color: #005bd3;
}

.lp-nav__cta {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lp-nav__cta.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .lp-nav__links {
    display: flex;
  }
}

/* ---------- Section spacing ---------- */
.lp-section {
  padding-block: clamp(48px, 8vw, 96px);
}

.lp-section--tinted {
  background: #fafafa;
}

.lp-section--dark {
  background: #1a1a1a;
  color: #f1f1f1;
}

.lp-section--dark s-heading,
.lp-section--dark s-paragraph {
  color: inherit;
}

/* ---------- Hero ---------- */
.lp-hero__grid {
  align-items: center;
}

.lp-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.25;
}

.lp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 8px;
}

.lp-hero__note {
  font-size: 13px;
  color: #616161;
  margin-top: 4px;
}

/* ---------- Terminal card ---------- */
.lp-terminal {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e3e3e3;
}

.lp-terminal__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #303030;
  color: #b5b5b5;
  font-size: 12px;
}

.lp-terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #616161;
}

.lp-terminal__dot:nth-child(1) { background: #ff5f57; }
.lp-terminal__dot:nth-child(2) { background: #febc2e; }
.lp-terminal__dot:nth-child(3) { background: #28c840; }

.lp-terminal__body {
  padding: 16px 18px;
  background: #1a1a1a;
  color: #e3e3e3;
  min-height: 200px;
}

.lp-terminal__prompt { color: #28c840; }
.lp-terminal__cmd { color: #f1f1f1; }
.lp-terminal__output { color: #b5b5b5; }

.lp-terminal__line--typed {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #28c840;
  animation: lp-blink 1s step-end infinite;
  max-width: 0;
  animation: lp-type 2s steps(40) forwards, lp-blink 0.8s step-end 2s infinite;
}

@keyframes lp-type {
  to { max-width: 100%; }
}

@keyframes lp-blink {
  50% { border-color: transparent; }
}

/* ---------- Cards grid ---------- */
.lp-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.lp-cards-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.lp-card-label {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #005bd3;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Pillar layout ---------- */
.lp-pillar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  margin-top: 48px;
}

.lp-pillar--flip .lp-pillar__text {
  order: 2;
}

.lp-pillar__visual {
  min-height: 220px;
}

.lp-code-block {
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #e3e3e3;
}

/* ---------- Steps ---------- */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 32px;
}

.lp-step {
  padding-right: 24px;
  border-top: 2px solid #005bd3;
  padding-top: 16px;
}

.lp-step__label {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #005bd3;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ---------- Compare table ---------- */
.lp-compare {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  font-size: 14px;
}

.lp-compare th,
.lp-compare td {
  padding: 14px 18px;
  border: 1px solid #e3e3e3;
  text-align: left;
  vertical-align: top;
}

.lp-compare thead th {
  background: #fafafa;
  font-weight: 650;
}

.lp-compare .lp-compare__label {
  background: #fafafa;
  font-weight: 600;
  width: 28%;
}

.lp-compare .lp-compare__after {
  background: #f0f5ff;
}

/* ---------- FAQ ---------- */
.lp-faq {
  margin-top: 24px;
}

.lp-faq details {
  border-bottom: 1px solid #e3e3e3;
  padding-block: 16px;
}

.lp-faq summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lp-faq summary::-webkit-details-marker {
  display: none;
}

.lp-faq summary::after {
  content: "+";
  font-size: 20px;
  color: #616161;
  flex-shrink: 0;
}

.lp-faq details[open] summary::after {
  content: "−";
}

.lp-faq__answer {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.75;
  color: #616161;
  max-width: 640px;
}

/* ---------- Contact form ---------- */
.lp-form-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.lp-field.is-invalid s-text-field,
.lp-field.is-invalid s-text-area {
  --invalid: 1;
}

.lp-field.is-invalid::after {
  content: "入力してください";
  display: block;
  font-size: 13px;
  color: #8e1f0b;
  margin-top: 4px;
}

.lp-form-sent {
  display: none;
  text-align: center;
  padding: 32px 0;
}

.lp-form.is-done .lp-form-grid,
.lp-form.is-done .lp-form-submit {
  display: none;
}

.lp-form.is-done .lp-form-sent {
  display: block;
}

/* ---------- Footer ---------- */
.lp-footer {
  padding-block: 40px 32px;
  border-top: 1px solid #e3e3e3;
  background: #fafafa;
}

.lp-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: #616161;
}

.lp-footer__links {
  display: flex;
  gap: 20px;
}

.lp-footer__links a {
  color: #616161;
  text-decoration: none;
}

.lp-footer__links a:hover {
  color: #005bd3;
  text-decoration: underline;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .lp-hero__grid,
  .lp-contact-grid {
    display: flex !important;
    flex-direction: column;
  }

  .lp-cards-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .lp-pillar {
    grid-template-columns: 1fr;
  }

  .lp-pillar--flip .lp-pillar__text {
    order: 0;
  }

  .lp-pillar__visual {
    order: -1;
  }

  .lp-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
  }

  .lp-step {
    padding-right: 0;
  }
}

@media (max-width: 639px) {
  .lp-cards-3,
  .lp-cards-2 {
    grid-template-columns: 1fr;
  }

  .lp-steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .lp-compare,
  .lp-compare tbody,
  .lp-compare tr,
  .lp-compare td,
  .lp-compare th {
    display: block;
    width: auto;
  }

  .lp-compare thead {
    display: none;
  }

  .lp-compare tr {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
  }

  .lp-compare td,
  .lp-compare th {
    border-bottom: 1px solid #e3e3e3;
  }

  .lp-compare tr :last-child {
    border-bottom: 0;
  }

  .lp-compare .lp-compare__label {
    width: auto;
    background: #fafafa;
  }

  .lp-compare td.lp-compare__before::before {
    content: "支援なし";
    display: block;
    font-size: 11px;
    color: #616161;
    margin-bottom: 4px;
  }

  .lp-compare td.lp-compare__after::before {
    content: "VibeForge あり";
    display: block;
    font-size: 11px;
    color: #005bd3;
    font-weight: 700;
    margin-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lp-terminal__line--typed {
    animation: none;
    max-width: 100%;
    border-right: none;
  }

  .lp-nav__cta {
    transition: none;
  }
}
