/* ==========================================================================
   Quiet Crane — Design Tokens
   ========================================================================== */
:root {
  /* Water-element palette: deep yin blues grounded by Metal (cream & gold),
     which generates Water in the five-element cycle */
  --ink:        #151c28;
  --ink-soft:   #1f2938;
  --jade:       #2b3e57;
  --jade-light: #4a6a8f;
  --rice:       #f5f0e6;
  --rice-dark:  #e9e0cd;
  --gold:       #b8935f;
  --gold-light: #d3b688;
  --seal:       #8c3a2b;
  --text-on-dark: #ece6d8;
  --text-on-dark-dim: #b3bdcc;
  --text-on-light: #24303f;
  --text-on-light-dim: #5a6473;

  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --max-width: 1180px;
  --section-pad: clamp(4rem, 9vw, 8rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-on-light);
  background: var(--rice);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, blockquote {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-pad) 1.75rem;
}

/* Every section stands a full viewport tall, like the hero, with its
   content centred vertically. min-height (not height) so a section still
   grows rather than clipping on short screens. */
.philosophy,
.aims,
.practice,
.schedule,
.about,
.contact {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.philosophy > .section-inner,
.aims > .section-inner,
.practice > .section-inner,
.schedule > .section-inner,
.about > .section-inner,
.contact > .section-inner {
  width: 100%;
}

/* Faint paper-grain texture overlay, sits above everything, ignores clicks */
.mist-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Utility / shared
   ========================================================================== */

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem 0;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(21, 28, 40, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.65rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { display: block; width: 40px; height: 40px; flex-shrink: 0; }
/* footer mark: same size as the header logo, centered */
.brand-mark.small { width: 40px; height: 40px; margin: 0 auto 1rem; }
/* header logo is a clickable trigger — subtle highlight cues that it opens */
.brand-logo-trigger {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease);
}
.brand-logo-trigger:hover,
.brand-logo-trigger:focus-visible {
  transform: scale(1.07);
  filter: drop-shadow(0 0 7px rgba(184,147,95,0.55));
  outline: none;
}
.crane-svg { width: 100%; height: 100%; }
.mark-ring { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.mark-disc { fill: var(--rice); }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-serif); font-size: 1.35rem; color: var(--text-on-dark); letter-spacing: 0.02em; }
.brand-sub {
  font-size: 0.62rem;
  text-transform: uppercase;
  /* wide tracking + centered so TAI CHI sits balanced under Quiet Crane;
     text-indent offsets the trailing letter-space so centering is optical */
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-align: center;
  color: var(--gold-light);
}

.main-nav { display: flex; gap: 2.4rem; }
.main-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s var(--ease);
}
.main-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}
.main-nav a:hover { color: var(--text-on-dark); }
.main-nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 1.5px;
  background: var(--text-on-dark);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at 50% 20%, var(--jade) 0%, var(--ink) 62%);
  overflow: hidden;
  padding: 8rem 1.5rem 4rem;
}
.hero-mist {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 20% 80%, rgba(184,147,95,0.10) 0%, transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(74,106,143,0.35) 0%, transparent 50%);
  animation: driftMist 22s ease-in-out infinite alternate;
}
@keyframes driftMist {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.06); }
}

/* full-bleed taijitu blended into the hero backdrop: the circle's edge is
   pushed past the viewport, so only the S-curve and dots read — softly */
.hero-yinyang {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.hero-yinyang svg {
  width: max(145vw, 145vh);
  height: max(145vw, 145vh);
  flex-shrink: 0;
  filter: blur(3px);
}
.yy-light     { fill: rgba(245,240,230,0.045); }
.yy-light-dot { fill: rgba(245,240,230,0.08); }
.yy-dark      { fill: rgba(0,0,0,0.13); }

.hero-content { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; }
.hero h1 {
  color: var(--rice);
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.15;
  font-weight: 500;
}
.hero-lede {
  color: var(--text-on-dark-dim);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 1.3rem auto 2.3rem;
}

.scroll-cue {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.scroll-cue span {
  display: block;
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: cueMove 2.2s ease-in-out infinite;
}
@keyframes cueMove {
  0% { opacity: 0; transform: translateY(-8px) scaleY(0.6); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px) scaleY(1); }
}

/* ==========================================================================
   Philosophy
   ========================================================================== */
.philosophy {
  background: var(--rice);
  background-image: radial-gradient(circle at 90% 10%, rgba(184,147,95,0.08), transparent 40%);
  text-align: center;
}
.tao-quote {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-style: italic;
  font-weight: 400;
  color: var(--jade);
  max-width: 760px;
  margin: 0 auto 2.5rem;
  line-height: 1.5;
}
.tao-quote cite {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 1rem;
}
.philosophy-intro {
  max-width: 620px;
  margin: 0 auto 4rem;
  color: var(--text-on-light-dim);
  font-size: 1.05rem;
}

.philosophy-intro--tight {
  margin-bottom: 0.5rem;
}

.philosophy-tagline {
  text-align: center;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  text-align: left;
}
.pillar {
  background: #fff;
  padding: 2.4rem 2rem;
  border-radius: 4px;
  border: 1px solid var(--rice-dark);
  position: relative;
}
.pillar-glyph {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.pillar h3 { font-size: 1.2rem; color: var(--jade); }
.pillar p { color: var(--text-on-light-dim); font-size: 0.95rem; margin: 0; }

/* ==========================================================================
   The Four Aims
   ========================================================================== */
.aims {
  background: var(--ink);
  color: var(--text-on-dark);
  text-align: center;
}
.aims .section-title { color: var(--rice); }
.aims-intro {
  max-width: 620px;
  margin: 1.1rem auto 2.2rem;
  color: var(--text-on-dark-dim);
  font-size: 1.05rem;
}
.aims-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}
.aim {
  position: relative;
  background: rgba(245, 240, 230, 0.03);
  border: 1px solid rgba(184, 147, 95, 0.25);
  border-radius: 4px;
  padding: 1.5rem 1.9rem;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.aim:hover { border-color: rgba(184, 147, 95, 0.55); transform: translateY(-4px); }
.aim-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.aim h3 { font-size: 1.18rem; color: var(--rice); margin-bottom: 0.45rem; }
.aim p { color: var(--text-on-dark-dim); font-size: 0.92rem; margin: 0; }
.aims-citation {
  max-width: 640px;
  margin: 2rem auto 0;
  font-size: 0.82rem;
  color: var(--text-on-dark-dim);
  line-height: 1.7;
}
.aims-citation cite { font-style: italic; }
.aims-citation a {
  color: var(--gold-light);
  border-bottom: 1px solid rgba(184, 147, 95, 0.4);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.aims-citation a:hover { color: var(--gold); border-color: var(--gold); }

/* ==========================================================================
   Practice
   ========================================================================== */
.practice {
  background: var(--jade);
  color: var(--text-on-dark);
}
.practice-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}
.practice-text h2 { color: var(--rice); font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.practice-text p { color: var(--text-on-dark-dim); }
.benefits { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.benefits li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--text-on-dark);
  font-size: 0.98rem;
}
.benefits li::before {
  content: '';
  position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 1px;
  background: var(--gold);
}

.scroll-frame {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(184,147,95,0.3);
  border-radius: 6px;
  padding: 1.75rem 1.75rem 0.5rem;
}
.scroll-frame-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(184,147,95,0.25);
  padding-bottom: 0.9rem;
}
.movement-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.movement-list li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(236,230,216,0.12);
  font-size: 0.92rem;
  color: var(--text-on-dark-dim);
}
.movement-list li:last-child { border-bottom: none; }
.movement-list li span {
  font-family: var(--font-serif);
  color: var(--gold);
  font-size: 0.85rem;
  min-width: 1.6em;
}
.movement-list li.movement-namesake { color: var(--rice); }
.movement-list li.movement-namesake em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  padding-left: 0.8em;
}
.movement-list::-webkit-scrollbar { width: 5px; }
.movement-list::-webkit-scrollbar-thumb { background: rgba(184,147,95,0.4); border-radius: 4px; }

/* ==========================================================================
   Schedule
   ========================================================================== */
.schedule { background: var(--rice); text-align: center; }
.section-title { color: var(--jade); font-size: clamp(1.8rem, 3.2vw, 2.4rem); }

.class-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  justify-content: center;
  gap: 1.75rem;
  text-align: left;
}
.class-card {
  background: #fff;
  border: 1px solid var(--rice-dark);
  border-radius: 4px;
  padding: 2rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.class-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(43,62,87,0.14);
}
.class-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.6rem; }
.class-card h3 { font-size: 1.3rem; color: var(--jade); margin: 0; }
.class-level {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 999px;
  padding: 0.25em 0.7em;
  white-space: nowrap;
}
.class-time { font-weight: 500; color: var(--text-on-light); margin-bottom: 0.2rem; }
.class-location { color: var(--gold); font-size: 0.88rem; margin-bottom: 0.4rem; }
.class-directions {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jade-light);
  border-bottom: 1px solid rgba(74,106,143,0.4);
  padding-bottom: 1px;
  margin-bottom: 1rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.class-directions:hover { color: var(--jade); border-color: var(--jade); }
.class-desc { color: var(--text-on-light-dim); font-size: 0.92rem; margin: 0; }


/* ==========================================================================
   About
   ========================================================================== */
.about {
  background: var(--jade);
  color: var(--text-on-dark);
}
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: center;
}
.about-text h2 { color: var(--rice); font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.about-text p { color: var(--text-on-dark-dim); }

.about-portrait { position: relative; }
/* circular portrait, echoing the crane seal's disc-and-ring */
.portrait-frame {
  position: relative;
  width: min(283px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(184, 147, 95, 0.5);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.portrait-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* bias the square crop upward so the face sits centered in the circle */
  object-position: center 20%;
  display: block;
}

.about-quote {
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-light);
  border-left: 2px solid var(--gold);
  padding-left: 1.2rem;
  margin: 1.8rem 0 0;
  line-height: 1.6;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { background: var(--ink); color: var(--text-on-dark); }
.contact-centered {
  display: flex;
  justify-content: center;
  text-align: center;
}
.contact-centered .contact-info { max-width: 560px; }
.contact h2 { color: var(--rice); font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.contact-lede { color: var(--text-on-dark-dim); margin-bottom: 2.2rem; }

.contact-details { display: flex; flex-direction: column; gap: 1.3rem; margin: 0; align-items: center; }
.contact-details dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.contact-details dd { margin: 0; font-size: 1.05rem; color: var(--text-on-dark); }
.contact-details a:hover { color: var(--gold-light); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  border-top: 1px solid rgba(184,147,95,0.15);
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
}
.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}
.footer-copy { color: var(--text-on-dark-dim); font-size: 0.78rem; margin: 0; }

/* ==========================================================================
   Logo lightbox
   ========================================================================== */
.logo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* hide only after the fade-out finishes */
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.logo-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* become visible immediately, so the close button can take focus */
  transition: opacity 0.4s var(--ease), visibility 0s linear 0s;
}
.logo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.82);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.logo-lightbox-figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transform: scale(0.86);
  transition: transform 0.4s var(--ease);
}
.logo-lightbox.is-open .logo-lightbox-figure { transform: scale(1); }
.logo-lightbox-mark {
  position: relative;
  width: min(340px, 72vw);
  height: min(340px, 72vw);
  filter: drop-shadow(0 22px 55px rgba(0, 0, 0, 0.55));
}
.logo-lightbox-mark .crane-svg { width: 100%; height: 100%; }
/* muted close button on the logo's upper-right */
.logo-lightbox-close {
  position: absolute;
  top: 7%;
  right: 7%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(38, 48, 63, 0.35);
  background: rgba(21, 28, 40, 0.55);
  color: rgba(245, 240, 230, 0.75);
  cursor: pointer;
  /* never `all`: that would animate the inherited `visibility`,
     leaving the button unfocusable at the moment the dialog opens */
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.logo-lightbox-close:hover,
.logo-lightbox-close:focus-visible {
  background: rgba(21, 28, 40, 0.9);
  border-color: var(--gold);
  color: var(--gold-light);
  outline: none;
}
.logo-lightbox-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
/* caption tucked inside the disc, just beneath the rock */
.logo-lightbox-caption {
  position: absolute;
  left: 50%;
  top: 85%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  text-align: center;
  line-height: 1.05;
  color: var(--jade);
  pointer-events: none;
}
.logo-lightbox-caption-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .practice-grid, .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-portrait { max-width: 340px; margin: 0 auto; }
  .pillars { grid-template-columns: 1fr; }
  .aims-grid { grid-template-columns: 1fr; max-width: 440px; }
  .class-cards { grid-template-columns: min(100%, 420px); }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: rgba(21, 28, 40, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 3rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

@media (max-width: 520px) {
  .hero { padding-top: 7rem; }
  .brand-sub { display: none; }
  .contact {
    min-height: unset;
    padding: 6rem 0 5rem;
  }
}
