/* ============================================
   JKS INDIA — SHAOLIN ACADEMY
   Design system & shared styles
   ============================================ */

:root {
  --ink: #1a1a18;
  --ivory: #f5f1e8;
  --ivory-warm: #ede7d6;
  --paper: #fbf9f3;
  --rust: #8b3a1d;
  --rust-dark: #5e2611;
  --muted: #6b6963;
  --line: rgba(26, 26, 24, 0.12);
  --line-strong: rgba(26, 26, 24, 0.25);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-jp: 'Noto Serif JP', serif;

  --container: 1180px;
  --gutter: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: clamp(22px, 2.5vw, 28px); }
h4 { font-size: 18px; font-family: var(--font-body); font-weight: 500; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 56ch;
}

.kanji {
  font-family: var(--font-jp);
  font-weight: 400;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: 96px 0; }
section.tight { padding: 64px 0; }

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ============================================
   NAVBAR
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 249, 243, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp);
  font-size: 18px;
}
.brand-text { line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  font-size: 14px;
  color: var(--ink);
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--rust); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--rust);
}
.nav-cta {
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--ink); color: var(--ivory); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--ink);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-primary {
  background: var(--ink);
  color: var(--ivory);
}
.btn-primary:hover { background: var(--rust-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-light {
  background: var(--ivory);
  color: var(--ink);
}
.btn-light:hover { background: white; }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 80px 0 96px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-title {
  margin: 24px 0;
  letter-spacing: -0.02em;
}
.hero-title .accent { color: var(--rust); font-style: italic; }
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.hero-quote-card {
  background: var(--ink);
  color: var(--ivory);
  border-radius: 4px;
  padding: 40px 36px;
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.hero-quote-card .kanji-bg {
  font-size: 120px;
  line-height: 1;
  opacity: 0.08;
  align-self: flex-start;
}
.hero-quote-card .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.hero-quote-card .attribution {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ============================================
   CREDENTIAL STRIP
   ============================================ */
.credential-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ivory);
}
.credential-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.credential-item {
  padding: 30px var(--gutter);
  border-right: 1px solid var(--line);
}
.credential-item:last-child { border-right: none; }
.credential-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}
.credential-num sup { font-size: 14px; vertical-align: top; color: var(--muted); }
.credential-label {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-head {
  margin-bottom: 56px;
  max-width: 720px;
}
.section-head .eyebrow { margin-bottom: 12px; }
.section-head h2 { margin-bottom: 16px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ============================================
   PROFILE BLOCK (chairman/director)
   ============================================ */
.profile {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: center;
}
.profile.reverse { grid-template-columns: 1.4fr 1fr; }
.profile.reverse .profile-image { order: 2; }

.profile-image {
  background: var(--ivory-warm);
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.profile-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.profile-image .kanji-overlay {
  font-size: 120px;
  color: var(--ink);
  line-height: 1;
}
.profile-image .corner-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-content .eyebrow { margin-bottom: 14px; }
.profile-content h2 { margin-bottom: 8px; }
.profile-alias {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 15px;
}
.profile-content p { margin-bottom: 16px; color: var(--muted); line-height: 1.75; }
.profile-content p:last-of-type { margin-bottom: 24px; }
.credential-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.pill {
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ivory-warm);
  color: var(--rust-dark);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pill.dark { background: var(--ink); color: var(--ivory); }

/* ============================================
   LINEAGE FLOW
   ============================================ */
.lineage-section { background: var(--ivory); }
.lineage-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}
.lineage-node {
  text-align: center;
  padding: 22px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.lineage-node.current {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}
.lineage-name {
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: 4px;
}
.lineage-role {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.lineage-node.current .lineage-role { opacity: 0.65; color: var(--ivory); }
.lineage-arrow {
  color: var(--muted);
  font-size: 20px;
}

/* ============================================
   PROGRAM CARDS
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.program-card {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: all 0.25s;
}
.program-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.program-card .icon {
  font-size: 26px;
  color: var(--rust);
  margin-bottom: 18px;
  display: block;
}
.program-card h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}
.program-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ============================================
   PHILOSOPHY / EDITORIAL
   ============================================ */
.editorial {
  background: var(--ink);
  color: var(--ivory);
}
.editorial .container { padding-top: 24px; padding-bottom: 24px; }
.editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: center;
}
.editorial h2 { color: var(--ivory); }
.editorial .eyebrow { color: rgba(245, 241, 232, 0.6); }
.editorial p { color: rgba(245, 241, 232, 0.75); margin-bottom: 16px; }
.virtue-list {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}
.virtue {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(245, 241, 232, 0.12);
}
.virtue:last-child { border-bottom: none; }
.virtue-jp {
  font-family: var(--font-jp);
  font-size: 26px;
  color: var(--ivory);
}
.virtue-en strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
  display: block;
  margin-bottom: 2px;
}
.virtue-en span { font-size: 13px; color: rgba(245, 241, 232, 0.6); }

/* ============================================
   CTA BAR
   ============================================ */
.cta-bar {
  background: var(--ink);
  color: var(--ivory);
  padding: 56px 0;
}
.cta-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-text h2 {
  color: var(--ivory);
  font-size: 32px;
  margin-bottom: 6px;
}
.cta-text p {
  font-size: 14px;
  opacity: 0.7;
  margin: 0;
}

/* ============================================
   BRANCH / LOCATION CARDS
   ============================================ */
.branch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.branch-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  align-items: center;
}
.branch-card.hq { border-color: var(--rust); border-width: 1px; position: relative; }
.branch-card.hq::before {
  content: 'HEADQUARTERS';
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--rust);
  color: var(--ivory);
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  border-radius: 2px;
}
.branch-image {
  background: var(--ivory-warm);
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp);
  font-size: 64px;
  color: var(--rust);
}
.branch-info h3 { margin-bottom: 6px; font-family: var(--font-display); font-size: 26px; }
.branch-location {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.branch-info p { color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.branch-link {
  font-size: 13px;
  color: var(--rust);
  font-weight: 500;
  border-bottom: 1px solid var(--rust);
  padding-bottom: 2px;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
}
.contact-info p { color: var(--muted); margin-bottom: 24px; }
.contact-list { list-style: none; display: grid; gap: 18px; }
.contact-list li { display: flex; align-items: flex-start; gap: 14px; }
.contact-list i { color: var(--rust); font-size: 20px; margin-top: 2px; }
.contact-list strong { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; letter-spacing: 0.05em; }
.contact-list span { font-size: 16px; }

form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input, textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: border-color 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}
textarea { resize: vertical; min-height: 120px; }

/* ============================================
   PAGE HEADER (for inner pages)
   ============================================ */
.page-header {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--line);
}
.page-header .eyebrow { margin-bottom: 18px; }
.page-header h1 {
  font-size: clamp(36px, 5vw, 60px);
  margin-bottom: 18px;
}
.page-header .lead { font-size: 18px; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--ink);
  color: var(--ivory);
  padding: 64px 0 32px;
}
.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(245, 241, 232, 0.65);
  max-width: 280px;
  line-height: 1.7;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.5);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: rgba(245, 241, 232, 0.85);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--ivory); }
.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 0;
  border-top: 1px solid rgba(245, 241, 232, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.5);
  flex-wrap: wrap;
  gap: 12px;
}
.social { display: flex; gap: 14px; }
.social a {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(245, 241, 232, 0.2);
  border-radius: 50%;
  color: rgba(245, 241, 232, 0.7);
  transition: all 0.2s;
}
.social a:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 880px) {
  :root { --gutter: 20px; }
  section { padding: 64px 0; }

  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 20px var(--gutter);
    gap: 18px;
  }

  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-quote-card { aspect-ratio: auto; padding: 32px 28px; }
  .hero-quote-card .kanji-bg { font-size: 80px; }

  .credential-grid { grid-template-columns: repeat(2, 1fr); }
  .credential-item:nth-child(2) { border-right: none; }
  .credential-item:nth-child(1), .credential-item:nth-child(2) { border-bottom: 1px solid var(--line); }

  .profile, .profile.reverse { grid-template-columns: 1fr; gap: 32px; }
  .profile.reverse .profile-image { order: 0; }
  .profile-image { aspect-ratio: 4 / 5; max-width: 320px; }

  .lineage-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .lineage-arrow { transform: rotate(90deg); justify-self: center; }

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

  .editorial-grid { grid-template-columns: 1fr; gap: 36px; }

  .cta-inner { justify-content: flex-start; }

  .branch-card { grid-template-columns: 1fr; }
  .branch-image { max-width: 280px; }

  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .form-row { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .credential-grid { grid-template-columns: 1fr; }
  .credential-item { border-right: none; border-bottom: 1px solid var(--line); }
  .credential-item:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero > .container > .hero-grid > * { animation: fadeUp 0.8s ease both; }
.hero-grid > *:nth-child(2) { animation-delay: 0.15s; }
