/* Kung Fu Kai · calm ink-and-rice-paper theme. Colours come from Backstage (core.js sets the --variables). */
:root {
  --bg: #f3eee5; --panel: #ebe4d7; --ink: #1f1c18; --soft: #5e574d; --accent: #6f7d63; --seal: #a3402e;
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --serif: "Shippori Mincho", "Songti SC", Georgia, serif;
  --sans: "Zen Kaku Gothic New", "Helvetica Neue", Arial, sans-serif;
  --brush: "Ma Shan Zheng", "Nanum Brush Script", "Charm", "Kaiti SC", "STKaiti", serif;
  --wrap: 1180px; --r: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 300 1.04rem/1.75 var(--sans); -webkit-font-smoothing: antialiased; }
body::before { /* faint paper grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-mode="dark"] body::before { opacity: .12; }
main, nav, footer { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: .01em; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ink pictures melt into the paper on light themes */
.ink img { mix-blend-mode: multiply; }
[data-mode="dark"] .ink { background: #f3eee5; border-radius: var(--r); padding: 10px; }
[data-mode="dark"] .ink img { mix-blend-mode: normal; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.6em; border-radius: 999px; font: 500 .92rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; border: 1px solid var(--ink); transition: background .25s, color .25s, border-color .25s; }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }

/* nav */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background .3s, box-shadow .3s; }
.scrolled #nav, .menu-open #nav { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.seal { display: grid; place-items: center; width: 36px; height: 36px; background: var(--seal); color: #f6efe4; font: 1.4rem/1 var(--brush); border-radius: 3px; transform: rotate(-3deg); box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 18%, transparent); }
.brand-name { font: 600 1.15rem/1 var(--serif); letter-spacing: .06em; }
#nav-links { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; align-items: center; }
#nav-links a { text-decoration: none; font-size: .86rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; color: var(--soft); transition: color .2s; }
#nav-links a:hover { color: var(--ink); }
#nav-links .nav-cta { color: var(--ink); border: 1px solid var(--ink); padding: .5em 1.2em; border-radius: 999px; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink); transition: transform .3s; }
.nav-toggle span:first-child { top: 17px; } .nav-toggle span:last-child { top: 26px; }
.menu-open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu-open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* hero */
.hero { position: relative; padding: 120px 0 40px; min-height: 92vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero-enso { position: absolute; width: 760px; height: 760px; left: -260px; top: -120px; color: var(--ink); opacity: .05; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 3rem; align-items: center; }
.eyebrow { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1.6rem; }
.hero-title { font-size: clamp(2.8rem, 6.2vw, 5.4rem); font-weight: 500; line-height: 1.05; margin-bottom: 1.6rem; }
.hero-sub { font-size: 1.12rem; color: var(--soft); max-width: 34em; margin-bottom: 2.2rem; }
.hero-btns { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-art { position: relative; margin: 0; }
.hero-art img { width: 100%; -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); }
[data-mode="dark"] .hero-art img { -webkit-mask-image: none; mask-image: none; }
.hero-char { position: absolute; right: -6px; bottom: -10px; font: 4.4rem/1 var(--brush); color: var(--seal); opacity: .85; writing-mode: vertical-rl; }
.stats { list-style: none; padding: 0; margin: 3.5rem auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stats li { padding: 1.4rem 1rem 0; display: flex; flex-direction: column; gap: .2rem; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; padding-left: 0; }
.stats b { font: 500 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--serif); }
.stats span { font-size: .84rem; color: var(--soft); letter-spacing: .04em; }

/* sections */
.section { padding: clamp(72px, 10vw, 130px) 0; position: relative; }
.section-panel { background: var(--panel); }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 3.5rem; }
.sec-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 500; margin-bottom: .8rem; }
.sec-head p { color: var(--soft); margin: 0; }
.lotus { width: 44px; height: 28px; color: var(--accent); display: block; margin: 0 auto 1rem; }
.kicker { display: flex; align-items: center; gap: .7rem; font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.kicker .lotus { margin: 0; width: 34px; height: 22px; }
.prose p { color: var(--soft); }
.fine { text-align: center; font-size: .86rem; color: var(--soft); margin-top: 2rem; }

/* teacher */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.about-art { margin: 0; }
.about-text .lead { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 500; margin: 1rem 0 1.6rem; }
.quote { margin: 2rem 0; padding: 1.2rem 0 1.2rem 1.6rem; border-left: 2px solid var(--seal); }
.quote p { font: 500 1.3rem/1.5 var(--serif); margin-bottom: .5rem; }
.quote cite { font-style: normal; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.creds { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; }
.creds li { display: flex; gap: .8rem; align-items: flex-start; }
.cred-mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--seal); color: var(--seal); border-radius: 3px; font: 600 .95rem/1 var(--serif); margin-top: 2px; }
.creds b { display: block; font: 600 .98rem/1.35 var(--serif); }
.creds span { font-size: .84rem; color: var(--soft); }

/* classes */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card { position: relative; background: var(--bg); padding: 2.2rem 2rem 2rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); transition: transform .35s, box-shadow .35s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(0,0,0,.35); }
.card-char { position: absolute; right: 14px; top: 6px; font: 3.2rem/1.1 var(--brush); color: var(--ink); opacity: .1; writing-mode: vertical-rl; max-height: 90%; overflow: hidden; }
.card-img { width: calc(100% + 4rem); max-width: none; margin: -2.2rem -2rem 1.4rem; aspect-ratio: 16/10; object-fit: cover; }
.card h3 { font-size: 1.35rem; margin-bottom: .4rem; position: relative; }
.tag { display: inline-block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--seal); font-weight: 500; margin-bottom: 1rem; }
.card p:last-child { color: var(--soft); font-size: .96rem; margin: 0; }

/* who */
.who { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.6rem 3rem; }
.who li { text-align: center; padding: 0 .5rem; }
.who .lotus { width: 36px; height: 22px; opacity: .8; }
.who h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.who p { color: var(--soft); font-size: .96rem; margin: 0; }

/* journey */
.journey { list-style: none; padding: 0; margin: 0 auto; max-width: 900px; }
.journey li { display: grid; grid-template-columns: 240px 1fr; gap: 2.4rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.journey li:last-child { border-bottom: 1px solid var(--line); }
.j-place { position: relative; }
.j-native { display: block; font: 1.25rem/1.2 var(--brush); color: var(--seal); margin-bottom: .45rem; }
.j-place h3 { font-size: 1.8rem; font-weight: 500; }
.j-time { display: inline-block; margin-top: .5rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.journey p { color: var(--soft); margin: 0; align-self: center; }
.journey .dot { color: var(--seal); }

/* lineage */
.lineage-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.lineage-char { font: clamp(3rem, 6vw, 4.6rem)/1 var(--brush); color: var(--seal); margin-bottom: .6rem; }
.lineage h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 500; margin-bottom: 1.4rem; }
.lineage .btn { margin-top: .8rem; }
.lineage-art { margin: 0; max-width: 460px; justify-self: center; }

/* packages */
.packages { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; }
.packages .pkg { flex: 1 1 240px; max-width: 280px; }
@media (max-width: 560px) { .packages .pkg { max-width: none; } }
.pkg { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 2.2rem 1.8rem 1.8rem; display: flex; flex-direction: column; }
.pkg-feat { border-color: var(--ink); box-shadow: 0 22px 50px -32px rgba(0,0,0,.45); }
.pkg-badge { position: absolute; top: -12px; left: 1.8rem; background: var(--seal); color: #f6efe4; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; padding: .35em .9em; border-radius: 2px; }
.pkg h3 { font-size: 1.4rem; }
.pkg-unit { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin: .4rem 0 1rem; }
.pkg-price { font: 500 2rem/1.1 var(--serif); margin-bottom: 1rem; }
.pkg-ask { font: 400 1.05rem/1.3 var(--serif); font-style: italic; color: var(--soft); }
.pkg > p:not([class]) { color: var(--soft); font-size: .95rem; flex: 1; }
.pkg .btn { align-self: flex-start; margin-top: .6rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.g-item { position: relative; padding: 0; border: 0; background: var(--panel); cursor: zoom-in; aspect-ratio: 3/4; overflow: hidden; border-radius: var(--r); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; filter: grayscale(.15); }
.g-item:hover img { transform: scale(1.04); }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem .9rem .7rem; font-size: .8rem; letter-spacing: .06em; color: #f6efe4; background: linear-gradient(transparent, rgba(20,18,15,.7)); text-align: left; opacity: 0; transition: opacity .3s; }
.g-item:hover .g-cap, .g-item:focus-visible .g-cap { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(18,16,14,.94); display: grid; place-items: center; padding: 3rem 1rem; }
.lightbox figure { margin: 0; max-width: 1100px; text-align: center; }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
.lightbox figcaption { color: #e9e2d6; margin-top: 1rem; font-size: .9rem; letter-spacing: .06em; }
.lightbox button { position: absolute; background: none; border: 0; color: #e9e2d6; font-size: 2.6rem; cursor: pointer; padding: .3em .5em; line-height: 1; }
.lb-close { top: 10px; right: 14px; } .lb-prev { left: 6px; top: 50%; transform: translateY(-50%); } .lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* contact */
.contact { overflow: hidden; }
.contact-enso { position: absolute; width: 520px; height: 520px; right: -140px; bottom: -160px; color: var(--seal); opacity: .07; pointer-events: none; }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); position: relative; }
.contact h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; margin-bottom: 1rem; }
.contact-text > p { color: var(--soft); }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.contact-list li { padding: .8rem 0; border-top: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-list span { width: 70px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 500; padding-top: .25em; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--line); }
.book { background: var(--bg); padding: clamp(1.4rem, 3vw, 2.4rem); border-radius: var(--r); border: 1px solid var(--line); display: grid; gap: 1rem; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.book label { display: grid; gap: .35rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); font-weight: 400; }
.book small { text-transform: none; letter-spacing: 0; opacity: .8; }
.book input, .book select, .book textarea { font: 300 1rem/1.4 var(--sans); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 28%, transparent); padding: .55rem 0; border-radius: 0; width: 100%; }
.book select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.book select option { background: var(--bg); color: var(--ink); }
.book textarea { resize: vertical; border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); padding: .7rem; border-radius: var(--r); }
.book input:focus, .book select:focus, .book textarea:focus { outline: none; border-color: var(--accent); }
.book .btn { justify-self: start; margin-top: .4rem; }
.trap { position: absolute; left: -9999px; }
.form-msg { margin: 0; font-size: .92rem; min-height: 1.4em; }
.form-msg.ok { color: var(--accent); } .form-msg.bad { color: var(--seal); }

/* footer */
.footer { padding: 3rem 0; border-top: 1px solid var(--line); }
.footer-in { display: flex; align-items: center; gap: 1rem; }
.footer-enso { width: 34px; height: 34px; color: var(--ink); opacity: .7; }
.footer-copy { margin: 0; font-size: .84rem; color: var(--soft); flex: 1; }
.footer-back { font-size: .76rem; color: var(--soft); text-decoration: none; opacity: .55; letter-spacing: .08em; }
.footer-back:hover { opacity: 1; }

/* motion */
.rise { opacity: 0; transform: translateY(16px); transition: opacity .9s ease, transform .9s ease; }
.rise.in { opacity: 1; transform: none; }
body:not(.ready) main { opacity: 0; }
main { transition: opacity .5s; }

/* tablet + phone */
@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .who { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .journey li { grid-template-columns: 180px 1fr; gap: 1.6rem; }
}
@media (max-width: 780px) {
  .nav-toggle { display: block; }
  #nav-links { position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: var(--bg); flex-direction: column; justify-content: flex-start; padding: 2.5rem 16px; gap: 1.6rem; transform: translateX(100%); transition: transform .35s; }
  #nav-links a { font-size: 1.05rem; }
  .menu-open #nav-links { transform: none; }
  .hero { padding-top: 96px; min-height: 0; }
  .hero-grid, .about-grid, .lineage-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; }
  .hero-char { font-size: 3rem; right: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li { padding: 1.1rem .8rem 0; }
  .stats li:nth-child(3) { border-left: 0; padding-left: 0; }
  .about-art { max-width: 420px; margin: 0 auto; }
  .lineage-art { order: -1; max-width: 360px; }
  .creds { grid-template-columns: 1fr; }
  .journey li { grid-template-columns: 1fr; gap: .8rem; padding: 1.6rem 0; }
  .f2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cards, .who { grid-template-columns: 1fr; }
  .card { padding: 1.8rem 1.4rem; }
  .card-img { width: calc(100% + 2.8rem); margin: -1.8rem -1.4rem 1.2rem; }
  .hero-enso { width: 480px; height: 480px; left: -200px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rise { opacity: 1; transform: none; } }
