:root {
  --color-primary: #1d4ed8;
  --color-primary-dark: #1e3a8a;
  --color-primary-soft: #eef4ff;
  --color-bg: #ffffff;
  --color-bg-soft: #f5f7fb;
  --color-text: #1f2430;
  --color-text-soft: #5b6472;
  --color-border: #e2e6ee;
  --radius: 14px;
  --max-width: 1080px;
  --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.06);
  --shadow-md: 0 12px 28px -14px rgba(29, 78, 216, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 20;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--color-primary-dark);
  letter-spacing: 0.01em;
}

.logo span {
  color: var(--color-primary);
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 0.9rem;
}

.nav a {
  position: relative;
  text-decoration: none;
  color: var(--color-text-soft);
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: right 0.25s var(--ease);
}

.nav a:hover {
  color: var(--color-primary);
}

.nav a:hover::after,
.nav a.is-active::after {
  right: 0;
}

.nav a.is-active {
  color: var(--color-primary-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary-dark);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  text-align: center;
}

.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: float 16s ease-in-out infinite;
}

.blob-a {
  width: 320px;
  height: 320px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle at 30% 30%, #93c5fd, transparent 70%);
}

.blob-b {
  width: 280px;
  height: 280px;
  bottom: -140px;
  right: -60px;
  background: radial-gradient(circle at 60% 40%, #c7d2fe, transparent 70%);
  animation-delay: -8s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 40%, transparent 90%);
  opacity: 0.4;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20px, -24px) scale(1.06);
  }
}

.chip {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
  animation: bob 7s ease-in-out infinite;
}

.chip svg {
  width: 22px;
  height: 22px;
}

.chip-a {
  top: 100px;
  left: 7%;
}

.chip-b {
  top: 56px;
  right: 9%;
  animation-delay: -2.3s;
}

.chip-c {
  top: 270px;
  left: 15%;
  animation-delay: -4.6s;
}

@media (max-width: 900px) {
  .chip {
    display: none;
  }
}

@keyframes bob {
  0%, 100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(4deg);
  }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.scroll-cue {
  position: relative;
  z-index: 1;
  display: block;
  margin: 48px auto 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
  animation: cue-bounce 2s ease-in-out infinite;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.scroll-cue:hover {
  border-color: var(--color-primary);
}

.scroll-cue svg {
  width: 18px;
  height: 18px;
}

@keyframes cue-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (max-width: 600px) {
  .chip {
    width: 40px;
    height: 40px;
  }

  .chip svg {
    width: 18px;
    height: 18px;
  }
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 20px;
  color: var(--color-primary-dark);
  letter-spacing: -0.01em;
}

.hero-lead {
  color: var(--color-text-soft);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-photo {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 40px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: background 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -14px rgba(29, 78, 216, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 12px 30px;
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Section shared */
section {
  padding: 72px 0;
}

/* Sub-page header banner */
.page-header {
  padding: 64px 0 48px;
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  text-align: center;
}

.page-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.page-illustration svg {
  width: 120px;
  height: 120px;
}

.page-header h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  color: var(--color-primary-dark);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.page-header p {
  color: var(--color-text-soft);
  max-width: 560px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  text-align: center;
  margin: 0 0 12px;
}

.section-lead {
  text-align: center;
  color: var(--color-text-soft);
  margin: 0 auto 48px;
  max-width: 560px;
}

/* Scroll reveal (progressive enhancement: content is fully visible unless
   JS confirms it can animate it in, so it never breaks with JS off/blocked) */
.reveal {
  opacity: 1;
  transform: none;
}

body.reveal-armed .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

body.reveal-armed .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.service-grid > .reveal:nth-child(1) { transition-delay: 0ms; }
.service-grid > .reveal:nth-child(2) { transition-delay: 70ms; }
.service-grid > .reveal:nth-child(3) { transition-delay: 140ms; }

/* Services */
.services {
  background: var(--color-bg-soft);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.service-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #c7d5f5;
}

.service-card-media {
  aspect-ratio: 3 / 2;
  background: var(--color-bg-soft);
}

.service-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card-body {
  padding: 24px;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.service-icon svg {
  width: 24px;
  height: 24px;
}

.service-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.service-card p {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  margin: 0;
}

/* About */
.about-inner {
  max-width: 720px;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-table th,
.about-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.about-table tr:last-child th,
.about-table tr:last-child td {
  border-bottom: none;
}

.about-table th {
  width: 140px;
  background: var(--color-bg-soft);
  color: var(--color-text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.muted {
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

/* News */
.news {
  background: var(--color-bg-soft);
}

.news-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
}

.news-list li {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.news-list time {
  color: var(--color-text-soft);
  flex-shrink: 0;
}

/* Home: services teaser "more" link */
.services-more {
  text-align: center;
  margin: 40px 0 0;
}

.link-arrow {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-arrow:hover {
  color: var(--color-primary-dark);
}

/* Home: news teaser */
.news-teaser {
  background: var(--color-bg-soft);
}

.news-teaser-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.news-teaser-inner p {
  color: var(--color-text-soft);
  margin: 0;
}

.news-teaser-inner time {
  color: var(--color-text-soft);
  margin-right: 8px;
}

.section-title--inline {
  font-size: 1.3rem;
  color: var(--color-primary-dark);
  margin: 0 0 8px;
}

/* Home / services: bottom CTA banner */
.cta {
  text-align: center;
}

/* Contact */
.contact {
  text-align: center;
}

.contact-inner {
  max-width: 560px;
}

.contact-form {
  text-align: left;
}

.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-required {
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-primary);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-row textarea {
  resize: vertical;
}

.form-submit {
  border: none;
  cursor: pointer;
  width: 100%;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  text-align: center;
}

.form-status.is-success {
  color: #15803d;
}

.form-status.is-error {
  color: #b91c1c;
}

.contact-or {
  margin: 40px 0 16px;
  text-align: center;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.privacy-note {
  margin: 24px 0 0;
  color: var(--color-text-soft);
  font-size: 0.82rem;
}

/* Footer */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* Back to top */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background 0.2s ease;
  z-index: 15;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  background: var(--color-primary-dark);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }

  .nav.is-open {
    max-height: 260px;
  }

  .nav a {
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
  }

  .nav a::after {
    display: none;
  }
}
