:root {
  color-scheme: dark;
  --bg: #0e0e0f;
  --panel: #17181a;
  --ink: #f2f0ec;
  --muted: #9a948c;
  --line: rgba(242, 240, 236, 0.12);
  --accent: #8c1c1c;
  --accent-dark: #6b1414;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(14, 14, 15, 0.9), rgba(14, 14, 15, 0.94)),
    url("./assets/images/honbu-dojo.jpg") center/cover fixed;
  min-height: 100vh;
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.pending {
  color: var(--muted);
  font-style: italic;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

/* Nav */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 15, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav__links::-webkit-scrollbar {
  display: none;
}

.nav__links a {
  flex: 0 0 auto;
  padding: 10px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__links a.active {
  color: var(--ink);
  background: var(--accent);
}

@media (max-width: 680px) {
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
    padding: 10px 0;
  }

  .nav__links {
    flex: 1 1 100%;
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 2px;
  }

  .nav__links a {
    padding: 7px 10px;
    min-height: 38px;
    font-size: 13px;
  }
}

/* Views */
.view {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.section__inner h2 {
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 20px;
}

.section__inner h3 {
  font-size: clamp(19px, 3vw, 23px);
  margin: 28px 0 10px;
}

.subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.subnav-tab {
  padding: 9px 16px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.subnav-tab:hover {
  color: var(--ink);
}

.subnav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.section__inner .schools-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.schools-list li {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  gap: 4px;
  text-align: center;
}

.schools-list strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.schools-list .kanji {
  font-size: 17px;
}

.schools-list .translation {
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
}

.grade-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.grade-heading h3 {
  margin: 0;
}

.grade-heading img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.grade-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.grade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.grade-table th,
.grade-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.grade-table th {
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grade-table tbody tr:last-child td {
  border-bottom: none;
}

.grade-table tbody tr:hover {
  background: var(--panel);
}

.grade-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.rules-list {
  margin-top: 20px;
  padding-left: 22px;
  display: grid;
  gap: 16px;
}

.rules-list li {
  color: var(--ink);
  line-height: 1.6;
}

.rules-list li p {
  margin-top: 10px;
}

.soke-card {
  text-align: center;
}

.soke-card__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 6px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.benefits-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.benefits-card--accent {
  background: var(--accent);
  border-color: var(--accent);
}

.benefits-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.benefits-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.benefits-card li {
  color: var(--ink);
  font-size: 14px;
}

@media (max-width: 600px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

.section__inner p {
  color: var(--ink);
  line-height: 1.6;
  margin: 0 0 14px;
}

.section__inner ul {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.section__inner li {
  color: var(--ink);
  line-height: 1.5;
}

.lineage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.lineage--small {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.lineage figure {
  margin: 0;
  text-align: center;
}

.lineage img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.lineage figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lineage__photo-wrap {
  position: relative;
  display: block;
}

.lineage__badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid rgba(242, 240, 236, 0.3);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.lineage__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.lineage__trigger:hover,
.lineage__trigger:focus-visible {
  opacity: 0.85;
  transform: translateY(-2px);
}

.lineage__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}

.modal--dojo {
  padding: 0;
  overflow-y: auto;
}

.modal--dojo .dojo-card {
  border: none;
  border-radius: 0;
}

.modal--dojo .dojo-card__body {
  padding: 24px 28px 28px;
}

.modal h3 {
  margin-top: 0;
  padding-right: 40px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .modal {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .lineage {
    grid-template-columns: 1fr;
  }
}

/* Home */
.home {
  text-align: center;
  padding-top: 40px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.home__logo {
  width: 110px;
  height: 110px;
  margin-bottom: 8px;
}

.home h1 {
  font-size: clamp(32px, 6vw, 52px);
  margin: 0;
}

.home__tagline {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}

.home__highlights {
  max-width: 560px;
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.home__welcome {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.home__affiliation {
  max-width: 560px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Dojo logos + modal card (Contacto) */
.dojo-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}

.dojo-logos__item {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 120px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.dojo-logos__photo-wrap {
  position: relative;
  display: block;
}

.dojo-logos__item img {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.dojo-logos__badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid rgba(242, 240, 236, 0.3);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dojo-logos__item:hover img,
.dojo-logos__item:focus-visible img {
  transform: translateY(-3px);
  opacity: 0.85;
}

.dojo-logos__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.dojo-logos__item span {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.dojo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.dojo-card__map {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 240, 236, 0.04);
  border-bottom: 1px solid var(--line);
}

.dojo-card__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.dojo-card__map .pending {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 13px;
}

.dojo-card__body {
  padding: 20px;
}

.dojo-card h3 {
  margin: 0 0 12px;
}

.dojo-card__info {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dojo-card__info li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.dojo-card__info li.is-pending {
  color: var(--muted);
  font-style: italic;
}

.dojo-card__info .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--accent);
}

.dojo-card__info a {
  color: var(--accent);
  font-weight: 700;
}

.dojo-card__info a:hover {
  text-decoration: underline;
}

.contact-email {
  margin-top: 24px;
  text-align: center;
}

#view-contacto h2 {
  text-align: center;
}

#view-contacto .hint {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

.contact-email a {
  color: var(--accent);
  font-weight: 700;
}

.contact-email a:hover {
  text-decoration: underline;
}

/* Accordion (FAQ) */
.accordion {
  display: grid;
  gap: 10px;
}

.accordion-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.accordion-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

.accordion-panel {
  padding: 0 16px 16px;
}

@media (max-width: 720px) {
  .brand span {
    display: none;
  }
}

@media (max-width: 420px) {
  .section__inner .schools-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .subnav {
    flex-wrap: wrap;
  }
}

/* Shoji intro */
.shoji-intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  cursor: pointer;
}

.shoji-panel {
  position: relative;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background-color: #0e0e0f;
  background-size: cover;
  background-position: center;
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.shoji-panel--left {
  background-image: url("./assets/images/shoji-left.jpg");
}

.shoji-panel--right {
  background-image: url("./assets/images/shoji-right.jpg");
}

.shoji-intro.is-open .shoji-panel--left {
  transform: translateX(-100%);
}

.shoji-intro.is-open .shoji-panel--right {
  transform: translateX(100%);
}

@media (prefers-reduced-motion: reduce) {
  .shoji-panel {
    transition: none;
  }
}

/* Contact form */
.contact-form {
  max-width: 480px;
  margin: 32px auto 0;
  display: grid;
  gap: 6px;
}

.contact-form h3 {
  margin: 0 0 10px;
  text-align: center;
}

.contact-form label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form__submit {
  margin-top: 14px;
  padding: 12px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.contact-form__submit:hover {
  background: var(--accent-dark);
}

.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.contact-form__status {
  min-height: 20px;
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
}

.contact-form__status.is-error {
  color: var(--accent);
}

.contact-form__status.is-success {
  color: #4caf50;
}
