:root {
  color-scheme: light;
  --ink: #0d0d0d;
  --muted: #6b5b45;
  --paper: #f4f1e6;
  --panel: #fbf8ef;
  --white: #ffffff;
  --line: #d7c9ac;
  --red: #a41e22;
  --red-deep: #7c171a;
  --gold: #c59b2e;
  --green: #2c3328;
  --blue: #282521;
  --brown: #6b5b45;
  --success: #286443;
  --warning: #8a5a14;
  --error: #a41e22;
  --heading-font: "Trajan Pro", "Cinzel", "Times New Roman", Georgia, serif;
  --body-font: Lato, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 20px 50px rgba(13, 13, 13, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(244, 241, 230, 0.96), rgba(244, 241, 230, 0.96)),
    repeating-linear-gradient(45deg, rgba(13, 13, 13, 0.035) 0 1px, transparent 1px 18px);
  color: var(--ink);
  font-family: var(--body-font);
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(200px, 320px) 1fr;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 12px max(20px, calc((100vw - 1200px) / 2));
  border-bottom: 1px solid rgba(197, 155, 46, 0.38);
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(14px);
}

.brand,
.navlinks,
.action-row,
.site-footer nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(197, 155, 46, 0.68);
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand strong,
h1,
h2,
h3 {
  font-family: var(--heading-font);
  font-weight: 500;
}

.search-box {
  display: grid;
  gap: 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input,
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fffdf7;
  color: var(--ink);
  outline: 0;
}

.navlinks {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px;
}

.navlinks a,
.link-button {
  min-height: 36px;
  border: 0;
  padding: 8px 9px;
  background: transparent;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 850;
}

.navlinks a:hover,
.link-button:hover,
.text-action:hover {
  color: var(--gold);
}

.hero {
  min-height: calc(100vh - 220px);
  display: grid;
  align-items: center;
  padding: 42px max(20px, calc((100vw - 1200px) / 2));
  background:
    linear-gradient(90deg, rgba(13, 13, 13, 0.92), rgba(13, 13, 13, 0.66) 48%, rgba(13, 13, 13, 0.12)),
    url("/assets/dojo-hero-branded.jpg") center / cover no-repeat;
}

.hero-copy {
  max-width: 820px;
  color: var(--panel);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.3rem);
  line-height: 0.96;
  max-width: 980px;
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 250, 242, 0.9);
  font-size: 1.18rem;
  line-height: 1.6;
}

.action-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.action-row .primary-action {
  width: auto;
}

.primary-action,
.secondary-action,
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  padding: 12px 18px;
  color: inherit;
  text-decoration: none;
  font-weight: 950;
}

.primary-action {
  width: 100%;
  background: var(--gold);
  color: var(--ink);
  border-color: #d8b754;
}

.primary-action.inline,
.secondary-action.inline {
  width: auto;
}

.secondary-action {
  background: var(--panel);
  border-color: var(--gold);
  color: var(--red-deep);
}

.text-action {
  min-height: 0;
  padding: 0;
  color: var(--red);
  text-decoration: underline;
}

.content-band,
.member-panel,
.login-panel,
.dashboard,
.profile-band,
.search-results,
.kata-viewer,
.seo-page-detail,
.final-cta {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.content-band,
.member-panel,
.dashboard,
.profile-band,
.search-results,
.kata-viewer,
.seo-page-detail {
  padding-top: 76px;
}

.seo-page-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 30px;
  align-items: start;
  padding-bottom: 6px;
}

.seo-page-detail h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.1rem);
  line-height: 0.98;
}

.seo-page-detail p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.seo-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seo-card-grid article {
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--panel);
}

.seo-card-grid h3 {
  margin: 0;
  font-size: 1.28rem;
}

.seo-card-grid p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.48;
}

.intro-grid,
.feature-split,
.training-support,
.member-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.content-band h2,
.member-panel h2,
.dashboard h2,
.profile-band h2,
.final-cta h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.copy-stack p,
.section-head p,
.feature-split p,
.training-support p,
.benefit-list,
.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.7fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head.compact {
  grid-template-columns: 1fr auto;
}

.kata-grid,
.product-grid,
.card-grid,
.admin-grid,
.dashboard-grid,
.plan-grid {
  display: grid;
  gap: 14px;
}

.kata-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kata-card,
.product-card,
.card-grid article,
.plan-grid article,
.dashboard-card,
.benefit-list,
.form-panel,
.admin-card,
.search-result {
  border: 1px solid var(--line);
  background: var(--panel);
}

.kata-card,
.product-card,
.card-grid article,
.plan-grid article,
.dashboard-card,
.benefit-list,
.admin-card,
.search-result {
  padding: 18px;
}

.kata-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.kata-card h3,
.product-card h3,
.card-grid h3,
.dashboard-card h3,
.plan-grid h3,
.benefit-list h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.08;
}

.kata-card p,
.product-card p,
.card-grid p,
.dashboard-card p,
.plan-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.access-label,
.status-pill,
.count,
.step-index,
.plan-grid span,
.admin-card span {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kata-card button {
  width: 100%;
}

.viewer-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 320px;
  min-height: 620px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.viewer-list {
  border-right: 1px solid var(--line);
  background: #eee2d1;
  padding: 12px;
}

.viewer-list button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 850;
}

.viewer-list button.is-active {
  background: var(--ink);
  color: var(--panel);
}

.stage-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px;
}

.viewer-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.viewer-top h2,
.detail-panel h3 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.status-pill {
  height: fit-content;
  min-width: 140px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--green);
  text-align: center;
}

.stage-wrap {
  display: grid;
  place-items: center;
  min-height: 390px;
}

.embusen {
  width: min(100%, 680px);
  height: auto;
}

.mat {
  fill: #f2e6d6;
  stroke: #d8c5ae;
  stroke-width: 2;
}

.kata-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-dot {
  fill: var(--panel);
  stroke: var(--red);
  stroke-width: 5;
}

.step-dot.is-current {
  fill: var(--red);
  stroke: var(--gold);
}

.karateka {
  transition: transform 320ms ease;
}

.head,
.body {
  fill: var(--white);
  stroke: var(--ink);
  stroke-width: 2;
}

.arm,
.leg {
  stroke: var(--white);
  stroke-linecap: round;
  stroke-width: 14;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.icon-btn,
.play-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-weight: 950;
}

.icon-btn {
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.play-btn {
  min-width: 110px;
}

.detail-panel {
  border-left: 1px solid var(--line);
  padding: 22px;
  background: linear-gradient(180deg, rgba(155, 47, 33, 0.08), rgba(155, 47, 33, 0)), var(--panel);
}

#step-text {
  color: var(--muted);
  line-height: 1.56;
}

.kata-facts {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
}

.kata-facts div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.kata-facts dt {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kata-facts dd {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.kata-reference {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.kata-reference .section-head {
  margin-bottom: 18px;
}

.kata-reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.kata-reference-card {
  border: 1px solid var(--line);
  background: var(--white);
}

.kata-reference-card figure {
  margin: 0;
}

.kata-reference-card img {
  display: block;
  width: 100%;
  aspect-ratio: 510 / 725;
  object-fit: contain;
  background: #f8f3eb;
  border-bottom: 1px solid var(--line);
}

.kata-reference-card figcaption {
  display: grid;
  gap: 6px;
  padding: 12px 14px 14px;
}

.kata-reference-card figcaption span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kata-reference-card figcaption p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.plan-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-grid,
.card-grid,
.admin-grid,
.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-card {
  min-height: 278px;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  height: 132px;
  margin-bottom: 16px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 950;
}

.training-support article {
  border-top: 3px solid var(--red);
  padding-top: 20px;
}

.member-panel {
  padding-bottom: 6px;
}

.form-panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.full-field {
  grid-column: 1 / -1;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.form-message,
.save-state {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 850;
}

.success {
  color: var(--success);
}

.warning {
  color: var(--warning);
}

.error {
  color: var(--error);
}

.benefit-list ul {
  margin: 14px 0 0;
  padding-left: 20px;
  line-height: 1.7;
}

.login-panel {
  padding-top: 34px;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
}

.reset-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 0.9fr) minmax(180px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.dashboard-card {
  min-height: 160px;
}

.dashboard-card strong,
.admin-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.search-result {
  display: grid;
  gap: 6px;
}

.search-result button {
  width: fit-content;
}

.admin-console {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.admin-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-panel-head h3 {
  margin: 0;
  font-size: 1.7rem;
}

.admin-filter {
  min-width: 210px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(197, 155, 46, 0.44);
  padding: 4px 9px;
  background: rgba(197, 155, 46, 0.14);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-create-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.admin-create-form h3 {
  margin: 0;
  font-size: 1.45rem;
}

.content-manager {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
  gap: 16px;
}

.content-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
}

.content-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fffdf7;
  color: var(--ink);
  text-align: left;
}

.content-list button.is-active {
  border-color: var(--gold);
  background: rgba(197, 155, 46, 0.16);
}

.content-list strong,
.content-list small {
  display: block;
}

.content-list small {
  color: var(--muted);
}

.content-editor {
  border: 1px solid var(--line);
  padding: 16px;
  background: #fffdf7;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.danger-action {
  border-color: rgba(164, 30, 34, 0.44);
  color: var(--red);
}

.final-cta {
  margin-top: 82px;
  margin-bottom: 82px;
  padding: 52px;
  background:
    linear-gradient(rgba(13, 13, 13, 0.88), rgba(13, 13, 13, 0.88)),
    url("/assets/dojo-hero-branded.jpg") center / cover no-repeat;
  color: var(--panel);
  text-align: center;
}

.final-cta h2,
.final-cta p {
  margin-left: auto;
  margin-right: auto;
}

.final-cta p:not(.eyebrow) {
  max-width: 640px;
  color: rgba(255, 250, 242, 0.86);
  line-height: 1.56;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px max(20px, calc((100vw - 1200px) / 2)) 36px;
  color: var(--muted);
}

.site-footer nav {
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.site-footer a {
  text-decoration: none;
  font-weight: 850;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(189, 148, 82, 0.7);
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .navlinks {
    justify-content: flex-start;
  }

  .intro-grid,
  .feature-split,
  .training-support,
  .member-grid,
  .seo-page-detail,
  .section-head {
    grid-template-columns: 1fr;
  }

  .kata-grid,
  .product-grid,
  .card-grid,
  .admin-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .login-form,
  .reset-form {
    grid-template-columns: 1fr 1fr;
  }

  .content-manager {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header {
    position: static;
    padding: 14px;
  }

  .hero {
    min-height: auto;
    padding: 34px 14px 38px;
    background:
      linear-gradient(180deg, rgba(13, 13, 13, 0.86), rgba(13, 13, 13, 0.56), rgba(13, 13, 13, 0.28)),
      url("/assets/dojo-hero-branded.jpg") 58% center / cover no-repeat;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

  .content-band,
  .member-panel,
  .login-panel,
  .dashboard,
  .profile-band,
  .search-results,
  .kata-viewer,
  .final-cta {
    width: min(100% - 28px, 1200px);
  }

  .kata-grid,
  .product-grid,
  .card-grid,
  .admin-grid,
  .dashboard-grid,
  .plan-grid,
  .seo-card-grid,
  .field-grid,
  .login-form,
  .reset-form {
    grid-template-columns: 1fr;
  }

  .admin-panel-head {
    display: grid;
    align-items: start;
  }

  .admin-filter {
    min-width: 0;
  }

  .viewer-shell {
    grid-template-columns: 1fr;
  }

  .viewer-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewer-list div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .viewer-list button {
    min-height: 46px;
    padding: 9px;
  }

  .stage-panel,
  .detail-panel,
  .form-panel {
    padding: 16px;
  }

  .stage-wrap {
    min-height: 290px;
  }

  .viewer-top {
    display: grid;
  }

  .status-pill {
    width: fit-content;
  }

  .kata-reference {
    padding: 16px;
  }

  .final-cta {
    padding: 36px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
