:root {
  --green-50: #f2f8ee;
  --green-100: #e5f1df;
  --green-200: #d7e7cd;
  --green-300: #c4dab7;
  --green-700: #2f563d;
  --green-800: #264631;
  --green-900: #1a2f23;
  --red-700: #8d2a2a;
  --red-600: #a23737;
  --ink: #17241b;
  --paper-line: rgba(19, 29, 21, 0.2);
  --frame-line: rgba(16, 27, 20, 0.5);
  --shadow: 0 20px 46px rgba(21, 30, 22, 0.2);
  --shadow-deep: 0 14px 26px rgba(15, 23, 16, 0.26);
  --radius: 18px;
  --texture-ink: rgba(22, 36, 27, 0.04);
  --texture-soft: rgba(255, 255, 255, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1000px 620px at 8% -5%, rgba(141, 42, 42, 0.13) 0%, transparent 65%),
    radial-gradient(880px 540px at 100% -8%, rgba(47, 86, 61, 0.2) 0%, transparent 65%),
    linear-gradient(150deg, var(--green-50) 0%, var(--green-100) 48%, var(--green-200) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  opacity: 0.14;
  background-image:
    repeating-linear-gradient(to right, transparent 0 52px, rgba(24, 38, 28, 0.07) 52px 53px),
    repeating-linear-gradient(to bottom, transparent 0 52px, rgba(24, 38, 28, 0.07) 52px 53px),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(24, 38, 28, 0.02) 10px 11px),
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(24, 38, 28, 0.02) 10px 11px);
}

body::after {
  z-index: -1;
  opacity: 0.17;
  background-image:
    url("media/bamboo-pattern.svg"),
    url("media/bamboo-pattern.svg"),
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 70% 45%, rgba(25, 40, 30, 0.03) 0 1px, transparent 1px 100%),
    repeating-radial-gradient(
      circle at 0 100%,
      rgba(47, 86, 61, 0.04) 0 1px,
      transparent 1px 16px
    ),
    repeating-radial-gradient(
      circle at 18px 100%,
      rgba(47, 86, 61, 0.03) 0 1px,
      transparent 1px 16px
    );
  background-size:
    340px auto,
    300px auto,
    9px 9px,
    7px 7px,
    36px 18px,
    36px 18px;
  background-position:
    left -42px bottom -35px,
    right -70px top 120px,
    0 0,
    0 0,
    0 55%,
    18px 55%;
  background-repeat:
    no-repeat,
    no-repeat,
    repeat,
    repeat,
    repeat,
    repeat;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  margin: 0;
  line-height: 1.2;
}

h2 {
  font-weight: 400;
}

p {
  margin: 0;
}

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

.panel {
  border: 1px solid var(--frame-line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(38, 70, 50, 0.02) 0%, transparent 40%, rgba(38, 70, 50, 0.02) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(42, 65, 47, 0.028) 0 1px,
      transparent 1px 9px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.1) 0 2px,
      rgba(255, 255, 255, 0.02) 2px 5px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.2)),
    linear-gradient(145deg, var(--green-50) 0%, var(--green-200) 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--green-700);
}

.eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(162, 55, 55, 0.72);
}

.hero-copy .eyebrow::before {
  display: none;
}

.topbar {
  position: sticky;
  top: 0.55rem;
  z-index: 40;
  padding-top: 0.65rem;
}

.topbar-inner {
  position: relative;
  min-height: 76px;
  padding: 0.72rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(8px);
}

.topbar.reveal.in-view .topbar-inner::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(162, 55, 55, 0),
    rgba(162, 55, 55, 0.72) 22%,
    rgba(162, 55, 55, 0.72) 78%,
    rgba(162, 55, 55, 0)
  );
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-image {
  display: block;
  height: auto;
}

.brand-image-mark {
  width: 56px;
}

.brand-image-word {
  width: 82px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 50;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--green-700);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: var(--green-300);
}

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

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

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

.nav a {
  text-decoration: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--green-700);
  transition: transform 220ms ease, border-color 220ms ease, color 220ms ease,
    background-color 220ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(39, 69, 49, 0.34);
  background-color: rgba(255, 255, 255, 0.42);
}

.nav a.nav-apply {
  border: 2px solid var(--red-600);
  color: var(--red-700);
  font-weight: 600;
}

.nav a.nav-apply:hover,
.nav a.nav-apply:focus-visible {
  border-color: var(--red-700);
  background-color: rgba(162, 55, 55, 0.08);
  color: var(--red-700);
}

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(2.8rem, 9vw, 6rem) 0 clamp(2.2rem, 6vw, 4rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("media/dojo-hero-gendo.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(0.9) sepia(0.08) contrast(1.06) brightness(1.04);
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(242, 248, 238, 0.42), rgba(242, 248, 238, 0.2)),
    repeating-linear-gradient(
      to right,
      transparent 0 64px,
      rgba(28, 48, 35, 0.018) 64px 65px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 64px,
      rgba(28, 48, 35, 0.018) 64px 65px
    );
}

.hero-grid {
  display: grid;
  grid-template-columns: 58px 1fr 320px;
  gap: clamp(0.9rem, 2.1vw, 1.6rem);
  align-items: stretch;
}

.hero .panel {
  border-color: rgba(16, 27, 20, 0.28);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(42, 65, 47, 0.018) 0 1px,
      transparent 1px 11px
    ),
    linear-gradient(180deg, rgba(242, 248, 238, 0.46), rgba(242, 248, 238, 0.16)),
    linear-gradient(145deg, rgba(229, 241, 223, 0.36), rgba(215, 231, 205, 0.2));
  backdrop-filter: blur(1.5px) saturate(1.05);
}

.vertical-tag {
  font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  font-weight: 900;
  text-shadow: 0.4px 0 currentColor, -0.4px 0 currentColor;
  color: var(--green-800);
  border: 1px solid rgba(39, 69, 49, 0.34);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.1));
  padding: 0.6rem 0.12rem;
}

.hero-copy {
  padding: clamp(1rem, 2.3vw, 1.7rem);
  display: grid;
  align-content: start;
  gap: 1rem;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 4.8vw, 3.85rem);
  max-width: 16ch;
  font-weight: 400;
}

.hero-copy h1 span {
  font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  color: var(--red-700);
  display: block;
  font-weight: 400;
  letter-spacing: 0.015em;
}

.hero-copy p {
  max-width: 62ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.actions.center {
  justify-content: center;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 0.78rem 1.12rem;
  transition: transform 220ms ease, filter 220ms ease, border-color 220ms ease,
    background-color 220ms ease, color 220ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  border-color: rgba(69, 20, 20, 0.55);
  box-shadow: var(--shadow-deep);
}

.btn-secondary {
  color: var(--green-900);
  border-color: rgba(39, 69, 49, 0.45);
  background: rgba(255, 255, 255, 0.42);
}

.hero-side {
  padding: 1rem;
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.hero-side h2 {
  font-size: 1.45rem;
  text-align: center;
  margin-top: 0.55rem;
}

.hero-side ol {
  margin: 1.8rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.72rem;
}

.symbol-stack {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
}

.symbol-stack .icon-chip {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.symbol-stack .mahjong-symbol {
  font-size: 32px;
}

.icon-chip {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid rgba(26, 47, 35, 0.72);
  background:
    linear-gradient(180deg, rgba(242, 248, 238, 0.72), rgba(215, 231, 205, 0.4)),
    repeating-linear-gradient(
      to right,
      transparent 0 11px,
      rgba(26, 47, 35, 0.045) 11px 12px
    );
  color: rgba(31, 55, 40, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 7px 16px rgba(19, 31, 23, 0.12);
}

.icon-chip.red {
  color: rgba(141, 42, 42, 0.9);
}

.mahjong-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  line-height: 1;
  font-size: 16px;
  transform: none;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.section-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-top: 1.2rem;
  opacity: 0.78;
}

.section-icons .icon-chip {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.section-icons .mahjong-symbol {
  font-size: 32px;
}

.section {
  padding: clamp(2.4rem, 7vw, 5rem) 0;
}

.section-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--frame-line);
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(90deg, rgba(47, 86, 61, 0.04), transparent 20% 80%, rgba(47, 86, 61, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.18)),
    linear-gradient(145deg, var(--green-50) 0%, var(--green-200) 100%);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
}

.section-shell > * {
  position: relative;
  z-index: 1;
}

.section-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  background:
    repeating-radial-gradient(
      circle at 0 100%,
      rgba(47, 86, 61, 0.055) 0 1px,
      transparent 1px 16px
    ),
    repeating-radial-gradient(
      circle at 18px 100%,
      rgba(47, 86, 61, 0.045) 0 1px,
      transparent 1px 16px
    );
  background-size:
    36px 18px,
    36px 18px;
  background-position:
    0 100%,
    18px 100%;
}

.section-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(47, 86, 61, 0.24) 0 10px,
      transparent 10px 24px
    )
      left 12px top / 1px 100% no-repeat,
    repeating-linear-gradient(
      to bottom,
      rgba(47, 86, 61, 0.24) 0 10px,
      transparent 10px 24px
    )
      right 12px top / 1px 100% no-repeat;
}

.section-head {
  display: grid;
  gap: 0.58rem;
  margin-bottom: 1.1rem;
}

.section-head.center {
  text-align: center;
  justify-items: center;
}

.section-head h2 {
  position: relative;
  padding-bottom: 0.36rem;
  font-size: clamp(1.6rem, 3.8vw, 2.9rem);
  max-width: 20ch;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 58px;
  height: 1px;
  background: linear-gradient(90deg, rgba(162, 55, 55, 0), rgba(162, 55, 55, 0.58) 50%, rgba(162, 55, 55, 0));
  --accent-offset-x: -50%;
  transform: translateX(var(--accent-offset-x)) scaleX(0);
  transform-origin: center center;
  opacity: 0.35;
  transition: transform 560ms ease, opacity 560ms ease;
}

.section-head.center h2::after {
  left: 50%;
  --accent-offset-x: -50%;
  transform-origin: center center;
}

.section.reveal.in-view .section-head h2::after {
  transform: translateX(var(--accent-offset-x)) scaleX(1);
  opacity: 1;
}

#about .section-head h2 {
  font-weight: 400;
}

#about .section-icons {
  width: calc((100% - 1.7rem) / 3);
  justify-content: center;
}

.about-grid,
.sensei-grid,
.steps,
.curriculum-grid,
.results-grid {
  display: grid;
  gap: 0.85rem;
}

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

.sensei-grid {
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
}

.sensei-media {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.sensei-media .section-icons {
  margin-top: 0;
  justify-content: center;
}

.sensei-photo {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(26, 47, 35, 0.4);
  box-shadow: 0 14px 28px rgba(16, 27, 20, 0.16);
  opacity: 0.16;
  transform: scale(0.985);
  transition: opacity 620ms ease, transform 620ms ease;
  transition-delay: calc(var(--reveal-delay, 0ms) + 120ms);
}

.sensei-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  object-position: center top;
}

#sensei.reveal.in-view .sensei-photo {
  opacity: 1;
  transform: scale(1);
}

.card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--paper-line);
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.card::before,
.step::before,
.curriculum-item::before,
.result::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(162, 55, 55, 0.3), rgba(162, 55, 55, 0));
  pointer-events: none;
}

.card h3 {
  font-size: 1.3rem;
}

.sensei-profile,
.sensei-points {
  padding: 0.2rem 0.2rem;
  display: grid;
  align-content: start;
  gap: 0.65rem;
}

.sensei-points {
  border-left: 1px solid rgba(47, 86, 61, 0.24);
  padding-left: 1rem;
}

.sensei-profile h3,
.sensei-points h3 {
  font-size: 1.2rem;
}

.sensei-points ul {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.45rem;
}

.hero-side ol li::marker,
.sensei-points ul li::marker {
  color: rgba(162, 55, 55, 0.82);
}

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

.steps::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 51px;
  height: 1px;
  background: linear-gradient(90deg, rgba(39, 69, 49, 0), rgba(39, 69, 49, 0.5), rgba(39, 69, 49, 0));
}

.step {
  position: relative;
  min-height: 255px;
  padding: 1rem;
  border: 1px solid rgba(141, 42, 42, 0.5);
  display: grid;
  align-content: start;
  gap: 0.65rem;
}

.step h3 {
  font-size: 1.34rem;
}

.step-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(23, 38, 29, 0.35);
  background:
    repeating-radial-gradient(
      circle at 0 100%,
      rgba(47, 86, 61, 0.1) 0 1px,
      transparent 1px 9px
    ),
    repeating-radial-gradient(
      circle at 10px 100%,
      rgba(47, 86, 61, 0.08) 0 1px,
      transparent 1px 9px
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2)),
    linear-gradient(145deg, rgba(47, 86, 61, 0.25), rgba(162, 55, 55, 0.24));
  background-size:
    18px 9px,
    18px 9px,
    auto,
    auto;
  background-position:
    0 100%,
    9px 100%,
    0 0,
    0 0;
  font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--red-700);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: breathe 6.5s ease-in-out infinite;
}

.step:nth-child(2) .step-icon {
  animation-delay: 1.2s;
}

.step:nth-child(3) .step-icon {
  animation-delay: 2.4s;
}

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

.curriculum-item {
  position: relative;
  border: 1px solid var(--green-700);
  padding: 1rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.result {
  position: relative;
  border: 1px solid var(--paper-line);
  padding: 1rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.curriculum-item h3,
.result h3 {
  font-size: 1.2rem;
}

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

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.gate {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  padding: clamp(1.2rem, 2.8vw, 2.2rem);
  display: grid;
  justify-items: center;
  gap: 0.95rem;
}

.gate > * {
  position: relative;
  z-index: 1;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 44px,
      rgba(24, 38, 28, 0.08) 44px 45px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 44px,
      rgba(24, 38, 28, 0.08) 44px 45px
    );
}

.gate h2 {
  position: relative;
  font-size: clamp(1.7rem, 4.5vw, 3.15rem);
  max-width: 19ch;
  padding-bottom: 0.36rem;
}

.gate h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 58px;
  height: 1px;
  background: linear-gradient(90deg, rgba(162, 55, 55, 0), rgba(162, 55, 55, 0.58) 50%, rgba(162, 55, 55, 0));
  transform: translateX(-50%);
  opacity: 1;
}

.gate p {
  max-width: 60ch;
}

.footer {
  padding: 0.45rem 0 1.3rem;
}

.footer-inner {
  min-height: 74px;
  padding: 0.74rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-logo {
  display: inline-flex;
  gap: 0.35rem;
}

.footer-logo span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(23, 38, 29, 0.35);
}

.footer-logo span:nth-child(1) {
  background: var(--green-700);
}

.footer-logo span:nth-child(2) {
  background: var(--red-600);
}

.footer-logo span:nth-child(3) {
  background: var(--green-300);
}

.footer-inner p {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(21, 33, 25, 0.78);
}

.footer-credit-link {
  color: inherit;
  text-decoration: none;
}

.pulse-clickable {
  animation: pulse 3.1s ease-in-out infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 760ms ease, transform 760ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(162, 55, 55, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(162, 55, 55, 0.16);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 3px;
}

/* Large tablets and small desktops */
@media (max-width: 1060px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .vertical-tag {
    writing-mode: horizontal-tb;
    width: fit-content;
    padding: 0.42rem 0.72rem;
    letter-spacing: 0.16em;
  }

  .hero-side {
    max-width: 560px;
  }

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

  .sensei-media {
    grid-column: 1 / -1;
  }

  .sensei-photo img {
    min-height: 260px;
    max-height: 320px;
  }

  .sensei-points {
    border-left: 0;
    border-top: 1px solid rgba(47, 86, 61, 0.24);
    padding-left: 0.2rem;
    padding-top: 0.85rem;
  }

  .steps::before {
    display: none;
  }

  #about .section-icons {
    width: 100%;
  }
}

/* Tablets */
@media (max-width: 900px) {
  .vertical-tag {
    display: none;
  }

  .hero-copy {
    padding: 1.5rem;
  }

  .hero-side {
    padding: 1.5rem;
  }

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

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

  .curriculum-grid {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--green-700);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .curriculum-item {
    border: none;
    border-radius: 0;
  }

  .curriculum-item:last-child {
    border-bottom: none;
  }

  .curriculum-item.panel {
    border-radius: 0;
    box-shadow: none;
  }

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

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

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

  .sensei-points {
    grid-column: 1;
  }
}

/* Small tablets and large phones */
@media (max-width: 760px) {
  .container {
    width: min(1140px, calc(100% - 1.2rem));
  }

  .hero .container {
    width: calc(100% - 3rem);
  }

  .hero-copy {
    padding: 1.25rem 1.5rem;
  }

  .hero-side {
    padding: 1.25rem 1.5rem;
  }

  .topbar {
    top: 0.42rem;
  }

  .topbar-inner {
    flex-wrap: nowrap;
    gap: 0.62rem;
    padding: 0.6rem 0.8rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 238, 0.98));
    backdrop-filter: blur(12px);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 350ms ease, opacity 300ms ease;
  }

  .nav.is-open {
    max-height: 400px;
    opacity: 1;
  }

  .nav a {
    font-size: 0.85rem;
    padding: 0.85rem 1.2rem;
    border-radius: 0;
    text-align: center;
  }

  .nav a.nav-apply {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
  }

  .brand-image-mark {
    width: 48px;
  }

  .brand-image-word {
    width: 70px;
  }

  .hero-copy h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

  .section-head h2 {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .gate h2 {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
  }

  .section-head,
  .hero-copy {
    text-align: center;
    justify-items: center;
  }

  .section-head h2,
  .hero-copy h1 {
    text-align: center;
    max-width: 100%;
  }

  .icon-chip {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .icon-chip .mahjong-symbol,
  .section-icons .mahjong-symbol,
  .symbol-stack .mahjong-symbol {
    font-size: 26px;
  }

  .section-icons .icon-chip,
  .symbol-stack .icon-chip {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .step-icon {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
  }

  .step {
    min-height: auto;
  }

  .actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

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

  .actions.center .btn {
    max-width: 280px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .container {
    width: calc(100% - 1rem);
  }

  .hero .container {
    width: calc(100% - 4rem);
  }

  .topbar {
    top: 0.3rem;
  }

  .topbar-inner {
    min-height: 60px;
    padding: 0.5rem 0.6rem;
    border-radius: 14px;
  }

  .brand-image-mark {
    width: 40px;
  }

  .brand-image-word {
    width: 60px;
  }

  .nav a {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .hero-copy {
    padding: 1rem 1.25rem;
  }

  .hero-copy h1 {
    font-size: clamp(1.4rem, 7vw, 1.9rem);
  }

  .hero-copy p {
    font-size: 0.92rem;
  }

  .hero-side {
    padding: 1rem 1.25rem;
  }

  .hero-side h2 {
    font-size: 1.2rem;
  }

  .hero-side ol {
    font-size: 0.9rem;
    padding-left: 0.9rem;
    margin-top: 1.2rem;
  }

  .section {
    padding: clamp(1.6rem, 5vw, 2.5rem) 0;
  }

  .section-shell {
    padding: 1rem 1.25rem;
    border-radius: 14px;
  }

  .section-head h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  }

  .gate h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.8rem);
  }

  .gate {
    padding: 1rem 1.25rem;
  }

  .gate p {
    font-size: 0.9rem;
  }

  .card,
  .step,
  .curriculum-item,
  .result {
    padding: 1rem 1.25rem;
  }

  .card h3,
  .step h3,
  .curriculum-item h3,
  .result h3 {
    font-size: 1.1rem;
  }

  .card p,
  .step p,
  .curriculum-item p,
  .result p {
    font-size: 0.88rem;
  }

  .icon-chip {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .icon-chip .mahjong-symbol,
  .section-icons .mahjong-symbol,
  .symbol-stack .mahjong-symbol {
    font-size: 22px;
  }

  .section-icons .icon-chip,
  .symbol-stack .icon-chip {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .step-icon {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    border-radius: 10px;
  }

  .btn {
    font-size: 0.75rem;
    padding: 0.7rem 1rem;
  }

  .sensei-profile h3,
  .sensei-points h3 {
    font-size: 1.05rem;
  }

  .sensei-profile p,
  .sensei-points p,
  .sensei-points ul {
    font-size: 0.9rem;
  }

  .footer-inner {
    min-height: 60px;
    padding: 0.6rem 0.8rem;
  }

  .footer-inner p {
    font-size: 0.68rem;
  }

  .vertical-tag {
    font-size: 0.68rem;
    padding: 0.35rem 0.55rem;
  }

  .section-icons {
    margin-top: 0.8rem;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .hero-copy h1 {
    font-size: 1.3rem;
  }

  .section-head h2 {
    font-size: 1.15rem;
  }

  .gate h2 {
    font-size: 1.15rem;
  }

  .nav a {
    font-size: 0.75rem;
    padding: 0.7rem 0.9rem;
  }

  .btn {
    font-size: 0.7rem;
    padding: 0.65rem 0.85rem;
  }

  .icon-chip {
    width: 32px;
    height: 32px;
  }

  .icon-chip .mahjong-symbol,
  .section-icons .mahjong-symbol,
  .symbol-stack .mahjong-symbol {
    font-size: 18px;
  }

  .section-icons .icon-chip,
  .symbol-stack .icon-chip {
    width: 32px;
    height: 32px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
