/* DFD Devlog: editorial reading surface. No external resources. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #fcfbf8;
  color: #23212b;
  font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic',
    'Hiragino Sans', 'Yu Gothic', 'Noto Sans', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

:lang(ja),
:lang(ko) {
  line-break: strict;
}

:lang(ko) {
  word-break: keep-all;
}

a {
  color: #5a4fcf;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #764ba2;
}

a:focus-visible,
main:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  /* Hide by the link's own box height so any line-height/padding stays fully offscreen. */
  transform: translateY(calc(-100% - 4px));
  z-index: 10;
  padding: 0.6rem 1rem;
  background: #23212b;
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  transform: none;
  color: #fff;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #ebe7f2;
}

.site-header ul,
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a,
.lang-switch a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
  color: #3b3848;
}

.site-nav .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #667eea;
  letter-spacing: 0.02em;
}

.site-nav a[aria-current='page'],
.lang-switch a[aria-current='page'] {
  color: #5a4fcf;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.lang-switch ul {
  gap: 0 0.9rem;
  font-size: 0.95rem;
}

.lang-switch a {
  justify-content: center;
}

/* Main */
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

main h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #1c1a24;
}

main h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.3rem;
  line-height: 1.4;
  color: #1c1a24;
}

main p {
  margin: 0 0 1.25rem;
}

.meta {
  margin-bottom: 2rem;
  font-size: 0.92rem;
  color: #6a6676;
}

/* List */
.post-item {
  padding: 1.75rem 0;
  border-top: 1px solid #ebe7f2;
  border-bottom: 1px solid #ebe7f2;
}

.post-item h2 {
  margin-top: 0;
}

.post-item h2 a {
  color: #1c1a24;
  text-decoration: none;
}

.post-item h2 a:hover {
  color: #5a4fcf;
  text-decoration: underline;
}

.post-item .meta {
  margin: 0;
}

/* X links: long URLs wrap instead of overflowing */
.x-links {
  margin: 0;
  padding-left: 1.25rem;
}

.x-links li {
  margin: 0.25rem 0;
}

.x-links a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

pre,
code {
  max-width: 100%;
  overflow-x: auto;
}

/* Footer */
.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid #ebe7f2;
  font-size: 0.92rem;
  color: #6a6676;
}

.site-footer p {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #3b3848;
}

@media (max-width: 600px) {
  body {
    font-size: 1rem;
    line-height: 1.85;
  }

  .site-header {
    padding: 0.5rem 1rem;
  }

  main {
    padding: 1.75rem 1rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
