/* Bloss0m - Brand site styles (ui-ux-pro-max design system) */
:root,
[data-theme="dark"] {
  --bg: #0f1116;
  --surface: #181c24;
  --border: #2a3142;
  --text: #e6e9ef;
  --text-muted: #8b92a4;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --font-heading: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --radius: 10px;
  --space: 1.5rem;
  --transition: 200ms ease-out;
  --layout-max: min(1280px, 100vw - 3rem);
  --content-max: min(1000px, 100vw - 3rem);
  --nav-bg: rgba(15, 17, 22, 0.9);
  --shadow-card-hover: 0 4px 24px rgba(37, 99, 235, 0.08);
  --shadow-cta: none;
  --accent-soft-hover: rgba(37, 99, 235, 0.25);
}

/* Warm theme: light warm (soft cream / sand), no black – Nature Distilled */
[data-theme="warm"] {
  --bg: #f5f0e1;
  --surface: #ede9e0;
  --border: #d4c4a8;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #c67b5c;
  --accent-hover: #b5651d;
  --accent-soft: rgba(198, 123, 92, 0.2);
  --nav-bg: rgba(245, 240, 225, 0.92);
  --radius: 12px;
  --transition: 220ms ease-out;
  --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(212, 196, 168, 0.6);
  --shadow-cta: 0 2px 12px rgba(198, 123, 92, 0.3);
  --accent-soft-hover: rgba(198, 123, 92, 0.35);
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root,
  [data-theme="dark"],
  [data-theme="warm"] {
    --transition: 0ms;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-in-up {
    from {
      opacity: 0;
      transform: translateY(0.5rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .hero-inner {
    animation: fade-in-up 0.5s ease-out both;
  }
  .section-reveal {
    animation: fade-in-up 0.45s ease-out both;
  }
  section:nth-of-type(1).section-reveal { animation-delay: 0.05s; }
  section:nth-of-type(2).section-reveal { animation-delay: 0.1s; }
  section:nth-of-type(3).section-reveal { animation-delay: 0.15s; }
  section:nth-of-type(4).section-reveal { animation-delay: 0.2s; }
  section:nth-of-type(5).section-reveal { animation-delay: 0.25s; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.main-content {
  padding-top: 0.5rem;
}

/* Skip to main content link for keyboard/screen reader users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0.5rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top var(--transition);
}
.skip-link:focus {
  top: 0.5rem;
}

/* Global back link (e.g. tag page, list pages) */
.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--transition);
}
.back:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
.back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Layout utilities (replace inline styles) */
.section-spacer {
  padding-top: 2rem;
}
.section-spacer-lg {
  padding-top: 4rem;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.text-center-mt {
  text-align: center;
  margin-top: 1rem;
}
.article-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.mt-half {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}
.mt-section {
  margin-top: 2rem;
}

/* Navigation - floating bar with spacing from viewport edges */
.nav {
  z-index: 100;
  padding: 1rem 1.5rem 0;
}

.nav-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: var(--space) 1.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}

.nav-logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition);
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  color: var(--accent);
}

.nav-links a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

/* Nav right: theme + language */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-btn-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-switcher [data-lang] {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.lang-switcher [data-lang]:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-switcher [data-lang]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html.lang-en .lang-switcher [data-lang="en"],
html.lang-zh .lang-switcher [data-lang="zh"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Language content blocks */
html.lang-en .block-zh { display: none !important; }
html.lang-zh .block-en { display: none !important; }

/* Sections */
section {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

/* Hero */
.hero {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-cta);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--accent-soft-hover);
  border-color: var(--accent);
}

/* Three Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pillar-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.pillar-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.pillar-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.pillar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pillar-tags span {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
}

/* Showcase */
.showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}

.showcase-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.showcase-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.showcase-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  flex-grow: 1;
  line-height: 1.5;
}

.showcase-metrics {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.showcase-card .btn {
  align-self: flex-start;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* Sticker cards (LINE stickers zone) */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.sticker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}

.sticker-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.sticker-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--border);
}

.sticker-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sticker-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-heading);
}

.sticker-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.sticker-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.sticker-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.sticker-card-body h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sticker-card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  flex-grow: 1;
  line-height: 1.5;
}

.sticker-card-body .btn {
  align-self: flex-start;
  cursor: pointer;
}

/* Latest Blog */
.blog-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.blog-preview-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}

.blog-preview-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.blog-preview-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: color var(--transition);
}

.blog-preview-item a:hover {
  color: var(--accent);
}

.blog-preview-item a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.blog-preview-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Content region: single column for inner pages so header, sections, CTA, footer share same width */
.content-region {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.content-region .page-header {
  padding-left: 0;
  padding-right: 0;
}

.content-region section {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.content-region .cta-block {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

.content-region .footer {
  padding-left: 0;
  padding-right: 0;
}

/* CTA block */
.cta-block {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cta-block p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Page header (for inner pages) */
.page-header {
  padding: 4rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}

.page-header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 0 0 0.25rem;
}

.page-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  margin: 0;
}

/* Project detail sections */
.proj-section {
  margin-bottom: 3rem;
}

.proj-section h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.proj-section p,
.proj-section ul {
  color: var(--text-muted);
  line-height: 1.7;
}

.proj-section ul {
  padding-left: 1.5rem;
}

.proj-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.proj-metrics span {
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

/* Project detail page: constrain images to content box, full image visible */
.proj-detail-section {
  box-sizing: border-box;
}
.proj-detail-section .article-body {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.proj-detail-section .article-body img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0.75rem 0;
}
.proj-detail-section .article-body p:has(> img) {
  width: 100%;
  max-width: 100%;
  margin: 0.75rem 0;
}
.proj-detail-section .article-body p:has(> img) img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Contact/About content blocks */
.about-block {
  margin-bottom: 2.5rem;
}

.about-block h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.about-block p,
.about-block ul {
  color: var(--text-muted);
  line-height: 1.75;
}

.about-block ul {
  padding-left: 1.5rem;
}

.about-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.about-contact-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}

.about-contact-links a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.about-contact-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Blog list */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: background var(--transition);
  border-radius: var(--radius);
  margin: 0 -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.blog-list li:hover {
  background: var(--surface);
}

.blog-list li:last-child {
  border-bottom: none;
}

.blog-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: color var(--transition);
}

.blog-list a:hover {
  color: var(--accent);
}

.blog-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.blog-list .meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.blog-list .blog-list-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

/* Tag list (blog index) and post tags */
.tag-list-section {
  margin-bottom: 0;
}
.tag-list-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}
.tag-list,
.post-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}
.tag-list a,
.post-tags a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tag-list a:hover,
.post-tags a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tag-list a:focus-visible,
.post-tags a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.blog-list .post-tags {
  margin-top: 0.35rem;
}
.blog-preview-item .post-tags {
  margin-top: 0.35rem;
}
.article-tags {
  margin-top: 0.5rem;
}

/* Article page */
.article-body {
  max-width: var(--content-max);
  margin: 0 auto;
}

.article-body h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body p {
  color: var(--text-muted);
  line-height: 1.75;
}

.article-body .back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--transition);
}

.article-body .back:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.article-body .back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Mermaid / diagram placeholder */
.diagram-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0;
}

/* Project detail: table (global so Markdown-rendered tables get borders) */
.article-body.proj-detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.article-body.proj-detail-body th,
.article-body.proj-detail-body td {
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.article-body.proj-detail-body th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}
[data-theme="dark"] .article-body.proj-detail-body table,
[data-theme="dark"] .article-body.proj-detail-body th,
[data-theme="dark"] .article-body.proj-detail-body td {
  border: 1px solid rgba(255, 255, 255, 0.22);
}
[data-theme="warm"] .article-body.proj-detail-body table,
[data-theme="warm"] .article-body.proj-detail-body th,
[data-theme="warm"] .article-body.proj-detail-body td {
  border: 1px solid rgba(0, 0, 0, 0.28);
}
