/* ============================================================
   悉尼古筝学校 — 绢本设计系统
   Palette lifted from the 敦煌国乐雅集 poster: one aged-silk
   family, monochrome by design. The only saturated hue on the
   entire site is 印泥 red, and it is spent sparingly.

   Change a colour here and it changes everywhere.
   ============================================================ */

:root {
  /* ---- silk ground, light to dark ---- */
  --silk-lt: #d8c9a8;
  --silk:    #c4b391;
  --silk-dk: #a89372;
  --earth:   #8a7355;
  --umber:   #5c4a33;
  --sumi:    #33281c;
  --rice:    #efe6d2;
  --seal:    #9c4a32;

  /* ---- hairlines, derived so they stay in family ---- */
  --line:      rgba(92, 74, 51, .22);
  --line-firm: rgba(92, 74, 51, .40);
  --line-dark: rgba(239, 230, 210, .16);

  /* ---- type ---- */
  --hei:  "Songti SC", "STSong", "SimSun", "Noto Serif SC",
          "Source Han Serif SC", Georgia, serif;
  --kai:  "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- rhythm ---- */
  --pad-x: 46px;
  --header-h: 74px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--silk);
  color: var(--sumi);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* paper grain — one fixed layer, inherited by every section */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .5;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(92,74,51,.05) 0 1px, transparent 1px),
    radial-gradient(circle at 68% 44%, rgba(92,74,51,.04) 0 1px, transparent 1px),
    radial-gradient(circle at 34% 78%, rgba(92,74,51,.05) 0 1px, transparent 1px),
    radial-gradient(circle at 88% 66%, rgba(92,74,51,.04) 0 1px, transparent 1px);
  background-size: 180px 180px, 220px 220px, 260px 260px, 200px 200px;
}
.page { position: relative; z-index: 2; }

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

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--sumi); color: var(--rice);
  padding: 10px 18px; font-family: var(--hei); font-size: 13px;
}
.skip-link:focus { left: 0; }

/* ============================================================
   HEADER — sticky, condenses on scroll, retreats when scrolling down
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
  padding: 16px var(--pad-x);
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, var(--silk-lt), var(--silk));
  transition: transform .38s var(--ease), padding .28s var(--ease),
              box-shadow .28s var(--ease), border-color .28s var(--ease),
              background .28s var(--ease);
}
.site-header.is-stuck {
  padding-top: 9px; padding-bottom: 9px;
  border-bottom-color: var(--line);
  background: rgba(216, 201, 168, .93);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  box-shadow: 0 1px 14px rgba(51, 40, 28, .10);
}
.site-header.is-hidden { transform: translateY(-102%); }

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex: none;
}
.brand-seal {
  width: 34px; height: 34px; flex: none;
  background: var(--seal); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--hei); color: var(--rice);
  font-size: 17px; font-weight: 600; line-height: 1;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.brand:hover .brand-seal {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 3px 12px rgba(156, 74, 50, .32);
}
.is-stuck .brand-seal { width: 30px; height: 30px; font-size: 15px; }

.brand-name {
  font-family: var(--hei); font-weight: 600;
  letter-spacing: .12em; font-size: 16px; color: var(--sumi);
  transition: font-size .28s var(--ease);
}
.brand-name small {
  display: block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .16em; color: var(--earth);
  font-weight: 400; margin-top: 2px;
}
.is-stuck .brand-name { font-size: 15px; }
.is-stuck .brand-name small { display: none; }

.site-nav {
  display: flex; align-items: center; gap: 28px;
  font-family: var(--hei); font-size: 13.5px;
}
.site-nav a {
  position: relative;
  color: var(--umber); text-decoration: none;
  letter-spacing: .08em; padding: 4px 0;
  transition: color .25s var(--ease);
}
/* underline grows from the left rather than simply appearing */
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--seal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .32s var(--ease);
}
.site-nav a:hover { color: var(--sumi); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.active { color: var(--sumi); }
.site-nav a.active::after {
  transform: scaleX(1); background: var(--umber);
}

.lang-switch {
  font-family: var(--mono) !important; font-size: 11px !important;
  letter-spacing: .1em; color: var(--earth) !important;
  border: 1px solid var(--line); border-radius: 2px;
  padding: 5px 11px !important;
  transition: border-color .25s var(--ease), color .25s var(--ease),
              background .25s var(--ease);
}
.lang-switch::after { display: none !important; }
.lang-switch:hover {
  color: var(--sumi) !important;
  border-color: var(--line-firm);
  background: rgba(239, 230, 210, .45);
}

/* mobile menu button — three bars that become an X */
.nav-toggle { display: none; }
.nav-icon {
  display: none; cursor: pointer;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 3px;
  padding: 11px 9px;
  flex-direction: column; justify-content: space-between;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.nav-icon:hover { border-color: var(--line-firm); background: rgba(239,230,210,.4); }
.nav-icon-bar {
  display: block; height: 1.5px; width: 100%;
  background: var(--umber); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}

/* ============================================================
   SHARED SECTION FURNITURE
   ============================================================ */
.section { padding: 72px var(--pad-x) 78px; }
.section-head { max-width: 62ch; margin: 0 0 38px; }

.page-intro { background: linear-gradient(180deg, var(--silk-lt), var(--silk)); }

.eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .24em;
  color: var(--earth); text-transform: uppercase; margin: 0 0 14px;
}
.section-head h1 {
  font-family: var(--hei); font-size: clamp(26px, 3.4vw, 38px);
  margin: 0 0 12px; font-weight: 600; letter-spacing: .14em;
  color: var(--sumi); text-wrap: balance;
}
.section-head h2 {
  font-family: var(--hei); font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 12px; font-weight: 600; letter-spacing: .14em;
  color: var(--sumi); text-wrap: balance;
}
.section-head p {
  font-size: 14.5px; line-height: 2; color: var(--umber);
  margin: 0; letter-spacing: .02em;
}
.section-head .btn { margin-top: 22px; }

/* ---- buttons ---- */
.btn {
  position: relative; overflow: hidden;
  font-family: var(--hei); font-size: 13.5px; letter-spacing: .12em;
  text-decoration: none; padding: 12px 26px; border-radius: 2px;
  display: inline-block; border: 1px solid transparent; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease),
              transform .2s var(--ease), box-shadow .3s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: var(--seal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .38s var(--ease);
  z-index: -1;
}
.btn > * { position: relative; z-index: 1; }
.btn:hover::before { transform: scaleX(1); }
.btn:active { transform: translateY(1px); }

.btn-solid {
  background: var(--sumi); color: var(--rice); border-color: var(--sumi);
  z-index: 0;
}
.btn-solid:hover { border-color: var(--seal); box-shadow: 0 5px 18px rgba(156,74,50,.25); }

.btn-line {
  background: transparent; color: var(--sumi); border-color: var(--line-firm);
  z-index: 0;
}
.btn-line:hover { color: var(--rice); border-color: var(--seal); }

/* ---- scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
/* stagger siblings so a row of cards arrives in sequence */
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }

.tag-open {
  display: inline-block; font-family: var(--hei); font-size: 10.5px;
  color: var(--rice); background: var(--seal); padding: 2px 8px;
  border-radius: 2px; letter-spacing: .08em; margin-left: 8px;
  vertical-align: 2px; white-space: nowrap;
}
.empty-note { color: var(--umber); font-size: 14px; }

/* Placeholder copy — reads as a note to whoever fills the page in,
   so nobody mistakes sample text for finished content. */
.is-placeholder p,
p.is-placeholder,
p.placeholder-note {
  color: var(--earth);
}

/* placeholder blocks, used until real photography arrives */
.portrait-slot, .poster-slot, .qr-slot, .detail-media-slot {
  background: rgba(92,74,51,.1);
  border: 1px dashed var(--line-firm);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 22px;
}
.portrait-slot span, .poster-slot span,
.qr-slot span, .detail-media-slot span {
  font-family: var(--hei); font-size: 12.5px; color: var(--earth);
  line-height: 1.9; letter-spacing: .06em;
}
code {
  font-family: var(--mono); font-size: 11px;
  background: rgba(92,74,51,.12); padding: 2px 5px;
  word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--sumi); color: var(--silk);
  padding: 54px var(--pad-x) 40px;
  position: relative; z-index: 2;
}
.footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr;
  gap: 38px; margin-bottom: 34px;
}
.site-footer h3 {
  font-family: var(--hei); font-size: 12.5px; letter-spacing: .16em;
  margin: 0 0 14px; color: var(--silk-lt); font-weight: 600;
}
.site-footer p, .site-footer a {
  font-size: 13px; line-height: 1.95; color: var(--silk-dk);
  margin: 0 0 5px; text-decoration: none; display: block; letter-spacing: .02em;
}
.site-footer a {
  width: fit-content;
  transition: color .25s var(--ease), transform .25s var(--ease);
}
.site-footer a:hover { color: var(--rice); transform: translateX(3px); }
.footer-brand {
  font-family: var(--hei); font-size: 17px; letter-spacing: .16em;
  color: var(--rice); margin-bottom: 12px; font-weight: 600;
}
.footer-bottom {
  border-top: 1px solid var(--line-dark); padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--earth); letter-spacing: .08em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  :root { --pad-x: 32px; }
  .site-nav { gap: 20px; font-size: 13px; }
}

@media (max-width: 860px) {
  :root { --pad-x: 22px; --header-h: 64px; }

  .site-header { flex-wrap: wrap; padding: 12px var(--pad-x); }
  .nav-icon { display: flex; }

  .site-nav {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 0; width: 100%; order: 3;
    max-height: 0; overflow: hidden;
    transition: max-height .38s var(--ease), margin .38s var(--ease),
                opacity .3s var(--ease);
    opacity: 0; margin-top: 0;
  }
  .nav-toggle:checked ~ .site-nav {
    max-height: 70vh; opacity: 1; margin-top: 12px;
    overflow-y: auto;
  }

  .site-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .site-nav a::after { display: none; }
  .site-nav a.active {
    color: var(--seal);
    padding-left: 12px;
    border-left: 2px solid var(--seal);
  }
  .lang-switch {
    margin-top: 14px; align-self: flex-start;
    border-bottom: 1px solid var(--line) !important;
  }

  /* burger becomes an X */
  .nav-toggle:checked ~ .nav-icon .nav-icon-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-icon .nav-icon-bar:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-icon .nav-icon-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .section { padding: 48px var(--pad-x) 54px; }
  .section-head { margin-bottom: 28px; }

  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .site-footer { padding: 40px var(--pad-x) 32px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 460px) {
  :root { --pad-x: 18px; }
  .brand-name { font-size: 15px; }
  .brand-name small { font-size: 8.5px; letter-spacing: .12em; }
  .btn { padding: 11px 20px; font-size: 13px; }
}

/* Larger touch targets on touch devices. */
@media (hover: none) {
  .site-nav a { padding-top: 15px; padding-bottom: 15px; }
  .btn { padding-top: 14px; padding-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
