@charset "UTF-8";

/* ==========================================================================
   はたらきろく / Hatara Kiroku — 公式サイト共通スタイル

   - 外部 CDN / Web フォント / JavaScript に依存しない
   - モバイルファースト
   - prefers-color-scheme と prefers-reduced-motion を尊重
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-subtle: #f4f7f5;
  --surface: #ffffff;
  --surface-alt: #f4f7f5;
  --text: #1b2320;
  --text-muted: #4f5d57;
  --border: #dde4e0;
  --border-strong: #c3cec8;

  --brand: #157a4f;
  --brand-strong: #0f5c3b;
  --brand-tint: #e9f3ee;
  --brand-contrast: #ffffff;

  --focus: #0b5cd5;

  --radius: 10px;
  --radius-lg: 14px;

  --measure: 40rem;
  --page-max: 60rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic Medium", "Yu Gothic", "Noto Sans JP", "Segoe UI", Roboto, Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614;
    --bg-subtle: #171e1b;
    --surface: #1a2220;
    --surface-alt: #202927;
    --text: #e7edea;
    --text-muted: #a8b5b0;
    --border: #2c3733;
    --border-strong: #3d4b46;

    --brand: #59c894;
    --brand-strong: #7ed7ac;
    --brand-tint: #163024;
    --brand-contrast: #08130d;

    --focus: #7fb3ff;
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-strong);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* 見出し */
h1,
h2,
h3,
h4 {
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 0 0 var(--space-4);
  font-weight: 700;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.075rem;
  margin-top: var(--space-6);
}

h4 {
  font-size: 1rem;
  margin-top: var(--space-5);
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-4);
}

ul,
ol {
  padding-left: 1.35em;
}

li {
  margin-bottom: var(--space-2);
}

li > ul,
li > ol {
  margin-top: var(--space-2);
}

strong {
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: var(--brand-contrast);
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 40em) {
  .wrap {
    padding-inline: var(--space-6);
  }
}

.prose {
  max-width: var(--measure);
}

main {
  display: block;
  padding-bottom: var(--space-8);
}

/* --------------------------------------------------------------------------
   4. Site header
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding-block: var(--space-3);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.site-header__brand:hover .site-header__name {
  text-decoration: underline;
}

.site-header__mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: inline-block;
  padding: var(--space-1) 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--brand-strong);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* 言語切替 */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.lang-switch__label {
  color: var(--text-muted);
}

.lang-switch a {
  display: inline-block;
  padding: 0.2em 0.7em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.6;
}

.lang-switch a:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

/* --------------------------------------------------------------------------
   5. Page head / hero
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.page-head h1 {
  margin-bottom: var(--space-2);
}

.page-head__lead {
  max-width: var(--measure);
  color: var(--text-muted);
  margin: 0;
}

.hero {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-7);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: flex-start;
}

.hero__icon {
  width: 76px;
  height: 76px;
  border-radius: 17px;
  border: 1px solid var(--border);
  flex: none;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

.hero__tagline {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: var(--space-3);
}

.hero__lead {
  max-width: var(--measure);
  margin-bottom: 0;
  color: var(--text-muted);
}

@media (min-width: 40em) {
  .hero h1 {
    font-size: 2.375rem;
  }

  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
  }
}

/* 開発状況バッジ */
.status-note {
  display: inline-block;
  background: var(--brand-tint);
  border: 1px solid var(--brand);
  color: var(--brand-strong);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   6. Sections / cards
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--space-6);
}

.section--alt {
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.section > h2:first-child,
.section .wrap > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 46em) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: 0;
}

.card h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: 1.0625rem;
}

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

/* 事実の箇条書き（プライバシー要約など） */
.factlist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.factlist li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: var(--space-3);
}

.factlist li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.72em;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--brand);
}

/* 補足・注記 */
.note {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.note > :last-child {
  margin-bottom: 0;
}

.note__title {
  font-weight: 700;
  margin-bottom: var(--space-2);
}

/* 目次 */
.toc {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 var(--space-2);
  padding: 0;
  border: 0;
}

.toc ol {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Tables
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin-bottom: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.9375rem;
}

caption {
  text-align: left;
  font-weight: 700;
  padding: var(--space-3) var(--space-4) 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
}

thead th {
  background: var(--surface-alt);
  font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   8. FAQ (details/summary)
   -------------------------------------------------------------------------- */

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-3);
}

.faq > summary {
  cursor: pointer;
  padding: var(--space-4);
  font-weight: 700;
  line-height: 1.65;
  list-style-position: outside;
}

.faq > summary::marker {
  color: var(--brand);
}

.faq[open] > summary {
  border-bottom: 1px solid var(--border);
}

.faq__body {
  padding: var(--space-4);
}

.faq__body > :last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. Links & buttons
   -------------------------------------------------------------------------- */

.linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.linkrow li {
  margin: 0;
}

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.6;
}

.btn:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn--quiet {
  background: transparent;
  color: var(--brand-strong);
}

.btn--quiet:hover {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

/* ルートページの言語選択 */
.lang-choice {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  max-width: var(--measure);
}

@media (min-width: 34em) {
  .lang-choice {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lang-choice li {
  margin: 0;
}

.lang-choice a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-decoration: none;
  color: var(--text);
}

.lang-choice a:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.lang-choice__title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: var(--space-1);
}

.lang-choice__sub {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--brand-strong);
}

.site-footer__meta {
  margin: 0;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   11. Utilities
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.updated {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stack-lg > * + * {
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   12. Motion / print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .toc {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .faq {
    border: 0;
  }
}
