/* ============================================================
   style.css — Enshin Homepage
   Design tokens → Reset → Layout → Components → Animations
   ============================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  --bg:         #FFF8EF;
  --teal:       #0D7C6B;
  --teal-light: #E0F5F0;
  --orange:     #FF6B35;
  --robot-blue: #4A6FA5;
  --robot-dark: #2D4A7A;
  --text:       #2D2A26;
  --muted:      #6b6560;
  --dark:       #1a1816;
  --white:      #ffffff;
  --radius:     16px;
  --shadow:     0 4px 24px rgba(13,124,107,0.10);
  --font:       'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: normal; color: var(--orange); }

/* ===== LAYOUT ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 100px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.14); }
.btn-primary { background: var(--teal);  color: var(--white); }
.btn-white   { background: var(--white); color: var(--teal);  }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.7); }
.btn-sm  { padding: 8px 20px;  font-size: 0.88rem; }
.btn-lg  { padding: 16px 36px; font-size: 1.08rem; }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,248,239,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  border-color: rgba(13,124,107,0.12);
  box-shadow: 0 2px 16px rgba(13,124,107,0.08);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 20px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--teal);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 16px;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--teal); }
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== SECTION COMMON ===== */
section { padding: 100px 0; }
.section-tag {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal);
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
h2 {
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
}

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding: 60px 0;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.85;
}
.hero-ctas {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-email {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.hero-email a { color: var(--teal); font-weight: 700; }
.hero-email a:hover { text-decoration: underline; }
.hero-note {
  font-size: 0.80rem;
  color: var(--muted);
  opacity: 0.75;
}
.hero-robot {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-robot-float {
  animation: float 3.6s ease-in-out infinite;
  width: 100%;
  max-width: 380px;
}
.hero-robot-float svg { width: 100%; height: auto; }

/* ===== SERVICES ===== */
.services { background: var(--teal-light); }
.services-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 32px;
  align-items: center;
}
.services-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 36px rgba(13,124,107,0.16);
}
.service-icon {
  width: 50px;
  height: 50px;
  background: var(--teal-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--teal);
}
.service-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; color: var(--teal); }
.service-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.75; }
.services-bot { flex-shrink: 0; }
.services-bot svg { width: 100%; height: auto; }

/* ===== VALUES ===== */
.values-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.value-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.28s ease;
}
.value-card:hover { transform: translateY(-6px); }
.value-robot {
  width: 130px;
  margin: 0 auto 20px;
}
.value-robot svg { width: 100%; height: auto; }
.value-card h3 { margin-bottom: 10px; }
.value-jp {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
}
.value-en {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 2px;
}
.value-card p { font-size: 0.87rem; color: var(--muted); line-height: 1.75; margin-top: 8px; }

/* ===== CTA ===== */
.cta-section {
  background: var(--teal);
  padding: 100px 0;
  overflow: hidden;
}
.cta-inner {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 60px;
  align-items: center;
}
.free-badge {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  padding: 5px 18px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.cta-section h2 { color: var(--white); margin-bottom: 14px; }
.cta-section > .cta-inner > .cta-copy > p {
  color: rgba(255,255,255,0.82);
  margin-bottom: 32px;
}
.cta-contacts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cta-note {
  font-size: 0.80rem;
  color: rgba(255,255,255,0.55);
}
.cta-bot { flex-shrink: 0; }
.cta-bot svg { width: 100%; height: auto; }
.cta-bot-jump { animation: jump-bounce 0.88s ease-in-out infinite; }

/* ===== WALK STRIP ===== */
.walk-strip {
  background: #1E1C1A;
  height: 130px;
  overflow: hidden;
  position: relative;
}
.walk-strip::before {
  content: '';
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg, #333 0, #333 18px, transparent 18px, transparent 36px
  );
}
.kapi-walker {
  position: absolute;
  bottom: 26px;
  width: 76px;
  animation: walk-across 13s linear infinite;
}
.kapi-walker svg { width: 76px; height: auto; }

/* ===== FOOTER ===== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.65);
  padding: 52px 0 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-company { font-weight: 800; color: var(--white); font-size: 1.05rem; }
.footer-tagline { font-size: 0.80rem; opacity: 0.6; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-links a { font-size: 0.9rem; color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.footer-contact a {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
}
.footer-contact a:hover { color: var(--white); }
/* ── Heartbeats-style address bar ── */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 16px 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-address {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fa-company {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.02em;
}
.fa-line {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.5;
}
.fa-link {
  transition: color 0.2s;
  text-decoration: none;
}
.fa-link:hover { color: rgba(255,255,255,0.85); }
.footer-copy {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.28);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.reveal-right { transform: translateX(30px); }
.reveal.visible { opacity: 1; transform: none; }

/* Stagger children inside a revealed container */
.services-cards .service-card.reveal:nth-child(2) { transition-delay: 0.10s; }
.services-cards .service-card.reveal:nth-child(3) { transition-delay: 0.20s; }
.values-cards .value-card.reveal:nth-child(2) { transition-delay: 0.12s; }
.values-cards .value-card.reveal:nth-child(3) { transition-delay: 0.24s; }

/* ===== KEYFRAME ANIMATIONS ===== */

/* Hero robot float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}

/* CTA robot jump */
@keyframes jump-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-22px); }
}

/* Walk strip */
@keyframes walk-across {
  from { left: -90px; }
  to   { left: calc(100% + 90px); }
}

/* Arm: wave (right arm oscillates up-down while raised) */
@keyframes arm-wave {
  0%, 100% { transform: rotate(162deg); }
  50%       { transform: rotate(148deg); }
}

/* Arm: point bob */
@keyframes arm-point-bob {
  0%, 100% { transform: rotate(22deg); }
  50%       { transform: rotate(15deg); }
}

/* Arms: jump (both arms raised, slight bounce) */
@keyframes arm-jump-r {
  0%, 100% { transform: rotate(148deg); }
  50%       { transform: rotate(156deg); }
}
@keyframes arm-jump-l {
  0%, 100% { transform: rotate(-148deg); }
  50%       { transform: rotate(-156deg); }
}

/* Arms: walk swing */
@keyframes arm-walk-r {
  0%, 100% { transform: rotate(-20deg); }
  50%       { transform: rotate(20deg);  }
}
@keyframes arm-walk-l {
  0%, 100% { transform: rotate(20deg);  }
  50%       { transform: rotate(-20deg); }
}

/* Legs: walk */
@keyframes leg-walk-l {
  0%, 100% { transform: rotate(-24deg); }
  50%       { transform: rotate(20deg);  }
}
@keyframes leg-walk-r {
  0%, 100% { transform: rotate(20deg);  }
  50%       { transform: rotate(-24deg); }
}

/* Eyes: blink */
@keyframes blink {
  0%, 86%, 100% { transform: scaleY(1);    }
  90%           { transform: scaleY(0.06); }
}

/* Antenna: pulse */
@keyframes antenna-pulse {
  0%, 100% { transform: scale(1);   opacity: 1;    }
  50%       { transform: scale(1.5); opacity: 0.60; }
}

/* Screen: scroll */
@keyframes screen-scroll {
  0%   { transform: translateY(0);     }
  100% { transform: translateY(-36px); }
}

/* Heart: pulse */
@keyframes heart-pulse {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.18); }
}

/* Lightbulb: glow */
@keyframes bulb-glow {
  0%, 100% { opacity: 0.75; transform: scale(1);    }
  50%       { opacity: 1;    transform: scale(1.12); }
}

/* ===== SVG ANIMATION STYLES ===== */

/* Arm pivot: top-center of arm group bounding box = shoulder */
.arm-r, .arm-l {
  transform-box: fill-box;
  transform-origin: 50% 0%;
}

/* Leg pivot: top-center = hip */
.leg-l, .leg-r {
  transform-box: fill-box;
  transform-origin: 50% 0%;
}

/* --- Wave pose --- */
.arm-r-wave { animation: arm-wave 1.25s ease-in-out infinite; }
.arm-l-wave { transform: rotate(8deg); }

/* --- Point pose --- */
.arm-r-point { animation: arm-point-bob 1.6s ease-in-out infinite; }
.arm-l-point { transform: rotate(10deg); }

/* --- Heart pose --- */
.arm-r-heart { transform: rotate(32deg); }
.arm-l-heart { transform: rotate(-32deg); }

/* --- Bulb pose --- */
.arm-r-bulb { transform: rotate(163deg); }
.arm-l-bulb { transform: rotate(-8deg); }

/* --- Run pose --- */
.arm-r-run { transform: rotate(-26deg); }
.arm-l-run { transform: rotate(22deg); }
.leg-l-run  { transform: rotate(20deg); }
.leg-r-run  { transform: rotate(-24deg); }

/* --- Jump pose --- */
.arm-r-jump { animation: arm-jump-r 0.88s ease-in-out infinite; }
.arm-l-jump { animation: arm-jump-l 0.88s ease-in-out infinite; }
.leg-l-jump { transform: rotate(-14deg); }
.leg-r-jump { transform: rotate(14deg); }

/* --- Walk pose --- */
.arm-r-walk { animation: arm-walk-r 0.55s ease-in-out infinite; }
.arm-l-walk { animation: arm-walk-l 0.55s ease-in-out infinite; }
.leg-l-walk { animation: leg-walk-l 0.55s ease-in-out infinite; }
.leg-r-walk { animation: leg-walk-r 0.55s ease-in-out infinite; }

/* Eyes blink */
.eye-pupils {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: blink 4.8s ease-in-out infinite;
}

/* Antenna ball */
.antenna-ball {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: antenna-pulse 1.9s ease-in-out infinite;
}

/* Screen scroll */
.screen-lines { animation: screen-scroll 2.8s linear infinite; }

/* Heart on chest */
.chest-heart {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: heart-pulse 1.2s ease-in-out infinite;
}

/* Lightbulb glow */
.bulb-glass {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: bulb-glow 1.6s ease-in-out infinite;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-ctas { justify-content: center; }
  .hero-robot { order: -1; }
  .hero-robot-float { max-width: 240px; margin: 0 auto; }
  .services-layout { grid-template-columns: 1fr; }
  .services-cards { grid-template-columns: repeat(3, 1fr); }
  .services-bot { display: none; }
  .cta-inner { grid-template-columns: 1fr; text-align: center; }
  .cta-contacts { justify-content: center; }
  .cta-bot { display: none; }
}
@media (max-width: 680px) {
  section { padding: 72px 0; }
  .container { padding: 0 18px; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding: 12px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 12px 28px; font-size: 1rem; }
  .nav-hamburger { display: flex; }
  .nav-inner .btn-sm { display: none; }
  .services-cards { grid-template-columns: 1fr; }
  .values-cards { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { justify-content: center; }
}
