:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fb;
  --color-text: #1c2130;
  --color-text-muted: #5b6373;
  --color-primary: #3457d5;
  --color-primary-dark: #2743ab;
  --color-border: #e3e6ee;
  --color-danger: #d64545;
  --color-success: #1a8a4a;
  --color-highlight-text: #0c6c8f;
  --color-highlight-bg: #e3f6fd;
  --color-highlight-border: #29b6f6;
  --max-width: 1080px;

  /* 背景の桜の木: 季節カラー */
  --tree-branch: #b39485;
  --tree-canopy-a: #f2bccb;
  --tree-canopy-b: #f8d8e1;
  --tree-petal: #f2afc4;
  --tree-ground: #e7ebf2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#top,
#apps,
#about,
#contact {
  scroll-margin-top: 72px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
}

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

h1, h2, h3 {
  line-height: 1.4;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 背景の桜の木 */
.sakura-bg {
  position: fixed;
  right: -48px;
  bottom: 0;
  width: min(46vw, 540px);
  z-index: -1;
  pointer-events: none;
}

.sakura-bg svg {
  display: block;
  width: 100%;
  height: auto;
}

.tree-ground {
  fill: var(--tree-ground);
}

.tree-sway {
  transform-origin: 300px 780px;
  animation: tree-sway 9s ease-in-out infinite alternate;
}

@keyframes tree-sway {
  from { transform: rotate(-0.6deg); }
  to   { transform: rotate(0.7deg); }
}

.branch {
  fill: none;
  stroke: var(--tree-branch);
  stroke-linecap: round;
  transition: stroke 1.6s ease;
}

.canopy-a,
.canopy-b {
  transition: fill 1.6s ease, opacity 1.6s ease;
}

.canopy-a { fill: var(--tree-canopy-a); }
.canopy-b { fill: var(--tree-canopy-b); }

/* 夏: 新緑 */
body[data-season="summer"] {
  --tree-canopy-a: #aacfa1;
  --tree-canopy-b: #c8e2bd;
}

/* 秋: 紅葉 */
body[data-season="autumn"] {
  --tree-canopy-a: #e5aa79;
  --tree-canopy-b: #f0c89e;
  --tree-petal: #dfa06b;
}

/* 冬: 落葉して枝だけに */
body[data-season="winter"] {
  --tree-branch: #9d918e;
  --tree-petal: #ccd9e6;
}

body[data-season="winter"] .canopy-a,
body[data-season="winter"] .canopy-b {
  opacity: 0;
}

/* 舞う花びら / 落ち葉 / 雪 */
.petals {
  transition: opacity 1.6s ease;
}

/* 夏は舞わない */
body[data-season="summer"] .petals {
  opacity: 0;
}

.petal {
  fill: var(--tree-petal);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: petal-fall 8.5s linear infinite;
}

@keyframes petal-fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.9; }
  80%  { opacity: 0.7; }
  100% { transform: translate(-70px, 400px) rotate(260deg); opacity: 0; }
}

.petal:nth-of-type(2)  { animation-delay: 1.1s; animation-duration: 9.5s; }
.petal:nth-of-type(3)  { animation-delay: 2.3s; }
.petal:nth-of-type(4)  { animation-delay: 3.1s; animation-duration: 7.5s; }
.petal:nth-of-type(5)  { animation-delay: 4.2s; animation-duration: 10.5s; }
.petal:nth-of-type(6)  { animation-delay: 5.4s; }
.petal:nth-of-type(7)  { animation-delay: 6.2s; animation-duration: 9s; }
.petal:nth-of-type(8)  { animation-delay: 7.3s; }
.petal:nth-of-type(9)  { animation-delay: 1.7s; animation-duration: 7.5s; }
.petal:nth-of-type(10) { animation-delay: 3.8s; animation-duration: 10s; }
.petal:nth-of-type(11) { animation-delay: 5.9s; }
.petal:nth-of-type(12) { animation-delay: 0.6s; animation-duration: 9s; }

@media (prefers-reduced-motion: reduce) {
  .tree-sway,
  .petal {
    animation: none;
  }
  .petals {
    opacity: 0;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo img {
  display: block;
  height: 36px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}

.site-nav a {
  color: var(--color-text);
}

.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 6px;
}

/* Hero */
.hero {
  /* 背景の木が透けるよう半透明にする(元: bg-alt → bg のグラデーション) */
  background: linear-gradient(180deg, rgba(245, 247, 251, 0.72), rgba(255, 255, 255, 0.4));
  padding: 96px 0 72px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 20px;
}

.hero-sub {
  color: var(--color-text-muted);
  font-size: 16px;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

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

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

.btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-bg-alt);
}

/* Section */
.section-title {
  text-align: center;
  font-size: 26px;
  margin-bottom: 40px;
}

.apps {
  background: rgba(245, 247, 251, 0.75);
  padding: 80px 0;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-card:hover {
  box-shadow: 0 8px 24px rgba(20, 30, 60, 0.08);
  transform: translateY(-2px);
}

.app-card img {
  border-radius: 18px;
  margin-bottom: 16px;
}

.app-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.app-desc {
  width: 100%;
  color: var(--color-text-muted);
  font-size: 14px;
  min-height: 66px;
}

.app-for {
  width: 100%;
  color: var(--color-highlight-text);
  font-size: 13px;
  font-weight: 600;
  background: var(--color-highlight-bg);
  border-left: 3px solid var(--color-highlight-border);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
}

.app-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

/* About */
.about {
  background: rgba(255, 255, 255, 0.55);
  padding: 72px 0;
  text-align: center;
}

.about-message {
  max-width: 640px;
  margin: 0 auto 48px;
  color: var(--color-text-muted);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 48px;
  text-align: left;
}

.value-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px;
}

.value-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.value-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.about-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Contact */
.contact {
  background: rgba(245, 247, 251, 0.75);
  padding: 80px 0 96px;
}

.contact-lead {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 40px;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
}

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

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.required {
  color: var(--color-danger);
  font-weight: 500;
  font-size: 12px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.contact-form .btn {
  width: 100%;
}

/* Honeypot: visually hidden but present in DOM/tab order-safe */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  text-align: center;
  font-size: 14px;
  margin-top: 16px;
  min-height: 20px;
}

.form-status.success {
  color: var(--color-success);
}

.form-status.error {
  color: var(--color-danger);
}

/* Privacy policy */
.policy {
  padding: 80px 0 96px;
}

.policy-inner {
  max-width: 720px;
}

.policy h1 {
  margin-bottom: 32px;
}

.policy h2 {
  font-size: 17px;
  margin: 32px 0 12px;
}

.policy p,
.policy li {
  color: var(--color-text-muted);
  font-size: 15px;
}

.policy ul {
  padding-left: 1.4em;
}

.policy-date {
  margin-top: 40px;
  font-size: 13px;
}

/* Footer */
.site-footer {
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid var(--color-border);
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 860px) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .value-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  .app-desc {
    min-height: 0;
  }
  .value-grid {
    grid-template-columns: 1fr;
  }
  .about-stats {
    gap: 32px;
  }
  .header-inner {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
  }
  .site-nav a:not(.nav-cta) {
    white-space: nowrap;
  }
  .nav-cta {
    padding: 8px 12px;
    white-space: nowrap;
  }
  .hero {
    padding: 64px 0 48px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .sakura-bg {
    width: 76vw;
    right: -14vw;
    opacity: 0.75;
  }
  #top,
  #apps,
  #about,
  #contact {
    scroll-margin-top: 116px;
  }
}
