/* ============================================
   frevia — design tokens & base
   ============================================ */
:root {
  /* base & backgrounds */
  --bg: #FFFFFF;              /* main bg — pure white */
  --bg-soft: #EBF4FA;         /* section bg — pale blue */
  --tag-bg: #D8E9F6;          /* tag/chip bg */
  --card: #F9F9F9;            /* card bg */
  --paper: #FFFFFF;

  /* brand */
  --navy: #335C8E;            /* primary navy blue */
  --navy-deep: #1F3D63;       /* deeper navy */
  --navy-soft: #5F86B4;       /* lighter navy */
  --sky: #7BC7E2;             /* sky blue accent */
  --sky-soft: #D8E9F6;        /* very pale sky */
  --terra: #C84632;           /* terracotta orange (warning / right-side accent) */
  --terra-deep: #9E331F;      /* deeper terra for hover */

  /* text */
  --ink: #1A1A1A;             /* main heading */
  --ink-2: #333333;            /* body */
  --ink-3: #666666;            /* caption / sub */
  --line: rgba(26, 26, 26, 0.12);

  /* aliases (legacy refs in components) */
  --blue: var(--navy);
  --blue-deep: var(--navy-deep);
  --cyan: var(--sky);
  --lavender: var(--sky-soft);
  --pop-yellow: var(--terra);
  --pop-pink: var(--terra);

  /* type */
  --f-display: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  --f-en: "Noto Sans", "Noto Sans JP", system-ui, sans-serif;

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
  --easing-bounce: cubic-bezier(0.68, -0.4, 0.27, 1.5);
}

[data-theme="ocean"] {
  --bg: #1F3D63;
  --bg-soft: #335C8E;
  --paper: #335C8E;
  --card: #2A4F7C;
  --ink: #FFFFFF;
  --ink-2: #D8E9F6;
  --ink-3: #9CB6D2;
  --line: rgba(255,255,255,0.14);
}

[data-theme="warm"] {
  --bg: #FCF7F4;
  --bg-soft: #F5E8E1;
  --card: #FFFFFF;
  --terra: #9E331F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  line-height: 1.75;
  overflow-x: hidden;
}

body { cursor: none; }
@media (hover: none) { body { cursor: auto; } }

h1, h2, h3, h4, h5 { color: var(--ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--navy); color: #fff; }

/* ============================================
   Custom cursor
   ============================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--terra);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.3s var(--easing), height 0.3s var(--easing), border-radius 0.3s var(--easing), background 0.3s var(--easing), opacity 0.6s var(--easing);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor.is-hidden,
.cursor-dot.is-hidden { opacity: 0; }
.cursor.is-visible,
.cursor-dot.is-visible { opacity: 1; }
.cursor.cursor--hover {
  width: 72px; height: 72px;
  background: var(--sky);
}
.cursor.cursor--text {
  width: 110px; height: 110px;
  background: var(--terra);
  font-family: var(--f-en);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: grid;
  place-items: center;
  mix-blend-mode: normal;
  text-align: center;
}
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  will-change: transform;
}
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* ============================================
   Layout
   ============================================ */
.page { min-height: 100vh; padding-top: 84px; }

/* ============================================
   Top Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
  transition: color 0.3s var(--easing), background 0.3s var(--easing);
}
.nav[data-on-dark="true"] {
  color: #fff;
  background: rgba(31, 61, 99, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.nav[data-on-dark="true"] .nav__logo-img {
  filter: brightness(0) invert(1);
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav__logo-img {
  height: 28px;
  width: auto;
  display: block;
  transition: filter 0.3s var(--easing);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.nav__links {
  display: flex;
  gap: 36px;
  font-family: var(--f-en);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.nav__link {
  position: relative;
  padding: 4px 0;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s var(--easing);
}
.nav__link.is-active, .nav__link:hover { opacity: 1; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: currentColor;
}
.nav__cta {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--f-en);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s var(--easing), color 0.3s var(--easing);
}
.nav__cta:hover { background: #fff; color: #000; }

/* ============================================
   Hamburger button (mobile only)
   ============================================ */
.nav__burger {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 102;
}
.nav__burger-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s var(--easing), opacity 0.2s var(--easing), top 0.3s var(--easing);
}
.nav__burger-bar--1 { top: 11px; }
.nav__burger-bar--2 { top: 17px; }
.nav__burger-bar--3 { top: 23px; }
.nav__burger-bar--1.is-open { top: 17px; transform: rotate(45deg); }
.nav__burger-bar--2.is-open { opacity: 0; }
.nav__burger-bar--3.is-open { top: 17px; transform: rotate(-45deg); }

/* Mobile-only CTA item inside the menu */
.nav__link--cta-mobile { display: none; }

/* ============================================
   Typography utilities
   ============================================ */
.eyebrow {
  font-family: var(--f-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.display {
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-wrap: balance;
}

.h-section {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(44px, 7.4vw, 108px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--ink);
  text-wrap: balance;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 30px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.3s var(--easing), background 0.3s var(--easing);
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-2px); background: var(--navy); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-deep); }
.btn--terra { background: var(--terra); color: #fff; }
.btn--terra:hover { background: var(--terra-deep); }

.btn__arrow {
  display: inline-block;
  transition: transform 0.4s var(--easing);
}
.btn:hover .btn__arrow { transform: translateX(6px); }

/* ============================================
   Hero buttons — refined split pill
   ============================================ */
.btn-hero {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0 6px 0 28px;
  height: 60px;
  border-radius: 999px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.45s var(--easing), color 0.4s var(--easing), background 0.4s var(--easing);
  will-change: transform;
}
.btn-hero__label {
  position: relative;
  z-index: 2;
  padding-right: 18px;
  transition: transform 0.5s var(--easing);
}
.btn-hero__icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  transition: transform 0.5s var(--easing), background 0.4s var(--easing), color 0.4s var(--easing);
}
.btn-hero__icon svg {
  transition: transform 0.5s var(--easing);
}
.btn-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  z-index: 1;
  transition: transform 0.6s var(--easing);
  transform-origin: left center;
}

/* Primary — navy base, terracotta sweep + icon circle */
.btn-hero--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 61, 99, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.btn-hero--primary::before {
  background: var(--terra);
  transform: scaleX(0);
}
.btn-hero--primary .btn-hero__icon {
  background: #fff;
  color: var(--navy);
}
.btn-hero--primary:hover { transform: translateY(-2px); }
.btn-hero--primary:hover::before { transform: scaleX(1); }
.btn-hero--primary:hover .btn-hero__icon { background: var(--navy-deep); color: #fff; }
.btn-hero--primary:hover .btn-hero__icon svg { transform: translateX(2px); }

/* Ghost — outline base, ink sweep + icon circle */
.btn-hero--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn-hero--ghost::before {
  background: var(--ink);
  transform: scaleX(0);
}
.btn-hero--ghost .btn-hero__icon {
  background: var(--ink);
  color: #fff;
}
.btn-hero--ghost:hover { transform: translateY(-2px); color: #fff; }
.btn-hero--ghost:hover::before { transform: scaleX(1); }
.btn-hero--ghost:hover .btn-hero__icon { background: var(--terra); color: #fff; }
.btn-hero--ghost:hover .btn-hero__icon svg { transform: translateX(2px) rotate(-45deg); }

/* ============================================
   Kinetic text
   ============================================ */
.kinetic { display: inline-block; }
.kinetic__char {
  display: inline-block;
  transition: transform 0.4s var(--easing-bounce), color 1.2s var(--easing);
  will-change: transform, color;
}
.kinetic__char:hover {
  transform: translateY(-5px) rotate(-2deg);
}

/* ============================================
   Decorative motion
   ============================================ */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
  pointer-events: none;
}
.shape-float { animation: float 9s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.marquee { display: flex; overflow: hidden; white-space: nowrap; width: 100%; }
.marquee__track {
  display: flex;
  gap: 64px;
  animation: marquee 38s linear infinite;
  padding-right: 64px;
  align-items: center;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================
   Components
   ============================================ */

/* Tag/Chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--navy);
}
.tag--terra { background: rgba(200, 70, 50, 0.1); color: var(--terra); }
.tag--ink   { background: var(--ink); color: #fff; }

/* Sticker (for emphasis) */
.sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  font-family: var(--f-en);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
}
.sticker--terra { background: var(--terra); }
.sticker--sky { background: var(--sky); color: var(--ink); }
.sticker--white { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* Card */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  transition: transform 0.4s var(--easing), background 0.4s var(--easing);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--navy-deep);
  color: #fff;
  padding: 100px 32px 32px;
  margin-top: 120px;
  position: relative;
  overflow: hidden;
}
.footer__big {
  margin-bottom: 60px;
  display: flex;
  align-items: center;
}
.footer__big-img {
  height: clamp(96px, 18vw, 240px);
  width: auto;
  filter: brightness(0) invert(1);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
}
.footer__col h4 {
  font-family: var(--f-en);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 16px;
  color: #fff;
}
.footer__col p, .footer__col a { display: block; line-height: 1.85; opacity: 0.88; color: #fff; }
.footer__bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: space-between;
  font-family: var(--f-en);
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 0.04em;
}

/* ============================================
   Page transition
   ============================================ */
.page-wrap { animation: pageIn 0.6s var(--easing); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Sections
   ============================================ */
.container { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
section { padding: 120px 0; position: relative; }

/* Right-side accent rail (visual signature) */
.rail-right {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: var(--terra);
  z-index: 1;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Responsive — tablet & mobile
   Preserves the editorial design language by:
   - Keeping the same colors, type, rail-right accent
   - Letting clamp() type scale down naturally
   - Stacking columns at narrow widths
   - Tightening section paddings, never collapsing them to zero
   ============================================ */
@media (max-width: 1024px) {
  .container { padding: 0 28px; }
  section { padding: 80px 0; }
  .nav { padding: 0 20px; height: 72px; }
  .page { padding-top: 72px; }
  .nav__links { gap: 22px; font-size: 12px; }
  .nav__cta { padding: 9px 16px; font-size: 12px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  /* Service strength cards stack vertically (image below copy) */
  [data-strength-card] { grid-template-columns: 1fr !important; }
}

/* Keep inner strength banner grid intact on all sizes —
   the universal :not([data-strength-banners]) exclusion below
   protects the inline grid-template-columns. */

@media (max-width: 768px) {
  body { cursor: auto !important; }
  .cursor, .cursor-dot { display: none !important; }

  /* Hide the hero corner ticker (Tokyo · EST · etc) on mobile */
  [data-corner-ticker] { display: none !important; }

  /* Tighten vertical whitespace across the board on mobile */
  section { padding: 40px 0 !important; }
  .footer { margin-top: 32px !important; padding: 40px 16px 20px !important; }
  .footer__big { margin-bottom: 24px !important; }
  .footer__grid { gap: 20px !important; padding-top: 24px !important; }
  .footer__bottom { margin-top: 24px !important; padding-top: 16px !important; }

  /* Hero sections — drop the 100vh minimum so they shrink to content */
  section[style*="minHeight: \"100vh\""],
  section[style*="min-height: 100vh"] {
    min-height: 0 !important;
  }

  /* Hero top/bottom padding overrides (inline 140px / 120px) — collapse */
  section[style*="padding: \"140px 0 80px\""],
  section[style*="padding: \"120px 0 80px\""],
  section[style*="padding: \"120px 0 60px\""],
  section[style*="padding: \"60px 0 120px\""],
  section[style*="padding: \"180px 0\""],
  section[style*="padding: \"160px 0\""] {
    padding: 40px 0 !important;
  }

  /* Inline marginTop/marginBottom on section-level wrappers — common large gaps */
  section [style*="marginTop: 100"]   { margin-top: 32px !important; }
  section [style*="marginTop: 80"]    { margin-top: 28px !important; }
  section [style*="marginTop: 64"]    { margin-top: 24px !important; }
  section [style*="marginTop: 60"]    { margin-top: 24px !important; }
  section [style*="marginTop: 48"]    { margin-top: 20px !important; }
  section [style*="marginTop: 40"]    { margin-top: 18px !important; }
  section [style*="marginBottom: 80"] { margin-bottom: 28px !important; }
  section [style*="marginBottom: 64"] { margin-bottom: 24px !important; }
  section [style*="marginBottom: 60"] { margin-bottom: 24px !important; }
  section [style*="marginBottom: 48"] { margin-bottom: 20px !important; }
  section [style*="marginBottom: 40"] { margin-bottom: 18px !important; }

  /* Card minHeight collapses on mobile (cards size to content) */
  section [style*="minHeight: 360"],
  section [style*="minHeight: 380"],
  section [style*="minHeight: 480"] {
    min-height: 0 !important;
  }

  /* Grid gaps */
  section [style*="gap: 60"],
  section [style*="gap: 64"],
  section [style*="gap: 80"] { gap: 20px !important; }
  section [style*="gap: 48"] { gap: 16px !important; }
  section [style*="gap: 40"] { gap: 16px !important; }
  section [style*="gap: 32"] { gap: 14px !important; }
  section [style*="gap: 24"] { gap: 12px !important; }

  .container { padding: 0 20px; }
  section { padding: 56px 0 !important; }

  .nav { padding: 0 16px; height: 64px; background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); }
  .nav[data-on-dark="true"] { background: rgba(31, 61, 99, 0.88); }
  .page { padding-top: 64px; }
  .nav__logo-img { height: 22px; }

  /* Hamburger replaces the desktop nav links + CTA */
  .nav__burger { display: block; color: inherit; }
  .nav__cta { display: none !important; }

  /* Mobile menu drawer — full-width slide-down panel below the nav.
     NOTE: .nav has backdrop-filter, which makes .nav the containing block
     for fixed descendants. Use `height` (not `bottom: 0`) so the drawer
     spans the viewport correctly. */
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    min-height: calc(100vh - 64px);
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 32px 24px 48px;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--easing), opacity 0.3s var(--easing);
    z-index: 99;
    font-size: 18px;
  }
  .nav[data-on-dark="true"] .nav__links {
    background: rgba(31, 61, 99, 0.88);
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link {
    padding: 22px 4px;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
    font-size: 18px !important;
    letter-spacing: 0.08em;
    opacity: 1;
    text-transform: uppercase;
    font-family: var(--f-en);
    font-weight: 500;
  }
  .nav[data-on-dark="true"] .nav__link {
    border-bottom-color: rgba(255, 255, 255, 0.14);
  }
  .nav__link::after { display: none !important; }
  .nav__link.is-active {
    color: var(--terra);
  }
  .nav__link--cta-mobile {
    display: block !important;
    margin-top: 24px;
    padding: 18px 24px !important;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    text-align: center;
    font-size: 14px !important;
    letter-spacing: 0.12em;
  }
  .nav__link--cta-mobile::after { display: none !important; }
  .nav[data-menu-open="true"] { z-index: 200; }
  .nav__cta { padding: 7px 12px; font-size: 11px; letter-spacing: 0.04em; }

  /* Universally collapse any inline-style multi-column grid to one column.
     This catches every gridTemplateColumns set inline in JSX.
     EXCEPTION: [data-strength-banners] (handled by its own rule above). */
  [style*="gridTemplateColumns"]:not([data-strength-banners]):not([data-strength-banners] *),
  [style*="grid-template-columns"]:not([data-strength-banners]):not([data-strength-banners] *) {
    grid-template-columns: 1fr !important;
  }

  /* Strength visual area: tighten padding on mobile so the visual sits nicely below the copy */
  [data-strength-visual] {
    padding: 32px !important;
  }

  /* Hero headlines stay impactful but shrink — clamp() already handles this.
     Add a touch of horizontal breathing room. */
  .h-section, .display { letter-spacing: -0.035em; }

  /* Hero body row gap when buttons stack */
  .btn-hero { height: 52px; padding: 0 6px 0 22px; font-size: 14px; }
  .btn-hero__icon { width: 40px; height: 40px; }

  /* Footer */
  .footer { padding: 56px 20px 24px; margin-top: 64px; }
  .footer__big { margin-bottom: 36px; }
  .footer__big-img { height: 22vw; }
  .footer__grid { gap: 28px; padding-top: 36px; font-size: 13px; }
  .footer__bottom { flex-direction: column; gap: 10px; margin-top: 32px; }

  /* Pricing featured plan: cancel translateY so it sits inline */
  [style*="translateY(-20px)"] { transform: none !important; }

  /* Right-side rail — slimmer */
  .rail-right { width: 3px; }

  /* Vertical address ticker / corner badges — hide on mobile */
  [style*="writing-mode"], [style*="writingMode"] { display: none !important; }

  /* Service position map — tighten */
  svg[viewBox="0 0 100 60"] { display: none; }

  /* Reduce strength card padding */
  [data-strength-card] > div { padding: 28px !important; }

  /* CompanyInfo: dt/dd row narrower */
  dl div[style*="160px 1fr"] { grid-template-columns: 1fr !important; gap: 8px !important; padding: 20px 0 !important; }

  /* By-the-numbers — keep 3-up since it's narrow ish, but allow stacking under 480 */

  /* Members rail (if used) */
  .members-rail { gap: 16px !important; padding: 8px 20px 24px !important; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  section { padding: 28px 0 !important; }

  /* Even tighter card paddings */
  section [style*="padding: 48"]  { padding: 20px !important; }
  section [style*="padding: 36"]  { padding: 18px !important; }
  section [style*="padding: 32"]  { padding: 16px !important; }
  .footer { padding: 32px 16px 16px !important; }
  .footer__big-img { height: 36px !important; }

  .btn-hero { height: 48px; font-size: 13px; padding-left: 18px; }
  .btn-hero__icon { width: 36px; height: 36px; }
  .btn-hero__label { padding-right: 12px; }

  /* Stats: stack on phone */
  section [style*="repeat(3, 1fr)"] { grid-template-columns: 1fr !important; }

  /* Hero text gets a slight tap target */
  .h-section { line-height: 1.08; }
}

/* ============================================
   Responsive overrides for component-specific bits
   added after the base responsive block.
   ============================================ */
@media (max-width: 1024px) {
  /* StatementSection: image equal-height target loosens on tablet */
  section [style*="minHeight: 480"] { min-height: 360px !important; }
}

@media (max-width: 768px) {
  /* Stat cards (Top "By the numbers"): kill rotation so cards stack cleanly */
  .stat-card { transform: none !important; }
  .stat-card:hover { transform: translateY(-4px) !important; }

  /* Position map: cancel featured-card scale & translate */
  section [style*="scale(1.02)"] { transform: none !important; }

  /* Hide large decorative orbits / spinning text on mobile to avoid overflow */
  svg[viewBox="0 0 360 360"] { display: none !important; }

  /* StatementSection image: drop equal-height pairing, fall back to a sensible aspect */
  section [style*="minHeight: 480"] {
    min-height: 0 !important;
    aspect-ratio: 4/5;
  }
  /* And the inner image-slot should not force 100% height */
  section [style*="minHeight: 480"] image-slot { height: auto !important; aspect-ratio: 4/5 !important; }

  /* Pricing featured plan: also reset translateY in case translate is set via transform */
  [style*="translateY(-20px)"] { transform: none !important; }

  /* Right-side strength card visual gets a tighter padding */
  [style*="background: var(--bg-soft)"][style*="padding: 48"],
  [style*="background: var(--sky-soft)"][style*="padding: 48"] {
    padding: 28px !important;
  }

  /* Footer big logo: rein in if too tall on phones */
  .footer__big-img { height: 24vw; max-height: 120px; }

  /* Quadrant axis labels (Position Map) — hide on narrow */
  [style*="writingMode: \"vertical-rl\""],
  [style*="writing-mode: vertical-rl"] { display: none !important; }
}

@media (max-width: 480px) {
  /* Reduce the StatementSection paragraph max-width */
  section p { max-width: 100% !important; }

  /* Members section: drop circle size to fit */
  image-slot[shape="circle"] { max-width: 200px !important; }

  /* Pricing & strength cards: smaller border radii on phone */
  [style*="borderRadius: 16"], [style*="border-radius: 16"] { border-radius: 12px !important; }
}

/* ============================================
   Updated sections (no image-slots) — mobile tuning
   ============================================ */
@media (max-width: 768px) {
  /* New MembersPreview (CEO single card) — reduce padding & tighten gap */
  section [style*="background: var(--bg-soft)"][style*="padding: 48"] {
    padding: 28px !important;
    gap: 20px !important;
    border-radius: 16px !important;
  }

  /* Hide the vertical "Shinnosuke · Morita" rail label on mobile
     (the universal writingMode rule already does this, but make explicit) */
  section [style*="writingMode"][style*="vertical-rl"] {
    display: none !important;
  }

  /* CEO card: large headline scales further down */
  section h3[style*="clamp(40px, 4.8vw, 72px)"] {
    font-size: clamp(32px, 8vw, 44px) !important;
  }

  /* StatementSection essay text — slightly smaller line-height for mobile reading */
  section [style*="lineHeight: 2.2"] {
    line-height: 1.95 !important;
  }
}

@media (max-width: 480px) {
  /* CEO card: even tighter */
  section [style*="background: var(--bg-soft)"][style*="padding: 48"] {
    padding: 20px !important;
  }
  section [style*="background: var(--bg-soft)"][style*="padding: 48"] .sticker {
    font-size: 10px !important;
  }
}

/* ============================================
   PositionMap & Strength banners — responsive
   ============================================ */

/* Tablet: shrink bubbles slightly, taller aspect ratio */
@media (max-width: 1024px) {
  [data-position-map] {
    aspect-ratio: 4/3 !important;
  }
  [data-position-bubble] > div:first-child {
    width: 110px !important;
    height: 110px !important;
  }
}

/* Mobile: full rework — square map, much smaller bubbles, smaller axis labels */
@media (max-width: 768px) {
  [data-position-map] {
    aspect-ratio: 1/1 !important;
    border-radius: 16px !important;
  }

  /* Inner crosshair: tighten margins so axes sit closer to bubble area */
  [data-position-map] > div[style*="top: \"9%\""],
  [data-position-map] > div[style*="top: 9%"] { top: 14% !important; bottom: 18% !important; }
  [data-position-map] > div[style*="left: \"10%\""],
  [data-position-map] > div[style*="left: 10%"] { left: 18% !important; right: 12% !important; }

  /* Quadrant codes (Q1/Q2/Q3/Q4): hide on mobile — bubbles already convey positions */
  [data-position-map] > div[style*="0.22em"] {
    display: none !important;
  }

  /* Axis labels: smaller everything */
  [data-position-map] [style*="writingMode"][style*="vertical-rl"] {
    display: inline-block !important;
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
  }
  [data-position-map] > div[style*="bottom: 28"] {
    bottom: 16px !important;
    font-size: 11px !important;
  }
  [data-position-map] > div[style*="left: 18"] {
    left: 8px !important;
  }

  /* Bubbles: smaller circle + smaller label */
  [data-position-bubble] > div:nth-child(odd):first-child,
  [data-position-bubble] > div[style*="width: 130"] {
    width: 72px !important;
    height: 72px !important;
  }
  [data-position-bubble] span[style*="clamp(13px"] {
    font-size: 11px !important;
    line-height: 1.1 !important;
    padding: 0 4px !important;
  }
  [data-position-bubble] span[style*="clamp(20px"] {
    font-size: 13px !important;
  }
  /* Description below each bubble */
  /* Description below each bubble — hide on mobile to declutter */
  [data-position-bubble] > div[style*="fontSize: 12"][style*="whiteSpace: \"nowrap\""],
  [data-position-bubble] > div[style*="font-size: 12"] {
    display: none !important;
  }
  /* HERE WE ARE callout: hide on mobile (too cramped) */
  [data-position-bubble] > div[style*="HERE WE ARE"],
  [data-position-bubble] > div[style*="right: 100%"] {
    display: none !important;
  }
  /* Star burst around featured — shrink to keep within map bounds */
  [data-position-bubble] > div[style*="radial-gradient"] {
    width: 110px !important;
    height: 110px !important;
  }
}

@media (max-width: 480px) {
  /* Even tighter on phone */
  [data-position-bubble] > div[style*="width: 130"] {
    width: 60px !important;
    height: 60px !important;
  }
  [data-position-bubble] span[style*="clamp(13px"] { font-size: 10px !important; }
  [data-position-bubble] span[style*="clamp(20px"] { font-size: 11px !important; }
  [data-position-bubble] > div[style*="fontSize: 12"][style*="whiteSpace: \"nowrap\""] {
    font-size: 8px !important;
  }
}

/* ============================================
   Strength banners (4×4) — keep 4 columns on all viewports
   so the full grid stays visible on mobile.
   ============================================ */
@media (max-width: 768px) {
  [data-strength-banners] {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }
  /* Disable the breathing animation on mobile — its scale transform pushes
     banners outside their grid cell which looks like a broken layout. */
  [data-strength-banners] > div {
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 480px) {
  [data-strength-banners] {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
  }
  [data-strength-banners] > div {
    padding: 4px !important;
    border-radius: 5px !important;
    gap: 3px !important;
  }
  /* Shrink the A/B/C/D badge so it fits on tiny banners */
  [data-strength-banners] > div > div[style*="rgba(0,0,0,0.55)"] {
    padding: 0 3px !important;
    font-size: 6px !important;
    top: 3px !important;
    left: 3px !important;
  }
}

/* ============================================
   Mobile typography — preserve PC line-break positions
   PC側のフォントサイズはモバイルで自動縮小される clamp() に任せ、
   <br /> による改行位置はそのまま使う方針。
   text-wrap: balance / pretty は使わず（自動改行位置を変えるため）。
   ============================================ */
@media (max-width: 768px) {
  /* Section titles: scale down so each PC-broken segment fits on 1 line */
  section h2:not(.display),
  section h3,
  .h-section {
    font-size: clamp(22px, 6.4vw, 34px) !important;
    line-height: 1.28 !important;
    letter-spacing: -0.035em !important;
  }
  /* Hero / page-level h1 (not the brand wordmark) */
  section h1:not(.display) {
    font-size: clamp(28px, 8.4vw, 48px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.04em !important;
  }
  /* Brand wordmark display — keep impactful but shrink to fit */
  section h1.display,
  h1.display {
    font-size: clamp(56px, 18vw, 110px) !important;
    line-height: 1.0 !important;
  }
  /* Hero secondary subtitle (e.g. "向き合える自由を、全ての人に。") */
  section [style*="clamp(20px, 2.6vw, 38px)"] {
    font-size: clamp(16px, 4.6vw, 22px) !important;
    line-height: 1.45 !important;
  }
}

@media (max-width: 480px) {
  /* Even tighter on small phones — keeps PC <br /> segments on one line */
  section h2:not(.display),
  section h3,
  .h-section {
    font-size: clamp(19px, 6.4vw, 26px) !important;
  }
  section h1:not(.display) {
    font-size: clamp(24px, 8.2vw, 36px) !important;
  }
  section h1.display,
  h1.display {
    font-size: clamp(44px, 16vw, 80px) !important;
  }
}
