/* Design system: Technical Editorial */
:root {
  --yt-bg: #f7f8fa;
  --yt-surface: #ffffff;
  --yt-surface-muted: #eef2f5;
  --yt-text: #1f2933;
  --yt-text-strong: #111827;
  --yt-text-muted: #64748b;
  --yt-sidebar: #111827;
  --yt-sidebar-muted: #1f2937;
  --yt-primary: #2563eb;
  --yt-accent: #0f766e;
  --yt-accent-2: #06b6d4;
  --yt-border: #d8e0e8;
  --yt-border-soft: #e7edf3;
  --yt-code-bg: #0f172a;
  --yt-code-text: #e5edf5;
  --yt-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --yt-font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas,
    "Liberation Mono", monospace;
  --yt-radius-sm: 4px;
  --yt-radius-md: 6px;
  --yt-radius-lg: 8px;
  --yt-shadow-subtle: 0 1px 2px rgba(15, 23, 42, 0.06);
  --yt-shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: light) {
  html:not([data-mode]),
  html[data-mode="light"] {
    --main-bg: var(--yt-bg);
    --main-border-color: var(--yt-border-soft);
    --text-color: var(--yt-text);
    --text-muted-color: var(--yt-text-muted);
    --text-muted-highlight-color: #475569;
    --heading-color: var(--yt-text-strong);
    --label-color: #334155;
    --blockquote-border-color: var(--yt-accent);
    --blockquote-text-color: #475569;
    --link-color: var(--yt-primary);
    --link-underline-color: rgba(37, 99, 235, 0.22);
    --button-bg: var(--yt-surface);
    --btn-border-color: var(--yt-border);
    --sidebar-bg: var(--yt-sidebar);
    --sidebar-border-color: rgba(255, 255, 255, 0.08);
    --sidebar-muted-color: #cbd5e1;
    --sidebar-active-color: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-btn-bg: rgba(255, 255, 255, 0.08);
    --sidebar-btn-color: #cbd5e1;
    --site-title-color: #ffffff;
    --site-subtitle-color: #a7b4c8;
    --avatar-border-color: rgba(255, 255, 255, 0.86);
    --topbar-bg: rgba(247, 248, 250, 0.86);
    --topbar-text-color: var(--yt-text);
    --search-border-color: var(--yt-border);
    --search-icon-color: var(--yt-text-muted);
    --input-focus-border-color: var(--yt-primary);
    --post-list-text-color: var(--yt-text-muted);
    --toc-highlight: var(--yt-primary);
    --card-bg: var(--yt-surface);
    --card-hovor-bg: #f8fafc;
    --card-shadow: none;
    --tag-border: var(--yt-border);
    --tag-shadow: transparent;
    --tag-hover: #dff7fb;
    --search-tag-bg: var(--yt-surface-muted);
    --categories-border: var(--yt-border);
    --categories-hover-bg: var(--yt-surface-muted);
    --tb-odd-bg: #f8fafc;
    --tb-border-color: var(--yt-border-soft);
    --language-border-color: var(--yt-border);
    --highlight-bg-color: #f3f6f9;
    --inline-code-bg: rgba(15, 118, 110, 0.09);
    --code-color: #0f3f3b;
  }
}

html[data-mode="dark"] {
  --main-bg: #0f172a;
  --main-border-color: #1e293b;
  --text-color: #cbd5e1;
  --text-muted-color: #94a3b8;
  --text-muted-highlight-color: #d8e2ee;
  --heading-color: #f8fafc;
  --label-color: #e2e8f0;
  --blockquote-border-color: var(--yt-accent-2);
  --blockquote-text-color: #cbd5e1;
  --link-color: #60a5fa;
  --link-underline-color: rgba(96, 165, 250, 0.36);
  --button-bg: #111827;
  --btn-border-color: #334155;
  --sidebar-bg: #090f1f;
  --sidebar-border-color: rgba(148, 163, 184, 0.16);
  --sidebar-muted-color: #cbd5e1;
  --sidebar-active-color: #ffffff;
  --sidebar-hover-bg: rgba(148, 163, 184, 0.12);
  --sidebar-btn-bg: rgba(148, 163, 184, 0.12);
  --sidebar-btn-color: #cbd5e1;
  --site-title-color: #ffffff;
  --site-subtitle-color: #94a3b8;
  --avatar-border-color: rgba(255, 255, 255, 0.7);
  --topbar-bg: rgba(15, 23, 42, 0.86);
  --topbar-text-color: #e2e8f0;
  --search-border-color: #334155;
  --search-icon-color: #94a3b8;
  --input-focus-border-color: #60a5fa;
  --post-list-text-color: #aebdd0;
  --toc-highlight: #60a5fa;
  --card-bg: #111827;
  --card-hovor-bg: #172033;
  --card-shadow: none;
  --tag-border: #334155;
  --tag-shadow: transparent;
  --tag-hover: rgba(6, 182, 212, 0.18);
  --search-tag-bg: #172033;
  --categories-border: #334155;
  --categories-hover-bg: #1e293b;
  --tb-odd-bg: #111827;
  --tb-border-color: #243244;
  --language-border-color: #334155;
  --highlight-bg-color: var(--yt-code-bg);
  --inline-code-bg: rgba(6, 182, 212, 0.11);
  --code-color: #cdeff7;
}

@media (prefers-color-scheme: dark) {
  html:not([data-mode]) {
    --main-bg: #0f172a;
    --main-border-color: #1e293b;
    --text-color: #cbd5e1;
    --text-muted-color: #94a3b8;
    --text-muted-highlight-color: #d8e2ee;
    --heading-color: #f8fafc;
    --label-color: #e2e8f0;
    --blockquote-border-color: var(--yt-accent-2);
    --blockquote-text-color: #cbd5e1;
    --link-color: #60a5fa;
    --link-underline-color: rgba(96, 165, 250, 0.36);
    --button-bg: #111827;
    --btn-border-color: #334155;
    --sidebar-bg: #090f1f;
    --sidebar-border-color: rgba(148, 163, 184, 0.16);
    --sidebar-muted-color: #cbd5e1;
    --sidebar-active-color: #ffffff;
    --sidebar-hover-bg: rgba(148, 163, 184, 0.12);
    --sidebar-btn-bg: rgba(148, 163, 184, 0.12);
    --sidebar-btn-color: #cbd5e1;
    --site-title-color: #ffffff;
    --site-subtitle-color: #94a3b8;
    --avatar-border-color: rgba(255, 255, 255, 0.7);
    --topbar-bg: rgba(15, 23, 42, 0.86);
    --topbar-text-color: #e2e8f0;
    --search-border-color: #334155;
    --search-icon-color: #94a3b8;
    --input-focus-border-color: #60a5fa;
    --post-list-text-color: #aebdd0;
    --toc-highlight: #60a5fa;
    --card-bg: #111827;
    --card-hovor-bg: #172033;
    --card-shadow: none;
    --tag-border: #334155;
    --tag-shadow: transparent;
    --tag-hover: rgba(6, 182, 212, 0.18);
    --search-tag-bg: #172033;
    --categories-border: #334155;
    --categories-hover-bg: #1e293b;
    --tb-odd-bg: #111827;
    --tb-border-color: #243244;
    --language-border-color: #334155;
    --highlight-bg-color: var(--yt-code-bg);
    --inline-code-bg: rgba(6, 182, 212, 0.11);
    --code-color: #cdeff7;
  }
}

body {
  font-family: var(--yt-font-sans);
  color: var(--text-color);
  background: var(--main-bg);
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
#toc-solo-trigger .label,
#topbar-title,
#post-list .card .card-body .card-title,
.pagination {
  font-family: var(--yt-font-sans);
  letter-spacing: 0;
}

a {
  text-underline-offset: 0.18em;
}

#page-category a:hover,
#page-tag a:hover,
#access-lastmod a:hover,
.post-tail-wrapper .license-wrapper > a:hover,
#search-results a:hover,
footer a:hover,
#topbar #breadcrumb a:hover,
.post-meta a:not([class]):hover,
.content a:not(.img-link):hover {
  color: var(--yt-accent) !important;
  border-bottom-color: var(--yt-accent);
}

#main-wrapper > .container {
  max-width: 1320px;
}

#topbar-wrapper {
  border-bottom: 1px solid var(--main-border-color);
  backdrop-filter: blur(16px);
}

search {
  border-radius: var(--yt-radius-lg);
  background: var(--card-bg);
}

#search-input {
  font-family: var(--yt-font-sans);
}

#sidebar {
  background: var(--sidebar-bg);
}

#sidebar .profile-wrapper {
  width: calc(100% - 2rem);
  margin: 1rem 1rem 2rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--yt-radius-lg);
  background: rgba(255, 255, 255, 0.045);
}

#sidebar #avatar {
  width: 5.75rem;
  height: 5.75rem;
  box-shadow: 0 0 0 2px var(--avatar-border-color);
}

#sidebar #avatar img:hover {
  transform: none;
}

#sidebar .site-title {
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: 0;
}

#sidebar .site-subtitle {
  font-size: 0.86rem;
  line-height: 1.55;
  word-spacing: 0;
}

#sidebar ul li.nav-item {
  padding-left: 1rem;
  padding-right: 1rem;
}

#sidebar ul li.nav-item a.nav-link {
  position: relative;
  border-radius: var(--yt-radius-md);
  font-weight: 650;
}

#sidebar ul li.nav-item a.nav-link i {
  margin-right: 1rem;
  color: var(--yt-accent-2);
}

#sidebar ul li.nav-item.active .nav-link::before {
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--yt-primary);
  content: "";
}

#sidebar .sidebar-bottom {
  padding-left: 1rem;
  padding-right: 1rem;
}

#sidebar .sidebar-bottom #mode-toggle,
#sidebar .sidebar-bottom a {
  border-radius: var(--yt-radius-md);
}

#post-list {
  margin-top: 2rem;
}

#post-list .card-wrapper:not(:last-child) {
  margin-bottom: 1rem;
}

#post-list .card {
  border: 1px solid var(--main-border-color);
  border-radius: var(--yt-radius-lg);
  background: var(--card-bg);
  box-shadow: var(--yt-shadow-subtle);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#post-list .card-wrapper:hover .card,
#post-list .card:hover {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: var(--yt-shadow-card);
  transform: translateY(-1px);
}

#post-list .post-preview {
  border-radius: var(--yt-radius-lg);
}

#post-list .card .preview-img,
#post-list .card .preview-img img {
  border-radius: var(--yt-radius-lg) var(--yt-radius-lg) 0 0;
}

@media all and (min-width: 768px) {
  #post-list .card .preview-img,
  #post-list .card .preview-img img {
    border-radius: 0 var(--yt-radius-lg) var(--yt-radius-lg) 0;
  }
}

#post-list .card .card-body {
  padding: 1.15rem;
}

@media all and (min-width: 768px) {
  #post-list .card .card-body {
    padding: 1.6rem 1.7rem 1.25rem;
  }
}

#post-list .card .card-body .card-title {
  font-size: 1.22rem;
  font-weight: 750;
  line-height: 1.45;
}

#post-list .card .card-body .card-text.content p {
  line-height: 1.7;
}

#post-list .card .card-body .post-meta {
  font-size: 0.82rem;
}

article[data-toc="true"] {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

article[data-toc="true"] > header h1 {
  font-size: clamp(2rem, 2vw + 1.2rem, 2.8rem);
  font-weight: 780;
  line-height: 1.28;
}

.content {
  font-size: 1.035rem;
  line-height: 1.85;
}

.content p {
  margin-bottom: 1.2rem;
}

.content h2 {
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--main-border-color);
  font-size: 1.55rem;
  font-weight: 760;
}

.content h3 {
  margin-top: 2.1rem;
  font-size: 1.25rem;
  font-weight: 740;
}

.content blockquote {
  border-left: 3px solid var(--blockquote-border-color);
  background: color-mix(in srgb, var(--card-bg) 82%, var(--yt-accent-2) 18%);
  border-radius: 0 var(--yt-radius-md) var(--yt-radius-md) 0;
}

.content code,
.highlighter-rouge,
kbd,
pre {
  font-family: var(--yt-font-mono);
}

.content code.highlighter-rouge {
  border-radius: var(--yt-radius-sm);
  padding: 0.1rem 0.28rem;
}

.highlight,
figure.highlight,
div[class^="language-"],
.code-header {
  border: 1px solid var(--language-border-color);
  border-radius: var(--yt-radius-lg);
}

.code-header {
  border-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.code-header + .highlight,
.code-header + div[class^="language-"] {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.table-wrapper > table {
  border: 1px solid var(--tb-border-color);
  border-radius: var(--yt-radius-lg);
  overflow: hidden;
}

.table-wrapper > table thead th {
  background: var(--yt-surface-muted);
  color: var(--yt-text-strong);
}

html[data-mode="dark"] .table-wrapper > table thead th {
  background: #172033;
  color: #f8fafc;
}

@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .table-wrapper > table thead th {
    background: #172033;
    color: #f8fafc;
  }
}

#panel-wrapper .panel-heading {
  color: var(--label-color);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#toc-wrapper > *,
.access > section {
  border-left-color: var(--main-border-color);
}

.access {
  margin-top: 2.5rem;
}

.access .content,
#toc-wrapper ul {
  font-size: 0.84rem;
}

#toc-wrapper ul li a {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

#toc-wrapper ul .is-active-link {
  font-weight: 700;
}

.tag,
#panel-wrapper .post-tag,
.post-tags .post-tag {
  border-radius: var(--yt-radius-md);
  border-color: var(--tag-border) !important;
  box-shadow: none;
}

.tag::before,
.post-tag::before {
  color: var(--yt-accent);
}

.pagination .page-item .page-link {
  border-radius: var(--yt-radius-md);
}

footer {
  border-top-color: var(--main-border-color);
}

@media all and (max-width: calc(850px - 1px)) {
  #sidebar .profile-wrapper {
    margin-top: 1rem;
  }

  article[data-toc="true"] > header h1 {
    font-size: 2rem;
  }

  .content {
    font-size: 1rem;
    line-height: 1.78;
  }
}

/* Custom styles for responsive images */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* Ensure images in posts are responsive */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* Allow images with explicit max-width to override */
article img[style*="max-width"] {
  display: block;
  margin: 1rem auto;
}

/* Make all iframes responsive */
article iframe,
.post-content iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* For iframes that are already wrapped in responsive containers */
article iframe[style*="position: absolute"],
.post-content iframe[style*="position: absolute"] {
  aspect-ratio: unset;
}

/* Twitter embeds */
.twitter-tweet {
  margin: 1rem auto !important;
  max-width: 100% !important;
}

/* Embedded videos and tweets responsiveness */
blockquote.twitter-tweet,
blockquote.instagram-media {
  max-width: 100% !important;
}

/* ---------------------------------------------------------------
 * About page — editorial CV layout
 * --------------------------------------------------------------- */

.about-hero {
  margin: -0.25rem 0 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--main-border-color);
}

.about-hero__eyebrow {
  font-family: var(--yt-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--yt-accent);
  margin-bottom: 0.7rem;
}

.about-hero__name {
  font-size: clamp(2.1rem, 4vw + 0.3rem, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1.05;
  margin: 0 0 0.55rem;
  color: var(--heading-color);
}

.about-hero__name .post {
  color: var(--text-muted-color);
  font-weight: 500;
  font-size: 0.62em;
  letter-spacing: 0.01em;
  margin-left: 0.4rem;
}

.about-hero__company {
  font-size: 1rem;
  color: var(--text-muted-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.05rem;
}

.about-hero__company a {
  color: var(--text-color);
  font-weight: 600;
}

.about-hero__company .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.about-hero__lede {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1.25rem;
}

.about-hero__lede .en {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted-color);
  font-style: italic;
  font-size: 0.95rem;
}

.about-hero__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.78rem;
  border: 1px solid var(--main-border-color);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.about-hero__links a:hover {
  border-color: var(--yt-accent);
  color: var(--yt-accent) !important;
  background: color-mix(in srgb, var(--yt-accent) 8%, transparent);
}

.about-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0 0 3rem;
  padding: 1.1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: var(--yt-radius-lg);
  box-shadow: var(--yt-shadow-subtle);
}

.about-snapshot__item {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.4rem 0;
}

.about-snapshot__label {
  font-family: var(--yt-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted-color);
}

.about-snapshot__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading-color);
  line-height: 1.45;
}

.about-timeline {
  margin: 0.5rem 0 0;
}

.about-timeline__group {
  position: relative;
  padding: 0 0 1.75rem 1.5rem;
  border-left: 2px solid var(--main-border-color);
}

.about-timeline__group:last-child {
  padding-bottom: 0;
}

.about-timeline__group::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yt-accent);
  box-shadow: 0 0 0 3px var(--main-bg);
}

.about-timeline__group--current::before {
  background: var(--yt-primary);
  box-shadow: 0 0 0 3px var(--main-bg), 0 0 0 6px color-mix(in srgb, var(--yt-primary) 22%, transparent);
}

.about-timeline__org {
  font-size: 1.08rem;
  font-weight: 760;
  margin: 0 0 0.4rem;
  color: var(--heading-color);
  line-height: 1.35;
}

.about-timeline__org a {
  color: inherit;
}

.about-timeline__org-meta {
  font-family: var(--yt-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted-color);
  margin: -0.25rem 0 0.6rem;
}

.about-timeline__roles {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-timeline__role {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: 0.85rem;
}

.about-timeline__period {
  font-family: var(--yt-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted-color);
  letter-spacing: 0.02em;
  padding-top: 0.18rem;
  white-space: nowrap;
}

.about-timeline__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: var(--heading-color);
  line-height: 1.4;
}

.about-timeline__body p {
  margin: 0.25rem 0 0.4rem;
  line-height: 1.7;
}

.about-timeline__body ul {
  margin: 0.25rem 0 0.4rem;
  padding-left: 1.15rem;
}

.about-timeline__body ul li {
  margin: 0.18rem 0;
  line-height: 1.65;
}

.about-timeline__body img {
  margin-top: 0.6rem !important;
  margin-bottom: 0.4rem !important;
  border-radius: var(--yt-radius-md);
  border: 1px solid var(--main-border-color);
}

@media (max-width: 640px) {
  .about-timeline__role {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .about-timeline__period {
    font-size: 0.74rem;
  }
}

.about-section {
  margin-top: 3.25rem;
}

.about-section > h2 {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1.4rem !important;
}

.about-section > h2 .num {
  font-family: var(--yt-font-mono);
  font-size: 0.7em;
  font-weight: 600;
  color: var(--yt-accent);
  letter-spacing: 0.08em;
}

.about-pubs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.about-pubs li {
  padding: 0.45rem 0 0.45rem 0.95rem;
  border-left: 2px solid var(--main-border-color);
  line-height: 1.65;
  font-size: 0.97rem;
}

.about-pubs li:hover {
  border-left-color: var(--yt-accent);
}

.about-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem 2rem;
}

.about-mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-mini-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--main-border-color);
  line-height: 1.55;
}

.about-mini-list li:last-child {
  border-bottom: 0;
}

.about-mini-list .when {
  font-family: var(--yt-font-mono);
  font-size: 0.74rem;
  color: var(--text-muted-color);
  display: block;
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}
