@charset "UTF-8";

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111111;
  --fg-muted: #666666;
  --link: #0066cc;
  --border: #eaeaea;
  --card-bg: #f9f9f9;
  --btn-bg: #111111;
  --btn-fg: #ffffff;
  --btn-hover: #333333;
  --radius: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Arial, sans-serif;
  --space: clamp(24px, 5vw, 48px);
  --max-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #ededed;
    --fg-muted: #a0a0a0;
    --link: #4da6ff;
    --border: #2a2a2a;
    --card-bg: #141414;
    --btn-bg: #ffffff;
    --btn-fg: #000000;
    --btn-hover: #cccccc;
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

/* Typography & Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  line-height: 1.3;
  font-weight: 700;
  text-wrap: balance;
}
h1 {
  font-size: clamp(32px, 6vw, 48px);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 20px;
  margin: 24px 0 16px; 
  padding-bottom: 0;
  border-left: 4px solid var(--border);
  padding-left: 12px;
}
h3 {
  font-size: 18px;
  margin: 32px 0 16px;
}
p, ul, ol {
  margin-bottom: 24px;
}
ul, ol {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
li > ul, li > ol {
  margin-top: 8px;
  margin-bottom: 0;
}
strong {
  font-weight: 600;
}
time {
  color: var(--fg-muted);
}

.wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-w);
  flex: 1;
  padding: var(--space);
}

header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 32px;
  min-height: 56px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Accessibility (Skip Link) */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 12px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: visible;
  clip: auto;
  display: inline-block;
}

/* Components */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}
.button:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
  text-decoration: none;
}
.button:active {
  transform: translateY(1px);
}

.button-group {
  margin: 16px 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.note {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}
.note a {
  font-weight: 500;
}

/* Language Switch */
.lang-switch {
  display: flex;
  gap: 8px;
}
.lang-switch a, 
.lang-switch button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-switch a:hover, 
.lang-switch button:hover {
  color: var(--fg);
  background: var(--card-bg);
  border-color: var(--fg-muted);
}

/* Centered Layout Modifiers (index.html, 404.html) */
.centered main {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.centered h1 {
  font-size: clamp(40px, 8vw, 64px);
  margin-bottom: 8px;
}
.centered .subtitle {
  font-size: clamp(18px, 4vw, 22px);
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.centered .button-group {
  justify-content: center;
}
.centered .note {
  text-align: left;
  margin-top: 24px;
  width: 100%;
}

/* Footer */
footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--fg-muted);
}
footer nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
footer a {
  color: var(--fg-muted);
}
footer a:hover {
  color: var(--fg);
}
.separator {
  color: var(--border);
  user-select: none;
}