/* Memocampus Official Site — Static, Zero-Tracking, Local-First Stylesheet */

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #161e2e;
  --text-muted: #4b5563;
  --border: #dce3ec;
  --border-strong: #c2cddb;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --warn-bg: #fffbeb;
  --warn-border: #f59e0b;
  --warn-text: #78350f;
  --info-bg: #f0f9ff;
  --info-border: #0284c7;
  --info-text: #0c4a6e;
  --code-bg: #eef2f7;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --radius: 8px;
  --radius-sm: 5px;
  --max-width: 920px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141d;
    --surface: #161d29;
    --surface-subtle: #1d2636;
    --text: #e6edf5;
    --text-muted: #9aa7b8;
    --border: #2a3548;
    --border-strong: #3b4a63;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #17253d;
    --accent-border: #25406b;
    --warn-bg: #292011;
    --warn-border: #d97706;
    --warn-text: #fde68a;
    --info-bg: #112233;
    --info-border: #38bdf8;
    --info-text: #bae6fd;
    --code-bg: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  }
}

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

html {
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  overflow-wrap: break-word;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #ffffff;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  border-radius: var(--radius-sm);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--code-bg);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  word-break: break-word;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

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

.brand-logo {
  display: block;
  height: 26px;
  width: auto;
  max-width: 100%;
}

.brand-version {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  font-size: 0.92rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.2rem 0.1rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-nav a.lang-switch {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
}

.site-nav a.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Main Content */
main {
  padding: 2.25rem 0 3.5rem;
}

/* Hero */
.hero {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.status-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  margin-bottom: 1rem;
}

.hero-copy {
  margin: 0 0 1rem;
  max-width: 460px;
}

.hero-copy img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .hero-copy {
    background-color: #ffffff;
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-sm);
    max-width: calc(460px + 2.3rem);
  }
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-note {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hero-visual {
  margin: 1.5rem 0 0;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.hero-visual figcaption {
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #0b1220;
  }
  .btn-primary:hover {
    color: #0b1220;
  }
}

/* Sections & Cards */
.section {
  margin-bottom: 2.25rem;
  scroll-margin-top: 5rem;
}

.section h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.section h3 {
  font-size: 1.06rem;
  line-height: 1.4;
  margin: 1.25rem 0 0.45rem;
}

.section p {
  margin: 0 0 0.9rem;
}

.section ul,
.section ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.section li {
  margin-bottom: 0.4rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

/* Callouts */
.callout {
  border-left: 4px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  padding: 0.95rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0 1.25rem;
}

.callout-warn {
  border-left-color: var(--warn-border);
  background-color: var(--warn-bg);
  color: var(--warn-text);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: inherit;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--surface-subtle);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

/* Definition / Meta Lists */
.meta-list {
  display: grid;
  grid-template-columns: minmax(140px, 210px) 1fr;
  gap: 0.5rem 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin: 1rem 0;
}

.meta-list dt {
  font-weight: 600;
  color: var(--text-muted);
}

.meta-list dd {
  margin: 0;
}

.meta-list ul {
  margin: 0;
  padding-left: 1.2rem;
}

.meta-list li {
  margin-bottom: 0.2rem;
}

.meta-list li:last-child {
  margin-bottom: 0;
}

/* Policy Page Specifics */
.doc-header {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.doc-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  line-height: 1.3;
}

.doc-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.35rem;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.92rem;
}

.toc li {
  margin-bottom: 0.3rem;
  break-inside: avoid;
}

.policy-article section {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 5rem;
}

.policy-article h2 {
  font-size: 1.22rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.policy-article h3 {
  font-size: 1rem;
  margin: 1.15rem 0 0.4rem;
}

.policy-article p {
  margin: 0 0 0.85rem;
}

.policy-article p:last-child,
.policy-article ul:last-child,
.policy-article ol:last-child {
  margin-bottom: 0;
}

.policy-article ul,
.policy-article ol {
  margin: 0 0 0.9rem;
  padding-left: 1.4rem;
}

.policy-article li {
  margin-bottom: 0.35rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding: 1.75rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 680px) {
  .container {
    padding: 0 1rem;
  }

  .brand-logo {
    height: 22px;
  }

  .hero-copy {
    max-width: 360px;
  }

  .hero {
    padding: 1.4rem 1.15rem;
  }

  .doc-header,
  .policy-article section {
    padding: 1.2rem 1.05rem;
  }

  .toc ol {
    columns: 1;
  }

  .meta-list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .meta-list dt {
    margin-top: 0.55rem;
  }

  .meta-list dt:first-child {
    margin-top: 0;
  }

  th {
    white-space: normal;
  }
}
