/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 5.75rem;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  isolation: isolate;
  text-rendering: optimizeLegibility;
  transition: background-color var(--duration-medium) var(--ease-out), color var(--duration-medium) var(--ease-out);
}

body,
.site-header,
.nav-shell,
.mobile-menu,
.content-section,
.side-card,
.tool-card,
.post-card,
.prose-card,
.article-card,
.modal-card,
.weather-card,
.timeline-item,
.contact-card,
.stat-card,
.daily-card,
.weather-stat,
.skill-button,
.tag,
.category-link,
.tab-button,
.sub-tab,
.primary-button,
.secondary-button,
.small-button,
.chip-button,
.text-input,
.code-input,
.code-output {
  transition-timing-function: var(--ease-out);
}

body::before {
  position: fixed;
  inset: -18%;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--color-accent) 13%, transparent), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(96, 165, 250, 0.12), transparent 26%),
    radial-gradient(circle at 50% 88%, rgba(47, 125, 85, 0.08), transparent 30%);
  content: "";
  filter: none;
  opacity: 0.9;
  pointer-events: none;
}

[data-theme="dark"] body::before {
  background:
    linear-gradient(140deg, rgba(189, 140, 255, 0.08), transparent 34%),
    linear-gradient(25deg, transparent 42%, rgba(217, 160, 195, 0.07), transparent 72%);
  opacity: 1;
}

body.menu-open {
  overflow: hidden;
}

img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Tokens */
:root {
  color-scheme: light;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 180ms;
  --duration-medium: 320ms;
  --duration-slow: 620ms;

  --color-bg: #f7f5f1;
  --color-bg-soft: #efeee9;
  --color-surface: #ffffff;
  --color-surface-soft: #faf9f6;
  --color-text: #222426;
  --color-muted: #6d706e;
  --color-faint: #9a9d98;
  --color-border: #dedbd2;
  --color-border-strong: #cbc7bc;
  --color-accent: #8c4f6f;
  --color-accent-soft: #f2e8ee;
  --color-card-lift: rgba(38, 33, 29, 0.08);
  --color-good: #2f7d55;
  --color-warn: #a56a19;
  --color-bad: #b44b4b;
  --color-focus: rgba(140, 79, 111, 0.32);
  --sidebar-card-bg: #ffffff;
  --sidebar-card-border: #dedbd2;
  --sidebar-card-text: #222426;
  --sidebar-card-muted: #5f5b66;
  --sidebar-accent: #8c4f6f;
  --sidebar-accent-hover: #6f3f58;
  --sidebar-chip-bg: #f2e8ee;
  --sidebar-chip-bg-hover: #ead8e3;
  --sidebar-chip-text: #8c4f6f;
  --sidebar-image-bg: #050605;
  --sidebar-card-shadow: 0 14px 34px rgba(38, 33, 29, 0.08);
  --timeline-card-bg: #ffffff;
  --timeline-card-text: #222426;
  --timeline-card-muted: #5f5b66;
  --timeline-border: rgba(140, 79, 111, 0.18);
  --timeline-border-hover: rgba(140, 79, 111, 0.36);
  --timeline-accent: #8c4f6f;
  --timeline-chip-bg: #f2e8ee;
  --timeline-chip-text: #8c4f6f;
  --timeline-glow: rgba(140, 79, 111, 0.1);
  --timeline-sheen: rgba(255, 255, 255, 0.45);
  /* Change 0.65-0.95 to tune the top navigation transparency. */
  --nav-panel-opacity: 0.84;
  --nav-bg-rgb: 255, 255, 255;
  --nav-border: rgba(184, 176, 162, 0.62);
  --nav-shadow: 0 16px 38px rgba(38, 33, 29, 0.12);
  --nav-text: #222426;
  --nav-muted: rgba(34, 36, 38, 0.72);
  --nav-accent: #8c4f6f;
  --nav-hover-bg: rgba(140, 79, 111, 0.1);
  --nav-hover-text: #222426;

  --container: 1180px;
  --sidebar: 276px;
  --radius: 16px;
  --hero-image-dim: 0.18;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0c0b11;
  --color-bg-soft: #15121c;
  --color-surface: #211d29;
  --color-surface-soft: #191620;
  --color-text: #f7f2fb;
  --color-muted: #c5bdcf;
  --color-faint: #92899f;
  --color-border: rgba(255, 255, 255, 0.105);
  --color-border-strong: rgba(214, 179, 255, 0.26);
  --color-accent: #d9a0c3;
  --color-accent-soft: #342333;
  --color-card-lift: rgba(0, 0, 0, 0.42);
  --color-good: #7fc59a;
  --color-warn: #dfb365;
  --color-bad: #e08383;
  --color-focus: rgba(208, 154, 184, 0.32);
  --sidebar-card-bg: #211d29;
  --sidebar-card-border: rgba(255, 255, 255, 0.08);
  --sidebar-card-text: #f5f1fb;
  --sidebar-card-muted: #d5cfdf;
  --sidebar-accent: #bd8cff;
  --sidebar-accent-hover: #dac2ff;
  --sidebar-chip-bg: #5c4a70;
  --sidebar-chip-bg-hover: #6e5a86;
  --sidebar-chip-text: #dfc8ff;
  --sidebar-image-bg: #050605;
  --sidebar-card-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  --timeline-card-bg: #211d29;
  --timeline-card-text: #f5f1fb;
  --timeline-card-muted: #c9c0d4;
  --timeline-border: rgba(185, 149, 255, 0.16);
  --timeline-border-hover: rgba(185, 149, 255, 0.36);
  --timeline-accent: #b995ff;
  --timeline-chip-bg: #584a69;
  --timeline-chip-text: #cfb4ff;
  --timeline-glow: rgba(185, 149, 255, 0.16);
  --timeline-sheen: rgba(255, 255, 255, 0.035);
  --nav-bg-rgb: 37, 34, 50;
  --nav-border: rgba(255, 255, 255, 0.12);
  --nav-shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
  --nav-text: #f4efff;
  --nav-muted: rgba(244, 239, 255, 0.78);
  --nav-accent: #c8a8ff;
  --nav-hover-bg: rgba(255, 255, 255, 0.08);
  --nav-hover-text: #ffffff;
  --hero-image-dim: 0.36;
}

/* Layout */
.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.section-anchor {
  scroll-margin-top: 110px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-150%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.6rem 0.8rem;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.nav-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  align-items: center;
  gap: 1rem;
  width: min(1264px, calc(100% - 2rem));
  min-height: 4.35rem;
  margin: 0 auto;
  border: 1px solid var(--nav-border);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgb(var(--nav-bg-rgb));
  box-shadow: var(--nav-shadow);
  color: var(--nav-text);
  padding: 0 1.25rem;
  transition:
    background-color var(--duration-medium) var(--ease-out),
    border-color var(--duration-medium) var(--ease-out),
    box-shadow var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-out);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.65rem;
  border-radius: 14px;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  color: var(--nav-text);
  font-weight: 800;
  letter-spacing: 0;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.brand:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-accent);
  transform: translateY(-1px);
}

.brand-logo {
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--color-accent) 38%, var(--color-border));
  border-radius: 12px;
  background: #050605;
  box-shadow: 0 0 24px color-mix(in srgb, #72ff3d 18%, transparent);
  object-fit: cover;
}

.brand-wordmark {
  color: var(--nav-accent);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1;
}

.nav-list,
.nav-actions,
.mobile-menu {
  display: flex;
  align-items: center;
}

.nav-list {
  justify-self: center;
  gap: clamp(0.55rem, 2.4vw, 1.6rem);
}

.nav-list a,
.mobile-menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  border-radius: var(--radius);
  padding: 0 0.95rem;
  color: var(--nav-muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-list .ui-icon {
  display: none;
}

.mobile-menu a {
  color: var(--color-muted);
}

.nav-list a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
}

.mobile-menu a:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.nav-actions {
  justify-self: end;
  gap: 0.4rem;
}

.icon-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--nav-muted);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.icon-button:hover {
  border-color: var(--nav-border);
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
  transform: translateY(-1px);
}

.theme-icon {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
}

.menu-toggle {
  display: none;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform var(--duration-medium) var(--ease-smooth), opacity var(--duration-medium) var(--ease-out);
}

.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
}

.ui-icon {
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.hero {
  position: relative;
  display: flex;
  min-height: 54vh;
  overflow: hidden;
  align-items: center;
  margin-top: -5.5rem;
  padding: 7.2rem 0 6.6rem;
  background: #20151d;
  color: #fff;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
}

.hero-copy-wrap {
  position: relative;
  max-width: 760px;
  width: 100%;
  text-align: center;
  animation: heroTextIn 900ms var(--ease-smooth) both 120ms;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: currentColor;
  font-family: "Space Grotesk", var(--font-body);
  font-size: clamp(4.2rem, 11vw, 8.2rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.hero-word {
  display: inline-flex;
  position: relative;
}

.hero-letter {
  display: inline-block;
  position: relative;
}

.owl-mascot {
  position: absolute;
  z-index: 1100;
  top: 0;
  left: 0;
  width: clamp(3.9rem, 7vw, 5.25rem);
  aspect-ratio: 1;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  clip-path: ellipse(40% 47% at 50% 50%);
  transform: translate3d(0, 0, 0);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.22, 0.8, 0.25, 1), opacity 360ms var(--ease-reveal);
  will-change: transform, opacity;
  contain: layout paint;
}

.owl-mascot.is-ready {
  opacity: 1;
}

.owl-mascot-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.45rem 0.75rem rgba(0, 0, 0, 0.28));
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

.owl-mascot.is-dragging {
  cursor: grabbing;
  transition: none;
}

.hero-copy {
  margin: 1.05rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Space Grotesk", var(--font-body);
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  font-weight: 500;
  line-height: 1.2;
}

.hero .eyebrow {
  color: #f2d4e4;
}

.hero-backdrop,
.hero-carousel,
.hero-slide,
.hero-grid,
.hero-glow,
.hero-waves {
  position: absolute;
  pointer-events: none;
}

.hero-backdrop {
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-carousel {
  inset: 0;
  z-index: 0;
}

.hero-carousel::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, var(--hero-image-dim));
  content: "";
}

.hero-slide {
  inset: -8%;
  background-position: center top;
  background-size: cover;
  opacity: 0;
  transform: scale(1.04);
  animation: heroSlide 18s linear infinite;
}

.hero-grid {
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 78%);
  opacity: 0.45;
}

.hero-glow {
  display: none;
}

.hero-glow-one {
  left: 8%;
  top: 18%;
  background: rgba(208, 154, 184, 0.58);
  animation: floatOne 11s ease-in-out infinite alternate;
}

.hero-glow-two {
  right: 8%;
  bottom: 12%;
  background: rgba(96, 165, 250, 0.38);
  animation: floatTwo 13s ease-in-out infinite alternate;
}

.hero-waves {
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 3;
  width: 100%;
  height: 104px;
}

.hero-waves use {
  fill: var(--color-bg);
}

.hero-waves use:nth-child(1) {
  opacity: 0.28;
}

.hero-waves use:nth-child(2) {
  opacity: 0.45;
}

.hero-waves use:nth-child(3) {
  opacity: 0.72;
}

.hero-waves use:nth-child(4) {
  opacity: 1;
}

.page-grid {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 4rem;
}

.sidebar {
  position: static;
  display: grid;
  gap: 1rem;
}

.content-column {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.content-section,
.side-card,
.tool-card,
.post-card,
.prose-card,
.modal-card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.content-section {
  padding: clamp(1rem, 3vw, 1.5rem);
  animation: fadeInUp 480ms ease both;
}

[data-theme="dark"] .content-section,
[data-theme="dark"] .side-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .post-card,
[data-theme="dark"] .prose-card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .weather-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--color-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .content-section,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .article-card {
  border-color: rgba(255, 255, 255, 0.12);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-copy {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.reveal-on-scroll.reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 0.9rem, 0);
  animation: none !important;
  transition:
    opacity 680ms var(--ease-reveal),
    transform 680ms var(--ease-reveal);
}

.reveal-on-scroll.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.side-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sidebar-card-border);
  border-radius: 24px;
  background: var(--sidebar-card-bg);
  padding: 1.05rem;
  box-shadow: var(--sidebar-card-shadow);
  animation: fadeInUp 720ms var(--ease-smooth) both;
  transition:
    border-color var(--duration-medium) var(--ease-out),
    background-color var(--duration-medium) var(--ease-out),
    box-shadow var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-smooth);
}

.side-card:hover {
  transform: translateY(-2px);
}

.side-card::before {
  content: none;
}

.profile-card {
  display: grid;
  gap: 1rem;
  padding: 0.85rem 0.85rem 1.35rem;
}

.profile-display {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  text-align: center;
}

.avatar {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--sidebar-image-bg);
  color: var(--sidebar-accent);
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: none;
}

.avatar-image {
  background: #050605;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card h2 {
  margin: 0;
  color: var(--sidebar-card-text);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
}

.profile-bio,
.post-excerpt,
.tool-card-header p,
.timeline-org,
.timeline-desc {
  color: var(--color-muted);
}

.profile-role {
  margin: -0.2rem 0 0;
  color: var(--sidebar-card-muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.profile-links,
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profile-card .profile-links {
  justify-content: center;
  gap: 1.15rem;
  margin-top: 0.1rem;
}

.profile-links a,
.footer-inner a,
.tag,
.category-link,
.meta-pill {
  border-radius: 999px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.profile-links a {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--sidebar-accent);
}

.profile-links a:first-child {
  background: transparent;
  color: var(--sidebar-accent);
  box-shadow: none;
}

.profile-social .ui-icon {
  width: 1.28rem;
  height: 1.28rem;
}

.profile-links a:hover {
  background: transparent;
  color: var(--sidebar-accent-hover);
  box-shadow: none;
  transform: translateY(-1px);
}

.profile-links a:first-child:hover {
  background: transparent;
  color: var(--sidebar-accent-hover);
}

.footer-inner a:hover,
.tag:hover,
.category-link:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.footer-inner a {
  min-height: 2.75rem;
  align-items: center;
}

.category-link.is-active {
  background: transparent;
  color: var(--sidebar-card-text);
}

.side-heading {
  position: relative;
  margin-bottom: 0.9rem;
  padding-left: 1rem;
  color: var(--sidebar-card-text);
  font-size: 1.35rem;
  font-weight: 800;
}

.side-heading::before {
  position: absolute;
  left: 0;
  top: 0.18rem;
  width: 5px;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--sidebar-accent);
  content: "";
}

.taxonomy-list {
  display: grid;
  gap: 0.6rem;
}

.category-link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 2.75rem;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 0.45rem 0 0.35rem;
  color: var(--sidebar-card-muted);
  font-size: 1rem;
  font-weight: 500;
}

.category-link::after {
  content: none;
}

.category-link:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.sidebar .category-link:hover {
  background: transparent;
  color: var(--sidebar-card-text);
}

.category-icon {
  display: none;
}

.category-label {
  min-width: 0;
  overflow: hidden;
  color: var(--sidebar-card-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  min-width: 1.9rem;
  border: 0;
  border-radius: 7px;
  background: var(--sidebar-chip-bg);
  color: var(--sidebar-chip-text);
  padding: 0.18rem 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag,
.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.sidebar .tag-list {
  justify-content: center;
  gap: 0.55rem;
}

.sidebar .tag {
  border: 0;
  border-radius: 7px;
  background: var(--sidebar-chip-bg);
  color: var(--sidebar-chip-text);
  min-height: 2.75rem;
  padding: 0.34rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 500;
}

.sidebar .tag:hover {
  background: var(--sidebar-chip-bg-hover);
  color: var(--sidebar-card-text);
}

.post-list {
  display: grid;
  gap: 1.15rem;
}

#posts {
  border: 0;
  background: transparent;
  padding: 0;
}

#posts .section-heading {
  margin-bottom: 1.15rem;
  border-bottom: 0;
  padding-bottom: 0;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14.5rem;
  gap: 0;
  overflow: hidden;
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--color-border) 82%, transparent);
  box-shadow: 0 14px 34px var(--color-card-lift);
  animation: fadeInUp 720ms var(--ease-smooth) both;
  transition:
    border-color var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-smooth),
    background-color var(--duration-medium) var(--ease-out),
    box-shadow var(--duration-medium) var(--ease-out);
}

.post-card:nth-child(2) {
  animation-delay: 60ms;
}

.post-card:nth-child(3) {
  animation-delay: 120ms;
}

.post-card:nth-child(4) {
  animation-delay: 180ms;
}

.post-card:nth-child(5) {
  animation-delay: 240ms;
}

.post-card:nth-child(6) {
  animation-delay: 300ms;
}

.post-card:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  box-shadow: 0 18px 42px var(--color-card-lift);
  transform: translateY(-4px);
}

.post-card.is-category-match {
  border-color: color-mix(in srgb, var(--color-accent) 52%, var(--color-border));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--color-accent) 16%, transparent);
}

.post-body {
  padding: 1rem 1.1rem;
}

.post-card h3 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1.2;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.75rem 0;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.post-meta .ui-icon {
  color: var(--color-accent);
}

.post-excerpt {
  margin: 0 0 0.9rem;
}

.post-cover {
  position: relative;
  display: block;
  min-height: 13.25rem;
  overflow: hidden;
  border-radius: 0 22px 22px 0;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
  background: var(--color-accent-soft);
  color: #fff;
}

.post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.04);
  transform: scale(1.02);
  transition: transform 760ms var(--ease-smooth), filter var(--duration-medium) var(--ease-out);
}

.post-cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 17, 15, 0.02), rgba(17, 17, 15, 0.34)),
    radial-gradient(circle at 80% 20%, rgba(208, 154, 184, 0.12), transparent 42%);
  transition: background-color 220ms ease;
}

.post-cover-marker {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 2.15rem;
  font-weight: 700;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.32);
}

.post-cover-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.5rem;
  height: 4.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  opacity: 0;
  transform: translate(-62%, -50%);
  transition: opacity 220ms ease, transform 220ms ease;
}

.post-card:hover .post-cover img {
  filter: brightness(0.82);
  transform: scale(1.08);
}

.post-card:hover .post-cover-icon {
  opacity: 0.95;
  transform: translate(-50%, -50%);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Tools */
.tool-tabs,
.sub-tabs,
.button-row,
.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 100%;
  min-width: 0;
}

.tool-tabs {
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 7%, transparent), transparent 44%),
    var(--color-surface-soft);
  padding: 0.38rem;
}

.tab-button,
.sub-tab,
.primary-button,
.secondary-button,
.small-button,
.chip-button {
  min-height: 2.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-muted);
  padding: 0 0.8rem;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.tab-button {
  border-color: transparent;
  background: transparent;
}

.tab-button,
.footer-inner a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.tab-button:hover,
.sub-tab:hover,
.secondary-button:hover,
.small-button:hover,
.chip-button:hover {
  border-color: var(--color-border-strong);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.tab-button:active,
.sub-tab:active,
.primary-button:active,
.secondary-button:active,
.small-button:active,
.chip-button:active,
.icon-button:active {
  transform: translateY(1px) scale(0.985);
}

.tab-button.is-active,
.sub-tab.is-active,
.chip-button.is-active,
.primary-button {
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  background: var(--color-accent);
  color: var(--color-surface);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.tool-panel,
.sub-panel {
  display: none;
}

.tool-panel.is-active,
.sub-panel.is-active {
  display: block;
}

.tool-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 1.15rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 7%, transparent), transparent 36%),
    linear-gradient(180deg, var(--color-surface), var(--color-surface-soft));
  box-shadow: 0 16px 36px var(--color-card-lift);
  transition:
    border-color var(--duration-medium) var(--ease-out),
    background-color var(--duration-medium) var(--ease-out),
    box-shadow var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-smooth);
}

.tool-card:hover {
  transform: translateY(-2px);
}

.tool-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-good) 70%, var(--color-accent)));
  content: "";
}

[data-theme="dark"] .tool-card::before {
  background: linear-gradient(90deg, var(--color-accent), #8fcfa7, #bd8cff);
  opacity: 0.8;
}

.tool-card-header {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.tool-card-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.tool-card-header p {
  margin: 0.15rem 0 0;
}

.status-pill {
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-good) 12%, transparent);
  color: var(--color-good);
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sub-tabs {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.wide {
  grid-column: 1 / -1;
}

.output-row,
.result-row,
.score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.output-row,
.result-row {
  justify-content: space-between;
  min-height: 3.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 0.7rem 0.8rem;
}

.output-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.mono-output,
.hash-value,
.code-output,
.code-input {
  font-family: var(--font-mono);
}

.mono-output,
.hash-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-accent);
  font-size: 0.9rem;
}

.meter-block,
.field-block,
.stack,
.editor-pane {
  display: grid;
  gap: 0.45rem;
}

.field-label,
.meter-label,
.tool-status {
  min-width: 0;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.meter-label {
  display: flex;
  justify-content: space-between;
}

.meter-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-bg-soft);
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
  transition: width 180ms ease, background-color 180ms ease;
}

input[type="range"] {
  width: 100%;
  min-height: 2.75rem;
  accent-color: var(--color-accent);
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.checkbox-grid legend {
  padding: 0 0.35rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--color-accent);
}

.history-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 0.75rem;
}

.is-hidden {
  display: none !important;
}

.history-list,
.result-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.text-input,
.code-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  color: var(--color-text);
  padding: 0.75rem 0.85rem;
}

.text-input:focus,
.code-input:focus {
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
  outline: none;
}

.score-row {
  display: grid;
  grid-template-columns: auto auto minmax(160px, 1fr);
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 6%, transparent), transparent 58%),
    var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.score-row strong {
  justify-self: start;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.criterion {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 0.6rem 0.7rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.criterion span {
  display: inline-grid;
  min-width: 1.8rem;
  min-height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  background: var(--color-bg-soft);
  color: var(--color-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.criterion.is-ok {
  border-color: color-mix(in srgb, var(--color-good) 35%, var(--color-border));
  color: var(--color-good);
}

.criterion.is-ok span {
  background: color-mix(in srgb, var(--color-good) 15%, transparent);
  color: var(--color-good);
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tips-box,
.use-box,
.loading-box,
.error-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 0.85rem;
  color: var(--color-muted);
}

.tips-box {
  white-space: pre-line;
}

.split-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.code-input,
.code-output {
  min-height: 260px;
  resize: vertical;
  line-height: 1.55;
  white-space: pre-wrap;
}

.code-input.short {
  min-height: 92px;
}

.code-output {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  color: var(--color-accent);
  padding: 0.85rem;
}

.code-output.is-error,
.tool-status.is-error,
.error-box {
  color: var(--color-bad);
}

.tool-status.is-ok {
  color: var(--color-good);
}

.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-spinner {
  position: absolute;
  right: 0.8rem;
  top: 2.55rem;
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.search-spinner.is-visible {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 5;
  display: none;
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.search-results.is-open {
  display: grid;
}

.search-result {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  padding: 0.7rem 0.8rem;
  text-align: left;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover {
  background: var(--color-accent-soft);
}

.weather-card {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 1rem;
}

.weather-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.weather-place {
  margin: 0;
  font-size: 1.35rem;
}

.weather-meta,
.weather-desc,
.daily-card small {
  color: var(--color-muted);
}

.weather-temp {
  color: var(--color-accent);
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1;
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.weather-stat,
.daily-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 0.75rem;
}

.weather-stat strong {
  display: block;
  color: var(--color-text);
}

.hourly-panel {
  display: grid;
  min-width: 0;
  gap: 0.7rem;
}

.hourly-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hourly-panel-head .field-label { 
  margin: 0;
}

.hourly-head-tools,
.hourly-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hourly-subtitle {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.hourly-nav-button {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.hourly-nav-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.hourly-rail {
  display: grid;
  grid-auto-columns: minmax(6.5rem, 7.4rem);
  grid-auto-flow: column;
  gap: 0.55rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  margin: 0;
  padding: 0 0 0.45rem;
  list-style: none;
  scroll-padding-inline: 0.15rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border)) transparent;
}

.hourly-card {
  display: grid;
  align-content: start;
  gap: 0.28rem;
  min-height: 9rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 4px);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-accent) 8%, transparent), transparent 62%),
    var(--color-surface);
  padding: 0.58rem 0.5rem;
  scroll-snap-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.hourly-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-accent) 42%, var(--color-border));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--color-accent) 12%, transparent);
}

.hourly-card.is-now {
  border-color: color-mix(in srgb, var(--color-accent) 62%, var(--color-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 28%, transparent);
}

.hourly-card.is-clear {
  background:
    linear-gradient(160deg, rgba(245, 158, 11, 0.16), transparent 58%),
    var(--color-surface);
}

.hourly-card.is-partly {
  background:
    linear-gradient(160deg, rgba(14, 165, 233, 0.13), transparent 58%),
    var(--color-surface);
}

.hourly-card.is-rain,
.hourly-card.is-storm {
  background:
    linear-gradient(160deg, rgba(37, 99, 235, 0.14), transparent 58%),
    var(--color-surface);
}

.hourly-card.is-snow,
.hourly-card.is-fog {
  background:
    linear-gradient(160deg, rgba(20, 184, 166, 0.12), transparent 58%),
    var(--color-surface);
}

.hourly-time,
.hourly-day,
.hourly-meta {
  color: var(--color-muted);
  font-size: 0.7rem;
}

.hourly-time {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.hourly-day {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.1;
  text-align: center;
}

.hourly-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding-top: 0.12rem;
}

.weather-icon-pill {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 13%, transparent);
  color: var(--color-accent);
}

.weather-icon-pill .ui-icon {
  width: 1.36rem;
  height: 1.36rem;
  stroke-width: 2.15;
}

.weather-icon-pill.is-clear {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.weather-icon-pill.is-partly {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
}

.weather-icon-pill.is-rain,
.weather-icon-pill.is-storm {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

.weather-icon-pill.is-snow,
.weather-icon-pill.is-fog {
  background: rgba(20, 184, 166, 0.14);
  color: #0f766e;
}

[data-theme="dark"] .weather-icon-pill.is-clear {
  color: #fbbf24;
}

[data-theme="dark"] .weather-icon-pill.is-partly {
  color: #7dd3fc;
}

[data-theme="dark"] .weather-icon-pill.is-rain,
[data-theme="dark"] .weather-icon-pill.is-storm {
  color: #93c5fd;
}

[data-theme="dark"] .weather-icon-pill.is-snow,
[data-theme="dark"] .weather-icon-pill.is-fog {
  color: #5eead4;
}

.hourly-temp {
  color: var(--color-text);
  font-size: 1.18rem;
  line-height: 1;
}

.hourly-condition {
  display: -webkit-box;
  min-height: 1.72rem;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hourly-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.22rem;
  line-height: 1.15;
}

.hourly-meta span {
  border: 1px solid color-mix(in srgb, var(--color-accent) 16%, var(--color-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  padding: 0.12rem 0.32rem;
  white-space: nowrap;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.daily-card {
  border-color: var(--color-border);
  color: var(--color-muted);
}

.daily-card.is-active {
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  color: var(--color-accent);
}

.daily-card:hover {
  border-color: var(--color-border-strong);
}

/* Content */
.prose-card {
  padding: 1rem;
}

.prose-card p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.prose-card p:last-child {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.stat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-soft);
  padding: 0.8rem;
}

.stat-card strong {
  display: block;
  color: var(--color-accent);
  font-size: 1.35rem;
}

.stat-card span {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.skill-groups {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.skill-group {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.skill-group h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skill-button {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.65rem 0.75rem;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.skill-button:hover {
  border-color: var(--color-border-strong);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.skill-button span {
  display: block;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0.95rem;
  margin: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  overflow: hidden;
  border: 1px solid var(--timeline-border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 0%, var(--timeline-glow), transparent 34%),
    linear-gradient(135deg, var(--timeline-sheen), transparent 42%),
    var(--timeline-card-bg);
  padding: 1rem 1.1rem;
  color: var(--timeline-card-text);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--color-card-lift) 75%, transparent);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 999px;
  background: var(--timeline-accent);
  content: "";
  opacity: 0.95;
}

.timeline-item:hover {
  border-color: var(--timeline-border-hover);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--color-card-lift) 88%, transparent);
  transform: translateY(-2px);
}

.timeline-period {
  min-width: 4rem;
  border-radius: 999px;
  background: var(--timeline-chip-bg);
  color: var(--timeline-chip-text);
  padding: 0.34rem 0.62rem;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.timeline-item h3 {
  grid-column: 2;
  margin: 0;
  color: var(--timeline-card-text);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.2;
}

.timeline-org,
.timeline-desc {
  grid-column: 2;
  margin: 0.15rem 0 0;
}

.timeline-org {
  color: var(--timeline-chip-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline-desc {
  color: var(--timeline-card-muted);
  line-height: 1.62;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 6%, transparent), transparent 52%),
    var(--color-surface-soft);
  padding: 0.95rem;
  overflow: hidden;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.contact-card:hover {
  border-color: color-mix(in srgb, var(--color-accent) 42%, var(--color-border));
  background: var(--color-accent-soft);
  box-shadow: 0 14px 32px var(--color-card-lift);
  transform: translateY(-1px);
}

.contact-icon {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-accent);
}

.contact-content {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.contact-card strong {
  color: var(--color-text);
  font-size: 0.98rem;
}

.contact-value {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-arrow {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--color-faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  transform: translateX(-0.2rem);
  transition: color 160ms ease, transform 160ms ease;
}

.contact-card:hover .contact-arrow {
  color: var(--color-accent);
  transform: translateX(0);
}

/* Modal and footer */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  padding: 1rem;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 1.3rem;
}

.modal-card h2 {
  margin: 0 0 0.6rem;
}

.modal-card p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.modal-close {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
}

.use-box {
  margin-top: 1rem;
}

.use-box strong {
  color: var(--color-text);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  color: var(--color-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner a {
  padding: 0.25rem 0.4rem;
  color: var(--color-muted);
}

/* Article pages */
.post-page {
  min-height: 100vh;
}

.post-nav-actions {
  display: flex;
  align-items: center;
  grid-column: 2 / 4;
  justify-self: end;
  gap: 0.45rem;
}

.post-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-nav a {
  min-height: 2.5rem;
  border-radius: 12px;
  padding: 0 0.8rem;
  color: var(--nav-muted);
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.post-nav a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
}

.article-page {
  width: min(980px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.article-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 18px 48px var(--color-card-lift);
  animation: fadeInUp 420ms ease both;
}

.article-cover {
  position: relative;
  height: clamp(220px, 38vw, 420px);
  overflow: hidden;
  background: var(--color-accent-soft);
}

.article-cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.28));
  content: "";
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: articleCoverIn 700ms ease both;
}

.article-body {
  padding: clamp(1.2rem, 4vw, 2.4rem);
}

.article-body h1 {
  max-width: 850px;
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2.35rem, 7vw, 4.4rem);
  line-height: 1;
}

.article-meta {
  margin: 1rem 0;
}

.article-prose {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  margin-top: 1.4rem;
  color: var(--color-muted);
  font-size: 1.06rem;
}

.article-prose p {
  margin: 0;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.article-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

@keyframes articleCoverIn {
  from {
    transform: scale(1.06);
    filter: saturate(0.8);
  }
  to {
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(0.9rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translate3d(0, 0.75rem, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes ambientDrift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@keyframes heroSlide {
  0% {
    opacity: 0;
    transform: scale(1.04);
  }
  7%,
  33% {
    opacity: 1;
  }
  41%,
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 46px 46px;
  }
}

@keyframes floatOne {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2rem, 1rem, 0) scale(1.08);
  }
}

@keyframes floatTwo {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2rem, -1.3rem, 0) scale(1.1);
  }
}

@keyframes waveMove {
  from {
    transform: translate3d(-90px, 0, 0);
  }
  to {
    transform: translate3d(85px, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Responsive */
@media (max-width: 1020px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: minmax(15rem, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .profile-card {
    grid-column: auto;
  }

  .profile-card .avatar {
    max-width: 15rem;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  :root {
    --radius: 14px;
  }

  .nav-shell {
    grid-template-columns: 1fr auto;
    width: min(100% - 1rem, var(--container));
    min-height: 4rem;
    padding: 0 0.75rem;
  }

  .nav-list {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .mobile-menu {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 4.65rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgb(var(--nav-bg-rgb));
    box-shadow: var(--nav-shadow);
    opacity: 0;
    padding: 0.45rem;
    pointer-events: none;
    transform: translate3d(0, -0.55rem, 0) scale(0.985);
    transform-origin: top center;
    visibility: hidden;
    transition:
      opacity var(--duration-medium) var(--ease-out),
      transform var(--duration-medium) var(--ease-smooth),
      visibility 0s linear var(--duration-medium),
      background-color var(--duration-medium) var(--ease-out),
      border-color var(--duration-medium) var(--ease-out);
  }

  .mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    visibility: visible;
    transition-delay: 0s;
  }

  .mobile-menu a {
    justify-content: center;
    gap: 0.32rem;
    min-height: 3.15rem;
    border-radius: 12px;
    padding: 0.35rem 0.2rem;
    color: var(--nav-muted);
    font-size: 0.76rem;
    line-height: 1.1;
    text-align: center;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-0.35rem);
    transition:
      opacity var(--duration-medium) var(--ease-out),
      transform var(--duration-medium) var(--ease-smooth),
      background-color var(--duration-fast) var(--ease-out),
      color var(--duration-fast) var(--ease-out);
  }

  .mobile-menu.is-open a {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-menu.is-open a:nth-child(2) {
    transition-delay: 35ms;
  }

  .mobile-menu.is-open a:nth-child(3) {
    transition-delay: 70ms;
  }

  .mobile-menu.is-open a:nth-child(4) {
    transition-delay: 105ms;
  }

  .mobile-menu.is-open a:nth-child(5) {
    transition-delay: 140ms;
  }

  .mobile-menu .ui-icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .post-nav {
    display: none;
  }

  .post-page .post-nav-actions {
    grid-column: auto;
    gap: 0.4rem;
  }

  .post-page .post-nav {
    display: flex;
  }

  .post-page .post-nav a {
    display: none;
  }

  .post-page .post-nav a:first-child {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    background: var(--nav-hover-bg);
    padding: 0 0.75rem;
    color: var(--nav-text);
  }

  .hero {
    min-height: 390px;
    margin-top: -5rem;
    padding: 6.35rem 0 4.7rem;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-column: 1;
  }

  .profile-display {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .profile-card .avatar {
    width: 6.5rem;
    max-width: none;
  }

  .profile-card h2,
  .profile-role {
    grid-column: 2;
  }

  .profile-card h2 {
    font-size: 1.35rem;
  }

  .profile-role {
    margin-top: -0.55rem;
  }

  .profile-card .profile-links {
    justify-content: flex-start;
    margin-left: 7.35rem;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-body {
    padding: 1rem;
  }

  .post-cover {
    min-height: clamp(9.5rem, 43vw, 13rem);
    clip-path: none;
    border-radius: 22px 22px 0 0;
    order: -1;
  }

  .tool-tabs,
  .sub-tabs,
  .mode-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 0.45rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.1rem, #000 calc(100% - 1.1rem), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 1.1rem, #000 calc(100% - 1.1rem), transparent);
  }

  .tool-tabs::-webkit-scrollbar,
  .sub-tabs::-webkit-scrollbar,
  .mode-buttons::-webkit-scrollbar {
    display: none;
  }

  .tool-tabs {
    margin-right: -0.15rem;
    margin-left: -0.15rem;
  }

  .tab-button,
  .sub-tab,
  .chip-button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .timeline-period,
  .timeline-item h3,
  .timeline-org,
  .timeline-desc {
    grid-column: 1;
  }

  .timeline-period {
    justify-self: start;
  }

  .split-editor,
  .form-grid,
  .contact-grid,
  .weather-stats,
  .daily-grid {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .hourly-rail {
    grid-auto-columns: minmax(6rem, 30vw);
  }

  .article-page {
    width: min(100% - 1rem, 980px);
    margin: 1rem auto 3rem;
  }

  .article-cover {
    height: clamp(180px, 48vw, 260px);
  }

  .article-body h1 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .article-prose {
    font-size: 1rem;
    line-height: 1.65;
  }
}

@media (max-width: 560px) {
  .container,
  .nav-shell {
    width: min(100% - 0.85rem, var(--container));
  }

  .nav-shell {
    min-height: 3.45rem;
    border-radius: 0 0 16px 16px;
  }

  .brand {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .brand-logo {
    width: 2.05rem;
    height: 2.05rem;
  }

  .brand-wordmark {
    font-size: 0.98rem;
  }

  .nav-actions {
    gap: 0.15rem;
  }

  .icon-button {
    width: 2.75rem;
    height: 2.75rem;
  }

  .mobile-menu {
    left: 0.55rem;
    right: 0.55rem;
    top: 4.05rem;
  }

  .mobile-menu a {
    min-height: 2.9rem;
    font-size: 0.68rem;
  }

  .hero {
    min-height: 335px;
    padding: 5.55rem 0 4.05rem;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 17vw, 4.35rem);
  }

  .hero-copy {
    margin-top: 0.65rem;
    font-size: 1.02rem;
  }

  .hero-waves {
    height: 58px;
  }

  .page-grid {
    gap: 1rem;
    padding-bottom: 2.75rem;
  }

  .content-section,
  .tool-card,
  .side-card,
  .prose-card {
    padding: 0.78rem;
  }

  .side-card {
    border-radius: 18px;
  }

  .profile-card {
    padding: 0.72rem;
  }

  .profile-display {
    grid-template-columns: 5.25rem minmax(0, 1fr);
    gap: 0.7rem;
  }

  .profile-card .avatar {
    width: 5.25rem;
    border-radius: 10px;
  }

  .profile-card h2 {
    font-size: 1.18rem;
  }

  .profile-role {
    font-size: 0.9rem;
  }

  .profile-card .profile-links {
    margin-left: 5.95rem;
    gap: 0.85rem;
  }

  .side-heading {
    margin-bottom: 0.65rem;
    font-size: 1.12rem;
  }

  .category-link {
    min-height: 2.75rem;
    font-size: 0.92rem;
  }

  .sidebar .tag {
    padding: 0.27rem 0.52rem;
    font-size: 0.78rem;
  }

  .post-list {
    gap: 0.9rem;
  }

  .post-card {
    border-radius: 18px;
  }

  .post-body {
    padding: 0.85rem;
  }

  .post-card h3 {
    font-size: 1.18rem;
  }

  .post-meta {
    gap: 0.42rem;
    margin: 0.55rem 0;
    font-size: 0.68rem;
  }

  .post-excerpt {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .post-cover {
    border-radius: 18px 18px 0 0;
  }

  .section-heading,
  .tool-card-header,
  .hourly-panel-head,
  .weather-hero,
  .footer-inner {
    flex-direction: column;
    align-items: start;
  }

  .input-with-button,
  .result-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-tabs {
    gap: 0.35rem;
    margin-bottom: 0.8rem;
    border-radius: 16px;
    padding: 0.32rem;
  }

  .tab-button,
  .sub-tab,
  .primary-button,
  .secondary-button,
  .small-button,
  .chip-button {
    min-height: 2.875rem;
    border-radius: 12px;
    padding: 0 0.66rem;
    font-size: 0.88rem;
  }

  .tool-card-header {
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .tool-card-header h3 {
    font-size: 1.18rem;
  }

  .tool-card-header p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .status-pill {
    padding: 0.16rem 0.46rem;
    font-size: 0.64rem;
  }

  .form-grid {
    gap: 0.75rem;
  }

  .output-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    min-height: 0;
    padding: 0.65rem;
  }

  .output-row .small-button {
    width: 100%;
  }

  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .checkbox-grid label {
    font-size: 0.86rem;
  }

  .code-input,
  .code-output {
    min-height: 190px;
  }

  .code-input.short {
    min-height: 86px;
  }

  .weather-card {
    gap: 0.8rem;
    padding: 0.78rem;
  }

  .weather-stats,
  .daily-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-stat,
  .daily-card {
    padding: 0.65rem;
  }

  .hourly-head-tools {
    width: 100%;
    justify-content: space-between;
  }

  .hourly-rail {
    grid-auto-columns: minmax(6rem, 44vw);
  }

  .article-page {
    width: min(100% - 0.85rem, 980px);
    margin-top: 0.85rem;
  }

  .article-cover {
    height: clamp(155px, 52vw, 220px);
  }

  .article-body {
    padding: 1rem;
  }

  .article-body h1 {
    font-size: clamp(1.85rem, 11vw, 2.55rem);
  }

  .article-meta {
    margin: 0.75rem 0;
  }

  .article-prose {
    gap: 0.85rem;
    margin-top: 1rem;
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

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