@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Mono:wght@200..800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body, p, a, li, span, div {
    font-family: "JetBrains Mono", monospace;
    font-weight: 400;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4 {
    font-family: "Atkinson Hyperlegible Mono", monospace;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Light theme (default) */
:root {
  /* Kanagawa Lotus (light) */
  --bg: #f2ecbc;
  --text: #545464;
  --text-strong: #43436c;
  --text-muted: #8a8980;
  --text-faint: #a09cac;
  --border: #dcd7ba;
  --inline-code-bg: #e5ddb0;
  --inline-code-text: #c84053;
  --link: #716e61;
  --link-hover: #43436c;
  --content-link: #4d699b;
  --content-link-hover: #6693bf;
  --cursor: #43436c;
  /* Kanagawa accents (light) */
  --c-green: #6e915f;
  --c-blue: #4d699b;
  --c-violet: #624c83;
  --c-red: #c84053;
  --c-yellow: #77713f;
  --c-aqua: #597b75;
  --c-orange: #cc6d00;
  --c-pink: #b35b79;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Kanagawa Dragon (dark) */
    --bg: #181616;
    --text: #a6a69c;
    --text-strong: #c5c9c5;
    --text-muted: #7a8382;
    --text-faint: #625e5a;
    --border: #393836;
    --inline-code-bg: #282727;
    --inline-code-text: #c4b28a;
    --link: #a6a69c;
    --link-hover: #c5c9c5;
    --content-link: #7fb4ca;
    --content-link-hover: #a3d4d5;
    --cursor: #c8c093;
    /* Kanagawa accents (dark) */
    --c-green: #87a987;
    --c-blue: #7fb4ca;
    --c-violet: #938aa9;
    --c-red: #e46876;
    --c-yellow: #c4b28a;
    --c-aqua: #7aa89f;
    --c-orange: #b6927b;
    --c-pink: #a292a3;
  }
}

:root[data-theme="dark"] {
  /* Kanagawa Dragon (dark) — keep in sync with the block above */
  --bg: #181616;
  --text: #a6a69c;
  --text-strong: #c5c9c5;
  --text-muted: #7a8382;
  --text-faint: #625e5a;
  --border: #393836;
  --inline-code-bg: #282727;
  --inline-code-text: #c4b28a;
  --link: #a6a69c;
  --link-hover: #c5c9c5;
  --content-link: #7fb4ca;
  --content-link-hover: #a3d4d5;
  --cursor: #c8c093;
  /* Kanagawa accents (dark) — keep in sync with the block above */
  --c-green: #87a987;
  --c-blue: #7fb4ca;
  --c-violet: #938aa9;
  --c-red: #e46876;
  --c-yellow: #c4b28a;
  --c-aqua: #7aa89f;
  --c-orange: #b6927b;
  --c-pink: #a292a3;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--link-hover); }

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  margin-bottom: 4rem;
}
@media (min-width: 1024px) {
  .container { margin-top: 3rem; }
}

/* Header */
header { margin-bottom: 1.5rem; }

header .header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

header .site-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 2.5rem;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}
header .site-title:hover { color: var(--text-strong); }

header .terminal-cursor {
  font-family: "JetBrains Mono", monospace;
  font-weight: 400;
  color: var(--cursor);
  margin-left: 1px;
  animation: blink 1.2s infinite;
}

header .current-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
}

header nav {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

header nav a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
header nav a:hover { color: var(--text); }

.theme-toggle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.2s;
}
.theme-toggle:hover { color: var(--text); }

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

main { min-height: 60vh; margin-top: 1.5rem; }

/* Homepage */
.homepage { display: flex; flex-direction: column; gap: 2.5rem; }
.homepage .main-col { flex: 2; }

.homepage .bio {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.section-block { margin-bottom: 2rem; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  font-size: 1.125rem;
  color: var(--text-strong);
}

.section-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* Lists with terminal left-border */
.now-list,
.post-list,
.wiki-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.now-list li,
.post-list li,
.wiki-list li {
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  transition: border-color 0.2s;
}

.post-list li:hover,
.wiki-list li:hover { border-left-color: var(--text-muted); }

.now-list {
  gap: 0.3rem;
}

.now-list .now-label {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.now-list .now-label::after { content: " →"; }

/* Experience timeline */
.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-size: 0.9rem;
  border-left: 2px solid var(--border);
}

.experience-list > li {
  position: relative;
  padding-left: 1rem;
}

.experience-list > li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35em;
  width: 8px;
  height: 8px;
  background: var(--text-muted);
}

.experience-list > li:hover::before { background: var(--text); }
.experience-list > li.job-current::before { display: none; }

.job-line { line-height: 1.45; }

.job-title { color: var(--text-strong); }

.job-at { color: var(--text-faint); }

.job-company { color: var(--content-link); }
.job-company:hover { color: var(--content-link-hover); }

.job-period {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.job-roles {
  list-style: none;
  margin-top: 0.45rem;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.job-roles .job-title { color: var(--text); }
.job-roles .job-period::before { content: " · "; }

.post-list li {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.post-list .post-title { color: var(--text); }
.post-list li:hover .post-title { color: var(--text-strong); }

.post-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.see-all {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 0.75rem;
}
.see-all:hover { color: var(--text); }

/* Wiki/project list */
.wiki-list { gap: 0.25rem; }

.wiki-list .wiki-link {
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.wiki-list .wiki-link:hover { color: var(--text-strong); }

.wiki-list .wiki-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Tags */
.tag-list {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.tag-muted { color: var(--text-faint); }

.tag-link {
  color: var(--text-muted);
  transition: color 0.2s;
}
.tag-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* Section pages */
.section-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

.section-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.tag-index {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1rem;
}

.tag-index li { padding-left: 0.75rem; }

/* Articles */
article {
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
}

article h1.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

article .post-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

article .content p { margin-bottom: 1.5rem; }

article .content a {
  color: var(--content-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
article .content a:hover { color: var(--content-link-hover); }

article .content ul,
article .content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
article .content ul li { list-style-type: disc; margin-bottom: 0.5rem; }
article .content ol li { list-style-type: decimal; margin-bottom: 0.5rem; }

article .content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

article .content code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
}

article .content :not(pre) > code {
  background-color: var(--inline-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  color: var(--inline-code-text);
}

.bio code {
  background-color: var(--inline-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  color: var(--inline-code-text);
}

/* Palette accent utilities: <span class="text-green">…</span> */
.text-green { color: var(--c-green); }
.text-blue { color: var(--c-blue); }
.text-violet { color: var(--c-violet); }
.text-red { color: var(--c-red); }
.text-yellow { color: var(--c-yellow); }
.text-aqua { color: var(--c-aqua); }
.text-orange { color: var(--c-orange); }
.text-pink { color: var(--c-pink); }

article .content pre {
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding: 0.75rem 0;
  counter-reset: line;
}

article .content pre code {
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
}

article .content .code-wrapper { position: relative; margin: 1.5rem 0; }
article .content .code-wrapper pre { margin: 0; }

article .content .copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  user-select: none;
  z-index: 10;
}

article .content .code-wrapper:hover .copy-button { opacity: 1; }

article .content .copy-button:hover {
  color: var(--text);
  background-color: var(--inline-code-bg);
}

article .content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin: 1rem 0;
}

article .content figure { margin: 1rem 0; }
article .content figure img { margin: 0; }

article .content figcaption {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

article .content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

article .content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

article .content table th,
article .content table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

article .content table th {
  background: var(--inline-code-bg);
  font-weight: 600;
  color: var(--text-strong);
}

.page-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.page-footer a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.page-footer a:hover { color: var(--text); }

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer .footer-inner a { color: var(--text-muted); }
footer .footer-inner a:hover { color: var(--text); }
footer .footer-links { display: flex; gap: 1rem; }

@media (max-width: 640px) {
  footer .footer-inner { flex-direction: column; align-items: flex-start; }
}
