:root {
  --ink: #14251f;
  --ink-soft: #52645d;
  --cream: #f7f3e9;
  --paper: #fffdf7;
  --green: #174b3c;
  --green-dark: #0c3027;
  --mint: #b9d7c7;
  --gold: #d9a441;
  --coral: #e56b55;
  --pink: #f3b7c4;
  --line: rgba(20, 37, 31, .13);
  --shadow: 0 25px 80px rgba(12, 48, 39, .12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.progress-bar {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gold);
  transform-origin: left;
}

/* ---------------- Header ---------------- */

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  transition: .35s ease;
}

.site-header.scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(12, 48, 39, .92);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 35px rgba(0,0,0,.12);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.3rem;
}

.logo strong {
  display: block;
  font-size: 1rem;
  letter-spacing: .06em;
}

.logo small {
  display: block;
  margin-top: 4px;
  font-size: .53rem;
  letter-spacing: .35em;
  opacity: .7;
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: .84rem;
  letter-spacing: .05em;
}

.nav a {
  position: relative;
  padding: 8px 0;
}

.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width .3s ease;
}

.nav a:not(.nav-cta):hover::after {
  width: 100%;
}

.nav-cta {
  padding: 11px 17px !important;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  transition: .3s ease;
}

.nav-cta:hover {
  background: white;
  color: var(--green);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
}

/* ---------------- Hero ---------------- */

.hero {
  min-height: 94vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  color: white;
  background: var(--green-dark);
}

.hero-photo,
.hero-overlay,
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-photo {
  z-index: -3;
  background:
    url("https://images.unsplash.com/photo-1493976040374-85c8e12f0c0e?auto=format&fit=crop&w=2200&q=85")
    center / cover;
  transform: scale(1.03);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero-overlay {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 28, 22, .91) 0%, rgba(5, 28, 22, .62) 45%, rgba(5, 28, 22, .18) 100%),
    linear-gradient(0deg, rgba(5, 28, 22, .35), transparent 40%);
}

.grain {
  z-index: -1;
  opacity: .08;
  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='.5'/%3E%3C/svg%3E");
}

.hero-content {
  width: min(1200px, 90%);
  margin: 0 auto;
  padding: 150px 0 120px;
  position: relative;
}

.eyebrow {
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold);
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.78);
  animation: fadeUp .9s .1s both;
}

.eyebrow-line {
  width: 42px;
  height: 1px;
  background: var(--gold);
}

.hero-title {
  max-width: 950px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 8vw, 8.6rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.055em;
  animation: fadeUp 1s .25s both;
}

.hero-title em {
  display: block;
  color: #f3d38d;
  font-style: italic;
}

.hero-copy {
  max-width: 590px;
  margin: 30px 0 0;
  color: rgba(255,255,255,.8);
  font-size: 1.06rem;
  line-height: 1.8;
  animation: fadeUp 1s .42s both;
}

.hero-actions {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 34px;
  animation: fadeUp 1s .58s both;
}

.button {
  min-height: 52px;
  padding: 0 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.button-primary {
  background: var(--gold);
  color: #192016;
}

.button-primary:hover,
.button-light:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(0,0,0,.18);
}

.button-arrow {
  font-size: 1.15rem;
  transition: transform .25s ease;
}

.button:hover .button-arrow {
  transform: translateX(5px);
}

.button-ghost {
  border: 1px solid rgba(255,255,255,.45);
  color: white;
}

.button-ghost:hover {
  background: rgba(255,255,255,.1);
}

.hero-kana {
  position: absolute;
  right: 2%;
  bottom: 4%;
  display: flex;
  gap: .06em;
  font-family: var(--serif);
  font-size: clamp(5rem, 13vw, 13rem);
  color: rgba(255,255,255,.06);
  pointer-events: none;
}

.scroll-hint {
  position: absolute;
  right: 5vw;
  bottom: 36px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: .57rem;
  letter-spacing: .2em;
  opacity: .7;
  writing-mode: vertical-rl;
}

.scroll-hint i {
  width: 1px;
  height: 58px;
  background: white;
  animation: scrollLine 1.8s ease-in-out infinite;
}

/* ---------------- Sakura ---------------- */

.sakura {
  position: absolute;
  top: -30px;
  display: block;
  border-radius: 100% 0 100% 0;
  background: #f8cbd6;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.08));
  animation-name: fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes fall {
  from {
    transform: translate3d(0, -30px, 0) rotate(0deg);
  }
  to {
    transform: translate3d(var(--drift), 105vh, 0) rotate(680deg);
  }
}

/* ---------------- General sections ---------------- */

.section {
  position: relative;
  padding: 130px 0;
}

.section-inner {
  width: min(1120px, 90%);
  margin: 0 auto;
}

.intro {
  background: var(--cream);
  overflow: hidden;
}

.intro-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 100px;
  align-items: end;
}

.intro h2,
.section-heading h2,
.word-content h2,
.experience-header h2,
.cta h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.045em;
}

.intro h2 {
  font-size: clamp(3rem, 6vw, 6rem);
}

.intro h2 span,
.section-heading h2 span,
.word-content h2 span,
.cta h2 span {
  color: var(--coral);
  font-style: italic;
}

.intro-copy {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.85;
}

.intro-copy .lead {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.4;
}

.floating-kanji {
  position: absolute;
  font-family: var(--serif);
  color: rgba(23,75,60,.05);
  pointer-events: none;
}

.kanji-one {
  right: 8%;
  top: 10%;
  font-size: 18rem;
  transform: rotate(9deg);
}

.kanji-two {
  left: 3%;
  bottom: -10%;
  font-size: 11rem;
  transform: rotate(-14deg);
}

/* ---------------- Lessons ---------------- */

.lessons {
  background: var(--paper);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 55px;
}

.section-heading h2 {
  font-size: clamp(3rem, 5vw, 5.4rem);
}

.section-note {
  max-width: 250px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-size: .9rem;
}

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

.lesson-card {
  min-height: 510px;
  position: relative;
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: white;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease, border-color .45s ease;
}

.lesson-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.lesson-card-featured {
  background: var(--green);
  color: white;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .7rem;
  letter-spacing: .12em;
}

.card-number {
  opacity: .55;
}

.card-japanese {
  font-family: var(--serif);
  font-size: 1.6rem;
}

.card-icon {
  width: 75px;
  height: 75px;
  margin: 70px 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 2rem;
  opacity: .9;
  transition: transform .5s ease;
}

.lesson-card:hover .card-icon {
  transform: rotate(12deg) scale(1.08);
}

.lesson-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.lesson-card p {
  margin: 15px 0;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: .92rem;
}

.lesson-card-featured p {
  color: rgba(255,255,255,.68);
}

.card-link {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid currentColor;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}

.card-link span {
  display: inline-block;
  margin-left: 7px;
  transition: transform .25s ease;
}

.card-link:hover span {
  transform: translate(4px, -4px);
}

/* ---------------- Hakata word ---------------- */

.word-section {
  background: var(--green-dark);
  color: white;
  overflow: hidden;
}

.word-glow {
  position: absolute;
  width: 650px;
  height: 650px;
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,164,65,.22), transparent 67%);
  animation: glowFloat 8s ease-in-out infinite alternate;
}

.word-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  align-items: center;
}

.word-content h2 {
  font-size: clamp(3.2rem, 6vw, 6.3rem);
}

.word-content > p:not(.eyebrow) {
  max-width: 510px;
  margin: 30px 0;
  color: rgba(255,255,255,.66);
  line-height: 1.85;
}

.text-link {
  display: inline-flex;
  gap: 15px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255,255,255,.45);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.text-link span {
  transition: transform .3s ease;
}

.text-link:hover span {
  transform: translateX(6px);
}

.interactive-word {
  --mouse-x: 0;
  --mouse-y: 0;
  min-height: 470px;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 900px;
  cursor: pointer;
}

.word-ring {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.ring-one {
  transform: rotateX(68deg) rotateZ(-15deg);
}

.ring-two {
  width: 300px;
  height: 300px;
  transform: rotateY(67deg) rotateZ(15deg);
}

.word-card {
  position: relative;
  width: min(330px, 85%);
  padding: 45px 30px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px rgba(0,0,0,.2);
  transform:
    rotateX(calc(var(--mouse-y) * -8deg))
    rotateY(calc(var(--mouse-x) * 8deg));
  transition: transform .2s ease;
}

.word-label {
  display: block;
  margin-bottom: 30px;
  color: var(--gold);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .2em;
}

.japanese-word {
  display: flex;
  justify-content: center;
  gap: .05em;
  font-family: var(--serif);
  font-size: 4.7rem;
}

.japanese-word span {
  display: inline-block;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}

.interactive-word:hover .japanese-word span:nth-child(1) {
  transform: translateY(-10px) rotate(-5deg);
}

.interactive-word:hover .japanese-word span:nth-child(2) {
  transform: translateY(6px);
}

.interactive-word:hover .japanese-word span:nth-child(3) {
  transform: translateY(-7px);
}

.interactive-word:hover .japanese-word span:nth-child(4) {
  transform: translateY(5px) rotate(5deg);
}

.word-translation {
  margin-top: 10px;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .55;
}

.word-card p {
  color: rgba(255,255,255,.72);
}

.word-hint {
  margin-top: 30px;
  font-size: .53rem;
  letter-spacing: .18em;
  opacity: .38;
}

/* ---------------- Experience ---------------- */

.experience {
  background: var(--cream);
}

.experience-header {
  margin-bottom: 60px;
}

.experience-header h2 {
  font-size: clamp(3.2rem, 6vw, 6.2rem);
}

.experience-list {
  border-top: 1px solid var(--line);
}

.experience-item {
  display: grid;
  grid-template-columns: 90px 1fr 100px;
  align-items: center;
  gap: 30px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  transition: padding .35s ease;
}

.experience-item:hover {
  padding-left: 16px;
  padding-right: 16px;
  background: rgba(255,255,255,.45);
}

.experience-number {
  font-size: .68rem;
  letter-spacing: .1em;
  opacity: .45;
}

.experience-item h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
}

.experience-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .86rem;
}

.experience-mark {
  font-family: var(--serif);
  font-size: 3.5rem;
  text-align: right;
  color: rgba(23,75,60,.17);
}

/* ---------------- CTA ---------------- */

.cta {
  min-height: 650px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 50% 45%, rgba(217,164,65,.17), transparent 28%),
    var(--green);
}

.cta-inner {
  text-align: center;
}

.cta .eyebrow {
  color: var(--gold);
}

.cta h2 {
  font-size: clamp(3.5rem, 8vw, 8rem);
}

.cta h2 span {
  color: #f3d38d;
}

.cta-inner > p:not(.eyebrow) {
  max-width: 520px;
  margin: 28px auto 35px;
  color: rgba(255,255,255,.68);
  line-height: 1.8;
}

.button-light {
  background: white;
  color: var(--green);
}

.cta-sakura {
  position: absolute;
  right: 7%;
  bottom: -10%;
  font-family: var(--serif);
  font-size: 24rem;
  line-height: 1;
  color: rgba(255,255,255,.035);
  transform: rotate(12deg);
  animation: slowRotate 14s ease-in-out infinite alternate;
  pointer-events: none;
}

/* ---------------- Footer ---------------- */

.footer {
  padding: 35px 0;
  background: #08241d;
  color: white;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.footer p,
.copyright {
  margin: 0;
  color: rgba(255,255,255,.5);
  font-size: .7rem;
  letter-spacing: .08em;
}

.footer-logo {
  opacity: .9;
}

.back-top {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  width: 45px;
  height: 45px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: .3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  transform: translateY(-4px);
}

/* ---------------- Reveal animations ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(45px);
  transition:
    opacity .8s ease,
    transform .8s cubic-bezier(.2,.8,.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: .12s;
}

.reveal-delay-2 {
  transition-delay: .24s;
}

/* ---------------- Keyframes ---------------- */

@keyframes heroDrift {
  from {
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.09) translate3d(-1%, -1%, 0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollLine {
  0%, 100% {
    transform: scaleY(.4);
    transform-origin: top;
    opacity: .35;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
}

@keyframes glowFloat {
  from {
    transform: translateY(-50%) scale(.95);
  }
  to {
    transform: translateY(-45%) scale(1.08);
  }
}

@keyframes slowRotate {
  from {
    transform: rotate(8deg) translateY(0);
  }
  to {
    transform: rotate(17deg) translateY(-20px);
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 850px) {
  .site-header {
    padding: 18px 5vw;
  }

  .menu-toggle {
    display: flex;
    width: 42px;
    height: 42px;
    padding: 9px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: white;
    transition: .3s ease;
  }

  .menu-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

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

  .menu-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav {
    position: absolute;
    top: 76px;
    right: 5vw;
    width: min(300px, 90vw);
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    background: rgba(12,48,39,.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: .3s ease;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav a {
    padding: 13px 8px;
  }

  .nav-cta {
    text-align: center;
    margin-top: 7px;
  }

  .hero {
    min-height: 850px;
  }

  .hero-content {
    padding-top: 160px;
  }

  .hero-title {
    font-size: clamp(3.5rem, 15vw, 6.5rem);
  }

  .scroll-hint {
    display: none;
  }

  .intro-grid,
  .word-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    min-height: 420px;
  }

  .card-icon {
    margin-top: 45px;
  }

  .section-heading {
    display: block;
  }

  .section-note {
    margin-top: 20px;
  }

  .interactive-word {
    min-height: 390px;
  }

  .word-ring {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 560px) {
  .section {
    padding: 90px 0;
  }

  .hero {
    min-height: 780px;
  }

  .hero-copy {
    font-size: .94rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 310px;
  }

  .button {
    width: 100%;
  }

  .hero-kana {
    font-size: 8rem;
    right: -10%;
  }

  .experience-item {
    grid-template-columns: 45px 1fr 45px;
    gap: 12px;
  }

  .experience-mark {
    font-size: 2rem;
  }

  .experience-item h3 {
    font-size: 1.35rem;
  }

  .experience-item p {
    font-size: .76rem;
  }

  .footer-inner {
    flex-wrap: wrap;
  }

  .footer p {
    order: 3;
    width: 100%;
  }

  .cta-sakura {
    font-size: 15rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
