@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;600;700&family=Noto+Serif+JP:wght@500;700&display=swap");

:root {
  --brand: #1e40af;
  --brand-600: #2563eb;
  --ink: #0f172a;
  --muted: #334155;
  --surface: #ffffff;
  --ring: #e2e8f0;
  --bg-subtle: #f8fafc;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --surface: #1e293b;
    --ring: #334155;
    --bg-subtle: #0f172a;
  }
}

/* Typography */
body {
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Arial, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  color: var(--ink);
  background-color: var(--surface);
}
.jp { word-break: keep-all; line-break: strict; hyphens: none; }
.pretty { text-wrap: pretty; }
.heading-serif { font-family: "Noto Serif JP", serif; }
.heading-balance { text-wrap: balance; }
.nowrap { white-space: nowrap; }

/* Layout helpers */
.container {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background-color: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid #334155;
  }
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.site-header .nav a {
  text-decoration: none;
  color: #334155;
  padding: .5rem .75rem;
}
@media (prefers-color-scheme: dark) {
  .site-header .nav a {
    color: #94a3b8;
  }
}
.site-header .nav a:hover { color: var(--brand-600); }

/* Page hero */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0a2472 100%);
  color: white;
}
.page-hero .inner { padding: 3rem 0; }
.page-hero h1 { font-size: 1.75rem; font-weight: 700; }
.page-hero p { margin-top: .5rem; color: #c7d2fe; font-size: .95rem; }

/* Card container */
.content-card {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
  border: 1px solid var(--ring);
  padding: 2rem;
}
.section-wrap { background: #f1f5f9; padding: 3rem 0; }
@media (prefers-color-scheme: dark) {
  .section-wrap { background: #0f172a; }
}

/* Definition list layout */
.dl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem 1rem;
}
.dl-grid .row { display: flex; justify-content: space-between; gap: 1.5rem; }
.dl-grid dt { color: #64748b; }
@media (prefers-color-scheme: dark) {
  .dl-grid dt { color: #94a3b8; }
}
.dl-grid dd { font-weight: 500; }
@media (min-width: 640px) {
  .dl-grid { grid-template-columns: 1fr; }
}

/* Section headings */
.h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  .site-footer {
    border-top: 1px solid #334155;
  }
}
.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .9rem;
  color: #6b7280;
  padding: 2rem 0;
}
@media (prefers-color-scheme: dark) {
  .site-footer .inner {
    color: #94a3b8;
  }
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #374151; }
@media (prefers-color-scheme: dark) {
  .site-footer a:hover { color: #f1f5f9; }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .fixed,
  button,
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
  
  .content-card {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }
  
  .dl-grid .row {
    page-break-inside: avoid;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
  
  .page-hero {
    background: #f0f0f0 !important;
    color: #000 !important;
  }
}

/* ====== v3.0: Section rhythm & clean spacing ====== */
:root { --space-section: 4rem; }
@media (max-width: 640px){ :root { --space-section: 3rem; } }
.section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.section-compact { padding-top: calc(var(--space-section)/2); padding-bottom: calc(var(--space-section)/2); }
#about + #promise { margin-top: calc(var(--space-section)/2); }
#promise .card { background:#fff; border-radius:1rem; box-shadow:0 1px 2px rgba(0,0,0,.04); border:1px solid var(--ring); padding:1.5rem; }
/* Ensure cards and grids never overflow */
.min-w-0 { min-width: 0; }


/* ====== v3.1: Polish spacing & cards ====== */
:root{ --space-section: 4rem; }
@media (max-width: 640px){ :root{ --space-section: 3rem; } }

.section{ padding-top: var(--space-section); padding-bottom: var(--space-section); }
.section-compact{ padding-top: calc(var(--space-section)/2); padding-bottom: calc(var(--space-section)/2); }

/* about + promise grouping */
#about + #promise{ margin-top: 0.75rem; }
#promise .grid{ align-items: stretch; }
#promise .card{ height: 100%; }

/* universal card helper (opt-in) */
.u-card{
  background:#fff;
  border-radius:1rem;
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  border:1px solid var(--ring);
}

/* tighten hero/section rhythm a bit */
.page-hero .inner{ padding: 2.5rem 0; }
@media (min-width: 640px){
  .page-hero .inner{ padding: 3rem 0; }
}

/* table spacing tweaks */
.table-cell-wrap th, .table-cell-wrap td{ padding-top: .9rem; padding-bottom: .9rem; }


/* ====== v3.2: Restore card look & lighten promise background ====== */
#promise{ background-color: #f8fafc; } /* lighter than previous slate-50/60 */
.card, .u-card{
  background:#ffffff;
  border-radius:1rem;
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  border:1px solid var(--ring);
}
#promise .card{ height: 100%; }


/* ====== v3.3: Force card visuals & promise bg (specific) ====== */
section#promise{ background-color:#f8fafc !important; }
.u-card{
  background:#fff !important;
  border-radius:1rem !important;
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02) !important;
  border:1px solid var(--ring) !important;
}


/* ====== v3.4: Explicit u-card border color & fallback */ 
:root{ --ring: #e5e7eb; }  /* fallback if not present */
.u-card{
  background:#fff !important;
  border-radius:1rem !important;
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02) !important;
  border:1px solid #e5e7eb !important;
}
section#promise{ background-color:#f8fafc !important; }
