/* ============================================================
   NURUGO Homepage v2 — Enhancement layer
   (motion, new sections, GNB scroll, FAQ, marquee, tilt, etc.)
   ============================================================ */

/* ---------- GNB scroll state ----------
   At top of page: GNB is transparent and overlays the dark hero (hero pulled up 72px).
   On scroll: GNB gets a solid dark background so text stays readable over white sections. */
.gnb {
  position: fixed; top: 0; left: 0; right: 0;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out), backdrop-filter 220ms var(--ease-out);
}
.gnb.is-top {
  background: rgba(14,14,14,0);
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Hero starts UNDER the fixed GNB so the transparent top-state has the dark hero behind it */
.hero { margin-top: -72px; padding-top: 192px; }
@media (max-width: 1023px) { .hero { padding-top: 152px; } }

/* ---------- Hero — animated bg ---------- */
.hero { position: relative; }
.hero-bg-aura {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.hero-bg-aura::before,
.hero-bg-aura::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px);
  will-change: transform;
}
.hero-bg-aura::before {
  width: 620px; height: 620px; right: -120px; top: -120px;
  background: radial-gradient(circle, rgba(200,0,43,.32), transparent 65%);
  animation: aura-drift-a 18s ease-in-out infinite alternate;
}
.hero-bg-aura::after {
  width: 480px; height: 480px; left: -160px; bottom: -160px;
  background: radial-gradient(circle, rgba(200,0,43,.18), transparent 65%);
  animation: aura-drift-b 22s ease-in-out infinite alternate;
}
@keyframes aura-drift-a {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.08); }
}
@keyframes aura-drift-b {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.12); }
}

/* particles */
.hero-particles {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.hero-particles span {
  position: absolute; display: block;
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(200,0,43,.55);
  box-shadow: 0 0 8px rgba(200,0,43,.6);
  opacity: .0;
  animation: particle-rise linear infinite;
}
@keyframes particle-rise {
  0%   { transform: translateY(20px) scale(.6); opacity: 0; }
  20%  { opacity: .8; }
  80%  { opacity: .8; }
  100% { transform: translateY(-220px) scale(1); opacity: 0; }
}

/* parallax target */
.hero-visual { will-change: transform; transition: transform 250ms var(--ease-out); }
.hero h1, .hero p.lead, .hero-tag, .hero-ctas, .hero-meta { position: relative; z-index: 1; }

/* hero text initial state — JS adds .is-in to reveal */
.reveal-line { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-line.is-in { opacity: 1; transform: none; }

/* ---------- Pulse ring on primary hero CTA ---------- */
.btn-pulse { position: relative; isolation: isolate; }
.btn-pulse::before,
.btn-pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: -1;
  box-shadow: 0 0 0 0 rgba(200,0,43,.55);
  animation: btn-pulse 2.4s cubic-bezier(.2,.7,.3,1) infinite;
}
.btn-pulse::after { animation-delay: 1.2s; }
@keyframes btn-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(200,0,43,.55); }
  70%  { box-shadow: 0 0 0 18px rgba(200,0,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,0,43,0); }
}

/* ---------- Generic scroll reveal (IO) ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 3D tilt cards ---------- */
.feature {
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
}
.feature .feature-icon,
.feature h3,
.feature p,
.feature .num-tag {
  transform: translateZ(0);
  transition: transform .3s var(--ease-out);
}
.feature.is-tilting .feature-icon { transform: translateZ(40px); }
.feature.is-tilting h3 { transform: translateZ(24px); }
.feature.is-tilting p, .feature.is-tilting .num-tag { transform: translateZ(12px); }

/* ---------- Section: Service Flow ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
  margin-top: 8px;
}
.flow-step {
  position: relative;
  padding: 36px 32px 32px;
  text-align: left;
}
.flow-step + .flow-step::before {
  content: '';
  position: absolute; left: 0; top: 60px; bottom: 60px;
  width: 1px; background: var(--border-default);
}
.flow-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--nurugo-red); color: #fff;
  font-family: var(--font-num); font-weight: 800; font-size: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(200,0,43,.35);
}
.flow-step h3 { font-size: 20px; font-weight: 700; color: var(--fg-1); margin: 0 0 8px; }
.flow-step p { font-size: 15px; color: var(--fg-3); margin: 0 0 18px; line-height: 1.6; }
.flow-mock {
  border: 1px solid var(--border-default); border-radius: 14px;
  background: var(--bg-base); padding: 16px;
  box-shadow: var(--shadow-e1);
  font-size: 13px;
}
.flow-mock-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px dashed var(--border-default);
  gap: 12px;
}
.flow-mock-row .lbl { color: var(--fg-3); white-space: nowrap; flex-shrink: 0; }
.flow-mock-row .val { color: var(--fg-1); font-weight: 600; font-family: var(--font-num); min-width: 0; text-align: right; word-break: keep-all; }
.flow-mock-row:last-child { border-bottom: 0; }
.flow-mock .pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; background: var(--nurugo-red-soft); color: var(--nurugo-red);
  white-space: nowrap; flex-shrink: 0;
}
.flow-mock .pill.ok { background: rgba(30,158,90,.10); color: #1E9E5A; }
@media (max-width: 1023px) {
  .flow { grid-template-columns: 1fr; }
  .flow-step + .flow-step::before { left: 36px; top: 0; bottom: auto; right: 0; width: auto; height: 1px; }
}

/* ---------- Section: Partner Hotels (marquee) ---------- */
.marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: 24px; width: max-content;
  animation: marquee-slide 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.hotel-card {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px; min-width: 240px;
  background: var(--bg-base); border: 1px solid var(--border-default);
  border-radius: 14px; box-shadow: var(--shadow-e1);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.hotel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-e2); border-color: rgba(200,0,43,.3); }
.hotel-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--nurugo-red), #7a0019);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-en); font-weight: 800; font-size: 16px;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.hotel-card .name { font-size: 15px; font-weight: 700; color: var(--fg-1); white-space: nowrap; }
.hotel-card .meta { font-size: 12px; color: var(--fg-3); margin-top: 2px; white-space: nowrap; }

/* ---------- Section: Partner Restaurants ---------- */
.rests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1023px) { .rests { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .rests { grid-template-columns: 1fr; } }
.rest {
  background: var(--bg-base); border: 1px solid var(--border-default);
  border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out);
}
.rest:hover { transform: translateY(-4px); box-shadow: var(--shadow-e2); border-color: rgba(200,0,43,.35); }
.rest-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rest .cat {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px;
  background: var(--nurugo-red-soft); color: var(--nurugo-red);
}
.rest .area { font-size: 12px; color: var(--fg-3); font-family: var(--font-en); }
.rest h4 { margin: 0; font-size: 18px; font-weight: 700; color: var(--fg-1); line-height: 1.3; }
.rest .desc { margin: 0; font-size: 13px; color: var(--fg-3); line-height: 1.55; }
.rest .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rest .tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--gray-05); color: var(--gray-70);
}

/* ---------- Section: Testimonials ---------- */
.testis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 1023px) { .testis { grid-template-columns: 1fr; } }
.testi {
  background: var(--bg-base); border: 1px solid var(--border-default);
  border-radius: 18px; padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative; box-shadow: var(--shadow-e1);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.testi:hover { transform: translateY(-4px); box-shadow: var(--shadow-e3); }
.testi .quote-mark {
  font-family: var(--font-en); font-size: 60px; font-weight: 800;
  color: var(--nurugo-red); line-height: .6; opacity: .85;
}
.testi blockquote {
  margin: 0; font-size: 16px; line-height: 1.65; color: var(--fg-2);
  text-wrap: pretty;
}
.testi .who {
  display: flex; align-items: center; gap: 12px;
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--border-default);
}
.testi .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--nurugo-red), #7a0019);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.testi .who .name { font-size: 14px; font-weight: 700; color: var(--fg-1); }
.testi .who .role { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ---------- Section: FAQ ---------- */
.faq-wrap { max-width: 820px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border-default);
}
.faq-item:first-child { border-top: 1px solid var(--border-default); }
.faq-q {
  width: 100%; text-align: left; background: transparent; border: 0;
  padding: 24px 56px 24px 4px; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 600; color: var(--fg-1);
  position: relative;
  display: flex; align-items: center; gap: 14px;
  transition: color .2s var(--ease-out);
}
.faq-q:hover { color: var(--nurugo-red); }
.faq-q .num {
  font-family: var(--font-en); font-size: 13px; font-weight: 700;
  color: var(--nurugo-red); flex-shrink: 0; width: 28px;
}
.faq-q .ico {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-subtle); display: grid; place-items: center;
  transition: transform .3s var(--ease-out), background .2s var(--ease-out);
}
.faq-q .ico svg { width: 14px; height: 14px; color: var(--fg-2); transition: color .2s; }
.faq-item.open .faq-q .ico { transform: translateY(-50%) rotate(45deg); background: var(--nurugo-red); }
.faq-item.open .faq-q .ico svg { color: #fff; }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s var(--ease-out);
}
.faq-a-inner {
  padding: 0 32px 24px;
  font-size: 15px; color: var(--fg-3); line-height: 1.7; text-wrap: pretty;
}
.faq-item.open .faq-a { max-height: 320px; }

/* ---------- Counter values ---------- */
.count[data-target] { display: inline-block; }

/* ---------- Form: floating label ---------- */
.field { position: relative; display: flex; flex-direction: column; }
.field input,
.field select,
.field textarea {
  font-family: inherit; font-size: 15px; color: var(--fg-1);
  padding: 22px 14px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 130px; padding-top: 26px; }
.field label {
  position: absolute; left: 14px; top: 16px;
  font-size: 14px; font-weight: 500; color: var(--fg-3);
  pointer-events: none;
  transition: top .2s var(--ease-out), font-size .2s var(--ease-out), color .2s var(--ease-out);
  background: transparent;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field select:focus + label,
.field.has-value label {
  top: 6px; font-size: 11px; font-weight: 700; color: var(--nurugo-red);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: var(--nurugo-red);
  box-shadow: 0 0 0 3px rgba(200,0,43,.15);
}
.field .req { color: var(--nurugo-red); margin-left: 2px; }

/* =========================================================
   MOBILE RESPONSIVE — comprehensive polish
   ========================================================= */

/* Better tap behavior on iOS */
html { -webkit-tap-highlight-color: rgba(200,0,43,.15); scroll-behavior: smooth; }

/* --- Tablet & below (≤1023px) --- */
@media (max-width: 1023px) {
  /* GNB burger has bigger touch target */
  .gnb-burger { padding: 10px; min-width: 44px; min-height: 44px; }

  /* Service flow vertical divider becomes a horizontal divider with proper room */
  .flow-step + .flow-step::before { left: 24px !important; right: 24px !important; top: 0 !important; bottom: auto !important; height: 1px; width: auto; }
  .flow-step { padding: 28px 24px; }
  .flow-mock { padding: 14px; }

  /* Section head — slightly tighter eyebrow spacing */
  .section-head h2 { margin-bottom: 14px; }
}

/* --- Phone (≤767px) --- */
@media (max-width: 767px) {
  /* GNB height reduces; sync hero offset */
  .gnb-inner { height: 64px; }
  .hero { margin-top: -64px; padding-top: 132px; padding-bottom: 80px; }
  .gnb-brand img { height: 24px; max-width: 130px; }

  /* Hero typography */
  .hero h1 { margin: 16px 0 14px; word-break: keep-all; }
  .hero p.lead { font-size: 15px; margin-bottom: 28px; word-break: keep-all; }
  .hero-tag { font-size: 11px; padding: 6px 12px; }

  /* Hero CTAs full-width and stacked */
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-ctas .btn { width: 100%; justify-content: center; padding: 16px 20px; font-size: 16px; }

  /* Hero metrics — 3 columns of compact stat tiles */
  .hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; padding-top: 24px; }
  .hero-meta-item { white-space: normal; }
  .hero-meta-item .num { font-size: 20px; }
  .hero-meta-item .lbl { font-size: 11px; margin-top: 4px; line-height: 1.4; }

  /* Section spacing tighter */
  .section { padding: 64px 0; }

  /* Features — preserve some breathing room */
  .feature { padding: 28px 24px; }

  /* Service Flow — single column rhythm */
  .flow-num { width: 38px; height: 38px; font-size: 16px; margin-bottom: 12px; }
  .flow-step h3 { font-size: 18px; }
  .flow-step p { font-size: 14px; margin-bottom: 14px; }

  /* Marquee — smaller cards so 2 fit per viewport */
  .hotel-card { min-width: 180px; padding: 14px 18px; gap: 10px; }
  .hotel-mark { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }
  .hotel-card .name { font-size: 13px; }
  .hotel-card .meta { font-size: 11px; }
  .marquee-track { gap: 14px; }

  /* Restaurants — 2 columns then 1 below 540px (already set) */
  .rest { padding: 18px; }
  .rest h4 { font-size: 16px; }

  /* Testimonials */
  .testi { padding: 24px; gap: 14px; }
  .testi blockquote { font-size: 15px; }
  .testi .quote-mark { font-size: 48px; }

  /* FAQ — smaller padding, allow text to wrap above the + icon */
  .faq-q { font-size: 16px; padding: 20px 44px 20px 2px; gap: 10px; align-items: flex-start; }
  .faq-q .num { width: 24px; font-size: 12px; padding-top: 2px; }
  .faq-q .ico { right: 0; width: 26px; height: 26px; top: 18px; transform: none; }
  .faq-item.open .faq-q .ico { transform: rotate(45deg); }
  .faq-a-inner { padding: 0 24px 20px; font-size: 14px; }

  /* Form actions stack with full-width button */
  .form-actions { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .form-actions .btn { width: 100%; justify-content: center; padding: 16px 20px; }
  .form-actions .agree { text-align: center; font-size: 12px; }

  /* Form field label adjustments */
  .field input, .field select, .field textarea { font-size: 16px; /* prevent iOS zoom */ }

  /* Footer — single column on phone */
  .footer-top { grid-template-columns: 1fr !important; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-brand img { height: 22px; }
}

/* --- Small phone (≤480px) --- */
@media (max-width: 480px) {
  .container { width: calc(100% - 32px); }

  /* Hero metrics — stack to 1 column with horizontal alignment for legibility */
  .hero-meta { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .hero-meta-item .num { font-size: 18px; }

  /* Section head margin */
  .section-head { margin-bottom: 32px; }
  .section { padding: 56px 0; }

  /* Pulse ring smaller so it doesn't overflow */
  @keyframes btn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200,0,43,.55); }
    70%  { box-shadow: 0 0 0 12px rgba(200,0,43,0); }
    100% { box-shadow: 0 0 0 0 rgba(200,0,43,0); }
  }

  /* About */
  .about-grid { gap: 32px; }
  .about-visual { padding: 28px; aspect-ratio: 5 / 4; }
}

/* --- Tilt animation: disable on touch devices (avoid stuck hover state) --- */
@media (hover: none), (pointer: coarse) {
  .feature { transform: none !important; }
  .feature .feature-icon,
  .feature h3,
  .feature p,
  .feature .num-tag { transform: none !important; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
}
