:root {
  color-scheme: light dark;
  --bg-page: #faf8f5;
  --bg-card: #ffffff;
  --bg-header-emblem: rgba(255, 255, 255, 0.85);
  --bg-kanji-badge: #fef2f2;
  --bg-kanji-pill: #f5f5f4;
  --border-subtle: #e7e2da;
  --border-divider: #d6d3d1;
  --text-primary: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #57534e;
  --accent: #b91c1c;
  --accent-hover: #991b1b;
  --accent-underline: #fca5a5;
  --cta-bg: #1c1917;
  --cta-box-bg: rgba(41, 37, 36, 0.9);
  --cta-border: #292524;
  --cta-box-border: #44403c;
  --cta-text: #d6d3d1;
  --cta-accent: #f87171;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.12);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #141210;
    --bg-card: #1c1917;
    --bg-header-emblem: rgba(28, 25, 23, 0.85);
    --bg-kanji-badge: rgba(127, 29, 29, 0.28);
    --bg-kanji-pill: #292524;
    --border-subtle: #292524;
    --border-divider: #44403c;
    --text-primary: #f5f5f4;
    --text-secondary: #d6d3d1;
    --text-muted: #a8a29e;
    --accent: #f87171;
    --accent-hover: #fca5a5;
    --accent-underline: rgba(248, 113, 113, 0.45);
    --cta-bg: #1c1917;
    --cta-box-bg: rgba(20, 18, 16, 0.9);
    --cta-border: #292524;
    --cta-box-border: #44403c;
    --cta-text: #d6d3d1;
    --cta-accent: #f87171;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  }
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection {
  background-color: #b91c1c;
  color: #ffffff;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-underline);
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout Container */
.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

@media (min-width: 640px) {
  .container {
    padding: 4rem 2rem 5rem;
  }
}

/* Header & Emblem */
.site-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .site-header {
    margin-bottom: 4rem;
  }
}

.emblem-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  background-color: var(--bg-header-emblem);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

#logo {
  width: 5rem;
  height: 5rem;
  display: block;
}

@media (min-width: 640px) {
  #logo {
    width: 6rem;
    height: 6rem;
  }
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .site-title {
    font-size: 3rem;
  }
}

.site-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .site-subtitle {
    font-size: 1.25rem;
  }
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.divider-line {
  height: 1px;
  width: 3rem;
  background-color: var(--border-divider);
}

.divider-diamond {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--accent);
  transform: rotate(45deg);
}

/* Main Sections */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 640px) {
  .main-content {
    gap: 3.5rem;
  }
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.875rem;
  }
}

.lead-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .lead-text {
    font-size: 1.125rem;
  }
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .card {
    padding: 2.25rem;
  }
}

/* Three Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-top: 0.25rem;
}

@media (min-width: 640px) {
  .pillars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pillar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.kanji-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  background-color: var(--bg-kanji-badge);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
}

.pillar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.pillar-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* History Card */
.history-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .history-card {
    padding: 2rem;
  }
}

.history-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .history-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.history-dojo-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kanji-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  border-radius: 9999px;
  background-color: var(--bg-kanji-pill);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.375rem;
  letter-spacing: 0.12em;
  align-self: flex-start;
}

@media (min-width: 640px) {
  .kanji-pill {
    align-self: auto;
  }
}

.history-quote {
  border-left: 2px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0.25rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.history-quote strong {
  font-style: normal;
}

/* Practical Info Card */
.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.info-row {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row + .info-row {
  border-top: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .info-row {
    padding: 1.5rem;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

.info-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .info-label {
    width: 8rem;
  }
}

.info-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Call to Action Card */
.cta-card {
  background-color: var(--cta-bg);
  color: #f5f5f4;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cta-border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .cta-card {
    padding: 2.25rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cta-text-group {
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cta-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

@media (min-width: 640px) {
  .cta-title {
    font-size: 1.875rem;
  }
}

.cta-desc {
  font-size: 1rem;
  color: var(--cta-text);
  line-height: 1.6;
}

.cta-contact-box {
  flex-shrink: 0;
  background-color: var(--cta-box-bg);
  border: 1px solid var(--cta-box-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.cta-contact-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a8a29e;
  margin-bottom: 0.25rem;
}

/* Preserved Email Obfuscation Mechanism */
.email {
  white-space: nowrap;
  font-weight: 500;
  color: var(--cta-accent);
  font-size: 1rem;
  user-select: none;
  -webkit-user-select: none;
}

.email > span:nth-child(3) {
  display: none;
}
