:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2563eb;
  --border: #e5e5e5;
  --card: #ffffff;
  --max-width: 760px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --accent: #60a5fa;
    --border: #2a2a2a;
    --card: #1c1c1c;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 16px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

header.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}

nav.site-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.95rem;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
}

main {
  padding-bottom: 80px;
}

h1, h2, h3 {
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { font-size: 1.15rem; }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hero {
  margin: 40px 0;
}

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

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.post-list .date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cv-section {
  margin-bottom: 32px;
}

.cv-item {
  margin-bottom: 20px;
}

.cv-item .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}

article.post header {
  margin-bottom: 30px;
}

article.post .post-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

article.post img {
  max-width: 100%;
  height: auto;
}

article.post pre {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
}

article.post code {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

article.post pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

article.post blockquote {
  border-left: 3px solid var(--border);
  margin: 1em 0;
  padding: 0 1em;
  color: var(--muted);
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ------ Weather page ------ */

.weather-hero {
  margin: 40px 0 28px;
}

.weather-hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.weather-hero .lead {
  margin: 0;
  color: var(--muted);
}

.updated-at {
  display: inline-block;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.weather-loading {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.weather-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.weather-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, var(--tint, transparent) 0%, transparent 65%);
  opacity: 0.85;
}

.weather-card > * {
  position: relative;
}

.temp-cold { --tint: rgba(96, 165, 250, 0.22); }
.temp-cool { --tint: rgba(147, 197, 253, 0.18); }
.temp-mild { --tint: rgba(134, 239, 172, 0.18); }
.temp-warm { --tint: rgba(253, 186, 116, 0.22); }
.temp-hot  { --tint: rgba(248, 113, 113, 0.28); }

@media (prefers-color-scheme: dark) {
  .temp-cold { --tint: rgba(96, 165, 250, 0.16); }
  .temp-cool { --tint: rgba(147, 197, 253, 0.12); }
  .temp-mild { --tint: rgba(134, 239, 172, 0.12); }
  .temp-warm { --tint: rgba(253, 186, 116, 0.16); }
  .temp-hot  { --tint: rgba(248, 113, 113, 0.20); }
}

.weather-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.weather-card-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.weather-card-en {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.weather-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 4px;
}

.weather-icon {
  font-size: 2.4rem;
  line-height: 1;
}

.weather-temp {
  font-size: 2.6rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.weather-temp-unit {
  font-size: 1rem;
  color: var(--muted);
  margin-left: 2px;
  font-weight: 400;
}

.weather-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.weather-details > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.weather-details dd {
  margin: 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.weather-card-error {
  opacity: 0.7;
}

.weather-attrib {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
