:root {
  color-scheme: light;
  --background: #e3e3e3;
  --background-soft: #f5f1ec;
  --foreground: #303442;
  --foreground-soft: #606979;
  --primary: #961831;
  --primary-deep: #711125;
  --primary-foreground: #fafafa;
  --secondary: #7b7162;
  --border: #d2d0cc;
  --border-soft: rgb(123 113 98 / 22%);
  --card: rgb(255 255 255 / 86%);
  --legal-foreground: #454b5b;
  --navy: #071935;
  --gold: #f2b920;
  --shadow-soft: 0 24px 70px rgb(56 38 42 / 12%);
  --shadow-button: 0 14px 30px rgb(150 24 49 / 24%);
  --radius-large: 2rem;
  --radius-medium: 1.25rem;
  --content-width: 72rem;
  --legal-width: 56rem;
  font-family:
    ui-rounded, "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

[lang="en"] {
  font-family: ui-rounded, "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  color: var(--foreground);
  background:
    radial-gradient(circle at 12% 14%, rgb(150 24 49 / 10%), transparent 24rem),
    radial-gradient(
      circle at 86% 22%,
      rgb(242 185 32 / 12%),
      transparent 22rem
    ),
    linear-gradient(145deg, #f2f0ed 0%, var(--background) 55%, #dedbd6 100%);
}

body.menu-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: var(--primary-foreground);
  background: var(--navy);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
}

.site-header__inner {
  position: relative;
  justify-content: space-between;
  min-height: 5rem;
  gap: 1.5rem;
}

.brand {
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  box-shadow: 0 7px 18px rgb(7 25 53 / 18%);
}

.site-nav {
  gap: clamp(0.75rem, 3vw, 2rem);
  font-size: 0.88rem;
}

.menu-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  place-content: center;
  gap: 0.25rem;
  padding: 0;
  color: var(--foreground);
  cursor: pointer;
  background: rgb(255 255 255 / 58%);
  border: 1px solid rgb(123 113 98 / 24%);
  border-radius: 0.9rem;
  box-shadow: 0 8px 22px rgb(56 38 42 / 10%);
  backdrop-filter: blur(14px);
}

.menu-toggle__line {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

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

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

.site-nav a {
  text-underline-offset: 0.35em;
}

.site-nav a:hover {
  text-decoration: underline;
}

.language-switcher {
  flex: none;
  gap: 0.2rem;
  padding: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: rgb(255 255 255 / 52%);
  border: 1px solid rgb(123 113 98 / 20%);
}

.language-switcher span {
  color: rgb(96 105 121 / 38%);
}

.language-switcher a {
  min-width: 2.2rem;
  padding: 0.42rem 0.5rem;
  text-align: center;
}

.language-switcher a:hover {
  text-decoration: none;
}

.language-switcher a[aria-current="page"] {
  color: var(--primary-foreground);
  background: var(--primary);
}

.content-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.surface-card {
  background: var(--card);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
}

.glass-panel {
  backdrop-filter: blur(18px);
}

.grid-layout {
  display: grid;
}

.flex-layout {
  display: flex;
}

.inline-flex-layout {
  display: inline-flex;
}

.wrap-layout {
  display: flex;
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.margin-reset {
  margin: 0;
}

.font-heavy {
  font-weight: 900;
}

.nowrap {
  white-space: nowrap;
}

.leading-relaxed {
  line-height: 1.8;
}

.text-small {
  font-size: 0.82rem;
}

.rounded-full {
  border-radius: 999px;
}

.no-underline {
  text-decoration: none;
}

.text-primary {
  color: var(--primary);
}

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

.text-muted {
  color: var(--foreground-soft);
}

.hero {
  position: relative;
  place-items: center;
  min-height: calc(100svh - 5rem);
  padding: clamp(4rem, 9vw, 7rem) 1.25rem clamp(5rem, 10vw, 8rem);
  overflow: hidden;
  text-align: center;
}

.hero-decoration {
  position: absolute;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgb(123 113 98 / 16%);
  border-radius: 46% 54% 64% 36% / 56% 38% 62% 44%;
}

.hero-decoration--start {
  top: 6%;
  left: -10rem;
  transform: rotate(18deg);
}

.hero-decoration--end {
  right: -11rem;
  bottom: 2%;
  transform: rotate(-24deg);
}

.hero__content {
  width: min(100%, 52rem);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: settle-in 680ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 {
  font-size: clamp(3.2rem, 10vw, 6.8rem);
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
  animation: settle-in 680ms 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__lead {
  max-width: 38rem;
  margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 2;
  text-wrap: balance;
  animation: settle-in 680ms 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__actions {
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2.5rem;
  animation: settle-in 680ms 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.primary-button {
  justify-content: center;
  min-height: 4.25rem;
  padding: 0.8rem 1.55rem;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-button);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.app-store-button {
  gap: 0.8rem;
  min-width: 17.5rem;
  text-align: left;
}

.primary-button:hover {
  background: var(--primary-deep);
}

.app-store-button:hover {
  box-shadow: 0 18px 36px rgb(150 24 49 / 30%);
  transform: translateY(-3px);
}

.app-store-button svg {
  width: 2rem;
  height: 2rem;
  flex: none;
  fill: currentColor;
}

.app-store-button__copy {
  gap: 0.05rem;
}

.app-store-button__small {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.app-store-button__large {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero__note {
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
}

.feature-section {
  padding: clamp(4.5rem, 9vw, 7.5rem) 0;
}

.section-heading {
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title {
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.section-heading h2 {
  font-size: clamp(1.3rem, 6.4vw, 2.8rem);
}

.final-cta h2 {
  font-size: clamp(1.3rem, 6.4vw, 2.4rem);
  letter-spacing: -0.06em;
}

.section-heading p {
  max-width: 37rem;
  line-height: 1.9;
  text-wrap: pretty;
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-card {
  min-height: 18rem;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border: 1px solid rgb(255 255 255 / 70%);
}

.feature-card__number {
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  margin-bottom: 4rem;
  font-size: 0.75rem;
  border: 1px solid rgb(150 24 49 / 24%);
}

.feature-card h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.final-cta {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  margin-bottom: clamp(5rem, 9vw, 8rem);
  padding-block: clamp(3rem, 8vw, 4.5rem);
  padding-inline: clamp(1rem, 5vw, 4.5rem);
  color: #f7f3ed;
  background:
    radial-gradient(circle at 85% 0%, rgb(242 185 32 / 22%), transparent 20rem),
    var(--navy);
  border-radius: clamp(2rem, 5vw, 3.5rem);
  box-shadow: 0 30px 80px rgb(7 25 53 / 24%);
}

.final-cta p {
  max-width: 35rem;
  margin: 1rem 0 0;
  color: rgb(247 243 237 / 70%);
}

.final-cta .app-store-button {
  background: var(--primary);
}

.site-footer {
  border-top: 1px solid var(--border-soft);
}

.site-footer__inner {
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 2.5rem 0;
  gap: 2rem;
}

.site-footer__copy {
  margin: 0.75rem 0 0;
}

.footer-links {
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  text-underline-offset: 0.3em;
}

.legal-main {
  width: min(calc(100% - 2rem), var(--legal-width));
  margin: clamp(2rem, 7vw, 5rem) auto clamp(5rem, 9vw, 8rem);
}

.legal-hero {
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid rgb(255 255 255 / 75%);
}

.legal-hero .eyebrow {
  animation: none;
}

.legal-hero h1 {
  font-size: clamp(1.4rem, 7vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.legal-hero__summary {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  line-height: 1.9;
}

.legal-meta {
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
}

.legal-layout {
  grid-template-columns: 13rem minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: clamp(3rem, 7vw, 5rem);
}

.legal-toc {
  position: sticky;
  top: 2rem;
  padding-left: 1rem;
  border-left: 2px solid rgb(150 24 49 / 22%);
}

.legal-toc p {
  margin: 0 0 0.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.legal-toc ol {
  gap: 0.65rem;
  padding: 0;
  font-size: 0.8rem;
  list-style: none;
}

.legal-content {
  min-width: 0;
}

.legal-section {
  padding-bottom: 2.75rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.legal-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  line-height: 1.4;
}

.legal-section h2 span {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.legal-section h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.05rem;
}

.legal-copy {
  color: var(--legal-foreground);
  font-size: 0.95rem;
  line-height: 2;
}

.legal-paragraph {
  margin: 0.9rem 0;
}

.legal-list {
  padding-left: 1.4rem;
}

.legal-section li + li {
  margin-top: 0.5rem;
}

.legal-table-wrap {
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
}

.legal-table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  background: rgb(255 255 255 / 62%);
}

.legal-table-cell {
  padding: 1rem;
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.legal-table th {
  color: var(--foreground);
  font-size: 0.78rem;
  background: rgb(123 113 98 / 8%);
}

.legal-table td {
  color: var(--legal-foreground);
  font-size: 0.85rem;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.contact-card {
  padding: 1.5rem;
  margin-top: 1.5rem;
  background: rgb(150 24 49 / 6%);
  border: 1px solid rgb(150 24 49 / 16%);
  border-radius: var(--radius-medium);
}

.contact-card p + p {
  margin-top: 0.5rem;
}

.contact-card a {
  font-weight: 800;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}

.not-found {
  place-items: center;
  min-height: calc(100svh - 5rem);
  padding: 3rem 1rem 6rem;
  text-align: center;
}

.not-found__inner {
  width: min(100%, 38rem);
  padding: clamp(2rem, 7vw, 4rem);
}

.not-found__code {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.not-found h1 {
  margin: 1rem 0;
  font-size: clamp(1.3rem, 7vw, 4rem);
  letter-spacing: -0.05em;
}

.text-button {
  min-height: 3.4rem;
  margin-top: 2rem;
  font-weight: 800;
}

.text-button:hover {
  transform: translateY(-2px);
}

@keyframes settle-in {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 50rem) {
  .responsive-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  .feature-card__number {
    margin-bottom: 2.5rem;
  }

  .final-cta {
    justify-items: start;
  }

  .legal-toc {
    position: static;
    padding: 1.25rem;
    background: rgb(255 255 255 / 45%);
    border: 0;
    border-radius: var(--radius-medium);
  }

  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 42rem) {
  .site-header__inner {
    min-height: 4.5rem;
    gap: 1rem;
  }

  .menu-toggle {
    display: grid;
    flex: none;
    position: relative;
    z-index: 30;
  }

  .menu-toggle[aria-expanded="true"] {
    position: fixed;
    top: 0.875rem;
    right: max(1rem, env(safe-area-inset-right));
    color: var(--primary-foreground);
    background: rgb(113 17 37 / 82%);
    border-color: rgb(250 250 250 / 24%);
    box-shadow: 0 12px 32px rgb(7 25 53 / 22%);
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100%;
    min-height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 5.75rem max(1.5rem, calc((100vw - 34rem) / 2))
      max(2rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    visibility: hidden;
    color: var(--primary-foreground);
    background:
      radial-gradient(
        circle at 90% 15%,
        rgb(242 185 32 / 18%),
        transparent 17rem
      ),
      linear-gradient(145deg, var(--primary-deep), var(--primary) 68%, #84142a);
    opacity: 0;
    overscroll-behavior: contain;
    pointer-events: none;
    transform: translateX(100%);
    transition: none;
    isolation: isolate;
  }

  .site-nav[data-animated="true"] {
    transition:
      visibility 0s linear 420ms,
      opacity 240ms ease,
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .site-nav::before {
    position: absolute;
    top: max(1.65rem, env(safe-area-inset-top));
    left: max(1.5rem, env(safe-area-inset-left));
    z-index: -1;
    content: "育てる本棚  /  MENU";
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    opacity: 0.62;
  }

  [lang="en"] .site-nav::before {
    content: "grow books  /  MENU";
  }

  .site-nav::after {
    position: absolute;
    right: -8rem;
    bottom: -11rem;
    z-index: -1;
    width: 24rem;
    height: 24rem;
    content: "";
    border: 1px solid rgb(250 250 250 / 13%);
    border-radius: 46% 54% 64% 36% / 56% 38% 62% 44%;
    transform: rotate(-24deg);
  }

  .site-nav[data-open="true"] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .site-nav[data-animated="true"][data-open="true"] {
    transition-delay: 0s;
  }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
    border-bottom: 1px solid rgb(250 250 250 / 22%);
    transition: color 180ms ease;
  }

  .site-nav a:first-of-type {
    border-top: 1px solid rgb(250 250 250 / 22%);
  }

  .site-nav a:hover {
    color: var(--gold);
    text-decoration: none;
  }

  .site-nav .language-switcher {
    width: fit-content;
    margin-top: 1.5rem;
    color: var(--primary-foreground);
    background: rgb(250 250 250 / 11%);
    border-color: rgb(250 250 250 / 20%);
  }

  .site-nav .language-switcher span {
    color: rgb(250 250 250 / 42%);
  }

  .site-nav .language-switcher a {
    width: auto;
    min-width: 2.8rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    border: 0;
  }

  .site-nav .language-switcher a:hover {
    color: var(--gold);
  }

  .site-nav .language-switcher a[aria-current="page"] {
    color: var(--primary-deep);
    background: var(--primary-foreground);
  }
}

@media (max-width: 37rem) {
  .site-header__inner {
    padding: 0.75rem 0;
  }

  .hero {
    min-height: auto;
  }

  .hero__lead br {
    display: none;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .legal-toc ol {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
