*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --color-accent: #dc4436;
  --color-accent-dark: #c23a2e;
  --color-accent-deep: #a8281d;
  --color-text: #1f2937;
  --color-text-muted: #4b5563;
  --color-border: #e5e7eb;
  --color-surface: #ffffff;
  --color-surface-muted: #f9fafb;
  --color-surface-soft: #fef2f2;
  --color-dark: #111827;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.18);
  --radius-sm: 1rem;
  --radius-md: 1.5rem;
  --radius-lg: 2rem;
  --header-height: 4.5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--color-text);
  background: var(--color-surface);
  font-family: "Zen Maru Gothic", sans-serif;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

input {
  border: 0;
}

svg {
  display: block;
}

h1,
h2,
h3,
h4,
.brand__name,
.eyebrow {
  margin: 0;
  font-family: "Fredoka One", cursive;
  font-weight: 400;
}

p {
  margin: 0;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.header-shell {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand__logo {
  width: 2.75rem;
  height: 2.75rem;
}

.brand__logo--small {
  width: 2.25rem;
  height: 2.25rem;
}

.brand__name {
  font-size: 1.35rem;
}

.desktop-nav {
  display: none;
}

.nav-link {
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.contact-link:hover,
.contact-link:focus-visible {
  color: var(--color-accent);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-button {
  min-width: 2.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  color: #6b7280;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-button:hover,
.lang-button:focus-visible {
  background: #f3f4f6;
}

.lang-button.is-active {
  color: #fff;
  background: var(--color-accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--color-accent-dark);
}

.button--small {
  padding: 0.8rem 1.35rem;
}

.button--large {
  padding: 1rem 2rem;
}

.button--inverse {
  color: var(--color-accent);
  background: #fff;
}

.button--secondary-inverse {
  color: #fff;
  background: rgba(122, 23, 16, 0.45);
}

.button--secondary-inverse:hover,
.button--secondary-inverse:focus-visible {
  background: rgba(122, 23, 16, 0.65);
}

.menu-toggle {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem;
  border-radius: 0.9rem;
  color: var(--color-text);
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(0.45rem) rotate(45deg);
}

.site-header.is-menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-0.45rem) rotate(-45deg);
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  background: #fff;
}

.site-header.is-menu-open .mobile-menu {
  display: block;
}

.mobile-menu__inner {
  padding: 1rem 0 1.25rem;
}

.mobile-nav {
  display: grid;
  gap: 1rem;
}

.language-switcher--mobile {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

main {
  overflow: clip;
}

.hero-section {
  position: relative;
  padding: 5rem 0 7rem;
  background: linear-gradient(135deg, #fef2f2 0%, #ffedd5 100%);
}

.hero-section::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -4.5rem;
  height: 9rem;
  background: var(--color-surface);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hero-grid,
.history-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-copy,
.history-copy,
.history-media {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

#hero-title {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 1.4rem;
}

.hero-text {
  max-width: 36rem;
  margin-bottom: 2rem;
  font-size: 1.08rem;
  color: var(--color-text-muted);
}

.hero-media {
  display: flex;
  justify-content: center;
}

.hero-media__image,
.content-image {
  width: 100%;
  border-radius: var(--radius-lg);
}

.hero-media__image {
  max-width: 28rem;
}

.section {
  position: relative;
  padding: 6rem 0;
}

.section--light {
  background: var(--color-surface);
}

.section--muted {
  background: var(--color-surface-muted);
}

.section--wave-top::before {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  top: -4.5rem;
  height: 9rem;
  background: var(--color-surface);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.section-heading {
  margin-bottom: 3rem;
  text-align: center;
}

.section-heading h2,
#newsletter-title,
#follow-title,
#about-contact-title,
#history-kanji-title,
#history-motoko-title,
#history-categories-title {
  font-size: clamp(2rem, 4vw, 2.4rem);
  line-height: 1.15;
}

.section-lead {
  max-width: 42rem;
  margin: 1rem auto 0;
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.section-lead--light {
  color: rgba(255, 255, 255, 0.88);
}

.feature-grid,
.steps-grid {
  display: grid;
  gap: 1.5rem;
}

.feature-card,
.step-card {
  height: 100%;
  padding: 1.75rem;
  border-radius: var(--radius-md);
}

.feature-card {
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  background: var(--color-surface-soft);
  transform: translateY(-2px);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: 999px;
  color: var(--color-accent);
  background: rgba(220, 68, 54, 0.12);
}

.feature-icon svg,
.icon-button svg,
.contact-link svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feature-card h3,
.step-card h3,
.history-card h3,
.history-card h4 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.feature-card p,
.step-card p,
.history-body,
.body-copy,
.contact-link,
.footer-tagline,
.footer-meta {
  color: var(--color-text-muted);
}

.step-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.step-card__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-badge {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--color-accent);
  font-family: "Fredoka One", cursive;
  font-size: 1.15rem;
}

.figure-panel {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.figure-panel .content-image {
  max-width: 52rem;
}

.kanji-block {
  margin: 1.75rem 0 2rem;
}

.kanji-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.kanji-mark {
  font-family: serif;
  font-size: clamp(3.5rem, 10vw, 4.75rem);
  line-height: 1;
}

.kanji-label {
  margin-bottom: 0.25rem;
}

.kanji-meaning {
  color: var(--color-text-muted);
}

.history-body {
  display: grid;
  gap: 1rem;
}

.history-card {
  margin-top: 1rem;
  padding: 1.75rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.history-card--secondary {
  background: var(--color-surface-muted);
}

.category-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.category-list li {
  display: grid;
  gap: 0.15rem;
}

.category-list strong {
  color: var(--color-text);
}

.quote {
  margin-top: 1rem;
  font-style: italic;
  color: var(--color-text-muted);
}

.narrow-stack {
  max-width: 52rem;
  text-align: center;
}

.narrow-stack--light {
  color: #fff;
}

.body-copy {
  font-size: 1.02rem;
}

.contact-panel {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.icon-button {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
}

.icon-button--light {
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.icon-button--light:hover,
.icon-button--light:focus-visible {
  color: #fff;
  background: var(--color-accent);
}

.cta-section {
  position: relative;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
}

.cta-section::before,
.cta-section::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.cta-section::before {
  top: 3rem;
  left: max(1rem, calc((100vw - 1120px) / 2));
  width: 8rem;
  height: 8rem;
}

.cta-section::after {
  right: max(1rem, calc((100vw - 1120px) / 2));
  bottom: 3rem;
  width: 10rem;
  height: 10rem;
}

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

.cta-link {
  display: flex;
  justify-content: center;
  width: 100%;
}

.cta-button {
  width: min(220px, 100%);
}

.signup-form,
.newsletter-block,
.follow-block {
  width: 100%;
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.text-input {
  width: 100%;
  min-height: 3.4rem;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  color: var(--color-dark);
  background: #fff;
}

.text-input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.form-message {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.newsletter-block {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.follow-block {
  margin-top: 3rem;
}

.social-row--light .icon-button--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.social-row--light .icon-button--ghost:hover,
.social-row--light .icon-button--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

.site-footer {
  padding: 3rem 0;
  color: #d1d5db;
  background: #111827;
}

.footer-shell {
  text-align: center;
}

.brand--footer {
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
}

.footer-tagline {
  margin-bottom: 0.75rem;
}

.footer-meta {
  color: #9ca3af;
}

.footer-links {
  margin-top: 0.85rem;
}

.footer-link {
  color: #f9fafb;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
  transition: color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #ffffff;
}

.privacy-shell {
  max-width: 48rem;
}

.privacy-card {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  box-shadow: var(--shadow-sm);
}

.privacy-card h2 {
  font-size: 1.35rem;
}

.privacy-date {
  color: var(--color-text-muted);
}

.privacy-list {
  margin: 0;
  padding-left: 1.25rem;
}

.privacy-list li + li {
  margin-top: 0.75rem;
}

@media (min-width: 700px) {
  .input-row {
    flex-direction: row;
  }

  .input-row .text-input {
    flex: 1 1 auto;
  }

  .input-row .button {
    flex: 0 0 auto;
  }
}

@media (min-width: 900px) {
  .desktop-nav {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
  }

  .desktop-nav .language-switcher {
    padding-left: 1.25rem;
    border-left: 1px solid var(--color-border);
  }

  .menu-toggle,
  .mobile-menu {
    display: none !important;
  }

  .hero-grid,
  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 899px) {
  .hero-section {
    padding-top: 4rem;
  }

  .section,
  .cta-section {
    padding: 5rem 0;
  }
}

@media (max-width: 699px) {
  .container {
    width: min(1120px, calc(100% - 1.5rem));
  }

  .hero-section::after {
    height: 6rem;
    bottom: -3rem;
  }

  .section--wave-top::before {
    height: 6rem;
    top: -3rem;
  }

  .feature-card,
  .step-card,
  .history-card {
    padding: 1.4rem;
  }
}
