* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

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

img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.zoomable {
  cursor: zoom-in;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1000;
}

.sidebar-top h1 {
  margin: 0 0 20px;
  font-size: 1.3rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.48);
}

.lang-switch a {
  color: rgba(255, 255, 255, 0.48);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.lang-switch a:hover {
  color: rgba(255, 255, 255, 0.82);
}

.lang-switch a.active {
  color: #fff;
  font-weight: 600;
}

.lang-switch span {
  color: rgba(255, 255, 255, 0.28);
}
.sidebar-top nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.72);
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.72;
}

.nav-label {
  flex: 1;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #009AFF;
  background: rgba(0, 154, 255, 0.08);
  border-color: rgba(0, 154, 255, 0.25);
}

.nav-link.active .nav-icon {
  color: #009AFF;
  opacity: 1;
}

.tools-link {
  display: flex;
  align-items: center;
}


.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: #2f8cff;
  border: 1px solid #2f8cff;
  border-radius: 999px;
  background: rgba(47, 140, 255, 0.08);
}

.sidebar-bottom {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Main */
.main {
  margin-left: 240px;
  padding: 28px;
  min-width: 0;
}

/* Hero */
.hero {
  position: relative;
  height: 80vh;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
}

.hero-text {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

/* Works Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 120px;
  gap: 20px;
}

.work-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card.large {
  grid-column: span 7;
  grid-row: span 5;
}

.work-card.tall {
  grid-column: span 5;
  grid-row: span 5;
}

.work-card.small {
  grid-column: span 4;
  grid-row: span 4;
}

/* 不要圖片下面文字 */
.work-info {
  display: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 92vw !important;
  max-height: 90vh !important;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain !important;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 42px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  user-select: none;
}

/* Homepage */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 680px;
}

.home-text {
  flex: 1;
  max-width: 560px;
}

/* =========================
   Global Typography
========================= */

h1 { font-size: clamp(2.8rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
h5 { font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
h6 { font-size: clamp(0.95rem, 1.5vw, 1.1rem); }

/* =========================
   Homepage Typography
========================= */

.home-text h1,
.home-text h2,
.home-text h3,
.home-text h4,
.home-text h5,
.home-text h6 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-text h1 {
  margin: 0 0 20px;
  font-size: clamp(3rem, 5.5vw, 6rem);
  line-height: 1.05;
  font-weight: 700;
}

.home-text h2 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 4.5vw, 4.8rem);
  line-height: 1.05;
}

.home-text h3 {
  margin: 0 0 20px;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.home-text h4 {
  margin: 0 0 14px;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: rgba(255, 255, 255, 0.82);
}

.home-text h5 {
  margin: 0 0 12px;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.72);
}

.home-text h6 {
  margin: 0 0 10px;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.6);
}

.home-text p {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
}

.home-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.home-image img {
  width: min(720px, 100%);
  max-height: 78vh;
  border-radius: 28px;
  object-fit: cover;
}

/* NASA APOD */
.daily-inspiration-section {
  width: 100%;
  max-width: 1200px;
  margin: -36px auto 72px;
}

.apod-card {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.apod-media-link {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.apod-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.apod-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.apod-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.apod-content h2 {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.2;
}

.apod-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.apod-date {
  margin-top: 12px !important;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45) !important;
}

/* Tech Updates */
.tech-news-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 72px;
}

.tech-news-header {
  margin-bottom: 20px;
}

.tech-news-header h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tech-news-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  line-height: 1.6;
}

.tech-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tech-news-card {
  min-height: 180px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tech-news-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.tech-news-category {
  margin-bottom: 12px;
  color: #8ab4ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tech-news-card h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.35;
}

.tech-news-card p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
  line-height: 1.65;
}

.tech-news-tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.tech-news-loading,
.tech-news-error {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
}

/* Hashtag */
.hashtag {
  color: #1d9bf0 !important;
  text-decoration: none;
}

.hashtag:hover {
  text-decoration: underline;
}

.past {
  color: #5CBAD3;
  font-weight: 600;
}

.present {
  color: #B5C76F;
  font-weight: 600;
}

.future {
  color: #913A79;
  font-weight: 600;
}

.eternal {
  color: #8A7AA5;
  font-weight: 600;
}

.beyond {
  color: #BF0D25;
  font-weight: 600;
}

.ex {
  background: linear-gradient(to bottom, #551F6B, #006898);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: 0.8px;
}

/* =========================
   Prism code block
========================= */

.code-block {
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 20px 22px 18px;
  margin: 24px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
}

.code-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-file {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
}

.code-lang {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.copy-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn svg {
  width: 22px;
  height: 22px;
}

.code-block pre[class*="language-"] {
  margin: 0;
  padding: 1.1rem 1rem !important;
  background: transparent !important;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.code-block code[class*="language-"] {
  display: block;
  min-width: max-content;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.98rem;
  line-height: 1.7;
  text-shadow: none !important;
}

.code-block pre,
.code-block code {
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
}

/* Line numbers */
.code-block pre.line-numbers {
  position: relative;
  padding-left: 3.8em !important;
}

.code-block pre.line-numbers > code {
  position: relative;
  white-space: inherit;
}

.code-block .line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: -3.8em;
  width: 3em;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.code-block .line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.code-block .line-numbers-rows > span::before {
  content: counter(linenumber);
  display: block;
  padding-right: 0.8em;
  text-align: right;
  color: rgba(255, 255, 255, 0.32);
}

/* Scrollbar */
.code-block pre[class*="language-"]::-webkit-scrollbar {
  height: 8px;
}

.code-block pre[class*="language-"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.code-block pre[class*="language-"]::-webkit-scrollbar-track {
  background: transparent;
}

.kw-red {
  color: #ff5f56;
}

.kw-blue {
  color: #33AAFF;
}

.kw-reddishpurple {
  color: #881144;
}

/* =========================
   About Page
========================= */

.about-page {
  max-width: 1280px;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: flex-start;
  padding: 56px 0;
}

.about-content {
  width: 100%;
}

.about-title {
  margin: 0 0 28px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.about-section-title {
  margin: 0 0 22px;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.interest-cards {
  display: grid;
  gap: 56px;
  margin-top: 28px;
}

.interest-card {
  display: block;
  padding: 8px 0;
}

.interest-card h4 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
}

.interest-gallery {
  width: 100%;
}

.interest-gallery img {
  width: 1000px !important;
  max-width: none !important;
  height: auto !important;
  border-radius: 18px;
  display: block;
}

.interest-note {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.galgame-showcase {
  width: 100%;
  max-width: 1000px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(70, 110, 160, 0.28);
}

.galgame-banner-link {
  display: block;
  margin-bottom: 24px;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.galgame-banner {
  width: 100% !important;
  max-width: 100% !important;
  height: 420px !important;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 10px;
  display: block;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.galgame-banner-link:hover .galgame-banner {
  transform: scale(1.015);
  filter: brightness(1.06);
}

.galgame-banner-meta {
  display: block;
  margin-top: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
}

.steam-favorites {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 24px;
  width: 100%;
}

.steam-game-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.steam-game-card img {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 600 / 900;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.steam-game-card:hover img {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.steam-game-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
}

.steam-game-name {
  display: block;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steam-game-hours {
  display: block;
  margin-top: 2px;
}

.steam-loading,
.steam-error {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
}

/* =========================
   Basic Motion
========================= */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-delay-1 {
  animation-delay: 0.12s;
}

.fade-in-delay-2 {
  animation-delay: 0.24s;
}

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

.work-card,
.tech-news-card,
.apod-card,
.project-update-card,
.hero-btn,
.contact-form button {
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.work-card:hover,
.apod-card:hover,
.project-update-card:hover {
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .work-card,
  .tech-news-card,
  .apod-card,
  .project-update-card,
  .hero-btn,
  .contact-form button {
    transition: none;
  }
}

/* Mobile */
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .main {
    margin-left: 0;
  }

  .work-card {
    grid-column: span 12 !important;
  }

  .hero {
    height: 52vh;
  }

  .home-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    min-height: auto;
  }

  .home-image {
    justify-content: flex-start;
  }

  .home-image img {
    width: 100%;
    max-height: none;
    border-radius: 22px;
  }
  
  .daily-inspiration-section,
  .tech-news-section {
    margin: 40px auto 56px;
  }

  .apod-card,
  .tech-news-grid {
    grid-template-columns: 1fr;
  }

  .apod-media-link {
    aspect-ratio: 16 / 9;
  }

  .tech-news-card {
    min-height: auto;
  }

  .code-block {
    padding: 16px 16px 14px;
    border-radius: 18px;
    margin: 18px 0;
  }

  .code-header {
    margin-bottom: 10px;
  }

  .code-lang {
    font-size: 0.95rem;
  }

  .copy-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .copy-btn svg {
    width: 20px;
    height: 20px;
  }

  .code-block code[class*="language-"] {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .code-block pre[class*="language-"] {
    padding: 1rem 0.9rem !important;
  }

  .code-block pre.line-numbers {
    padding-left: 3.6em !important;
  }

  .code-block .line-numbers .line-numbers-rows {
    left: -3.6em;
    width: 2.8em;
  }

  .interest-cards {
    gap: 34px;
  }

  .interest-gallery {
    grid-template-columns: 1fr;
  }

  .interest-gallery img {
    width: 100% !important;
    max-width: 100% !important;
  }

  .steam-favorites {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 16px;
  }

  .galgame-banner {
    height: 280px !important;
  }
}

/* CTA Buttons */
.hero-actions {
  margin-top: 22px;   /* 原本 18 → 稍微拉開 */
  display: flex;
  gap: 14px;          /* 原本 12 → 間距多一點 */
}

.hero-btn {
  padding: 11px 22px; /* 原本 8 16 → 放大 */
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;    /* 原本 0.9 → 變清楚 */
  font-weight: 500;   /* 新增：提升質感 */
  opacity: 0.85;
  transition: all 0.2s ease;
}

.hero-btn:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  margin: 12px 0 20px;
  letter-spacing: 1px;
}

/* =========================
   Contact Page
========================= */

.contact-page {
  width: 100%;
  max-width: 880px;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.contact-content {
  width: 100%;
}

.contact-eyebrow {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contact-intro {
  max-width: 620px;
  margin: 0 0 32px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.8;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(47, 140, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}

.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  padding: 12px 22px;
  border: 1px solid rgba(47, 140, 255, 0.85);
  border-radius: 999px;
  background: rgba(47, 140, 255, 0.16);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.contact-form button:hover {
  transform: translateY(-2px);
  background: rgba(47, 140, 255, 0.26);
  border-color: rgba(47, 140, 255, 1);
}

.contact-fallback {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.58);
}

.contact-fallback a {
  color: #fff;
  font-weight: 700;
}

@media (max-width: 900px) {
  .contact-field-grid {
    grid-template-columns: 1fr;
  }
}

.project-update-card {
  flex: 1;
  max-width: 520px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-update-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
}

.project-update-card h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.project-update-desc {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 14px;
}

.project-update-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* =========================
   Posts Page
========================= */

.posts-header {
  margin-bottom: 56px;
}

.posts-header h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.posts-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1rem;
  line-height: 1.7;
}

.post-card {
  padding: 0 0 32px;
  margin: 0 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  line-height: 1.3;
}

.post-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

.post-handle,
.post-dot,
.post-date {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.98rem;
}

.post-content {
  color: #f5f5f5;
  font-size: 1.35rem;
  line-height: 1.2;
  white-space: pre-line;
  margin-bottom: 24px;
}

.post-figure {
  margin: 0;
  width: 100%;
}

.post-image {
  width: 100%;
  max-width: 600px;
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-caption {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.42);
  text-align: left;
}

@media (max-width: 900px) {
  .posts-header {
    margin-bottom: 32px;
  }

  .post-card {
    padding: 0 0 24px;
    margin: 0 0 24px;
  }

  .post-meta {
    margin-bottom: 6px;
    gap: 8px;
    line-height: 1.2;
  }

  .post-content {
    font-size: 1.08rem;
    line-height: 1.35;
    margin-top: 0;
    margin-bottom: 12px;
  }

  .post-image {
    max-width: 100%;
    margin: 0;
  }

  .post-caption {
    font-size: 0.74rem;
    margin-top: 8px;
    text-align: left;
  }
}

/* =========================
   Liquid Glass Theme Layer
========================= */

:root {
  color-scheme: dark;
  --glass-bg: rgba(255, 255, 255, 0.075);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-bg-soft: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-soft: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.36);
  --glass-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --glass-shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.26);
  --glass-blur: 28px;
  --glass-blur-soft: 18px;
  --glass-radius-lg: 34px;
  --glass-radius-md: 24px;
  --glass-radius-sm: 18px;
  --glass-hover-y: -4px;
  --accent-blue: #8ec5ff;
  --accent-cyan: #8ff3ff;
  --accent-pink: #f3a7ff;
  --accent-lime: #cbffd8;
  --text-main: rgba(255, 255, 255, 0.94);
  --text-muted: rgba(255, 255, 255, 0.68);
  --text-soft: rgba(255, 255, 255, 0.48);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(98, 160, 255, 0.34), transparent 30vw),
    radial-gradient(circle at 76% 14%, rgba(235, 139, 255, 0.22), transparent 28vw),
    radial-gradient(circle at 66% 82%, rgba(96, 255, 218, 0.16), transparent 32vw),
    linear-gradient(135deg, #05070f 0%, #0d1020 42%, #070a13 100%);
  color: var(--text-main);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}

body::before {
  top: -18vh;
  right: -12vw;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 36%, rgba(255, 255, 255, 0.22), transparent 0 9%),
    radial-gradient(circle, rgba(82, 147, 255, 0.24), transparent 66%);
}

body::after {
  left: 20vw;
  bottom: -24vh;
  width: 54vw;
  height: 54vw;
  border-radius: 44%;
  background: radial-gradient(circle, rgba(140, 255, 228, 0.15), transparent 68%);
}

a,
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(142, 197, 255, 0.34);
  color: #fff;
}

.sidebar,
.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.contact-form,
.code-block,
.galgame-showcase,
.post-card,
.lightbox-img {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-soft);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
}

.sidebar,
.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.contact-form,
.code-block,
.galgame-showcase {
  position: relative;
}

.sidebar::before,
.home-hero::before,
.project-update-card::before,
.apod-card::before,
.tech-news-card::before,
.work-card::before,
.contact-form::before,
.code-block::before,
.galgame-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 32%),
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.18), transparent 22%);
  opacity: 0.7;
}

.sidebar {
  width: 260px;
  margin: 16px 0 16px 16px;
  height: calc(100vh - 32px);
  padding: 30px 22px;
  border-radius: var(--glass-radius-lg);
  border-right: 1px solid var(--glass-border);
}

.sidebar-top,
.sidebar-bottom,
.sidebar nav,
.lang-switch {
  position: relative;
  z-index: 1;
}

.sidebar-top h1 {
  margin-bottom: 22px;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.sidebar-top h1 a {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-switch {
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  width: fit-content;
}

.lang-switch a {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--text-soft);
}

.lang-switch a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.lang-switch span {
  color: rgba(255, 255, 255, 0.2);
}

.sidebar-top nav {
  gap: 8px;
  padding: 8px;
  border-radius: var(--glass-radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-top nav a {
  padding: 11px 12px;
  border-radius: 16px;
  color: var(--text-muted);
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sidebar-top nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

.beta-badge,
.tech-news-tag {
  color: var(--accent-blue);
  border-color: rgba(142, 197, 255, 0.42);
  background: rgba(142, 197, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.main {
  margin-left: 292px;
  padding: 40px;
}

.home-hero {
  min-height: 660px;
  padding: clamp(28px, 5vw, 68px);
  border-radius: var(--glass-radius-lg);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -14%;
  top: -20%;
  width: min(560px, 58vw);
  height: min(560px, 58vw);
  border-radius: 42%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.3), transparent 0 9%),
    radial-gradient(circle, rgba(142, 197, 255, 0.3), transparent 58%),
    radial-gradient(circle at 76% 72%, rgba(243, 167, 255, 0.24), transparent 48%);
  filter: blur(2px);
  opacity: 0.86;
  pointer-events: none;
}

.home-text,
.project-update-card,
.apod-content,
.tech-news-header,
.tech-news-card > *,
.contact-content,
.code-header,
.code-block pre,
.galgame-showcase > *,
.post-card > *,
.work-card > * {
  position: relative;
  z-index: 1;
}

.home-text h1,
.posts-header h1,
.contact-content h1,
.about-content > h1,
.main > h1 {
  color: #fff;
  text-shadow: 0 16px 54px rgba(142, 197, 255, 0.22);
}

.home-text h1 {
  background: linear-gradient(120deg, #fff 0%, #dcecff 38%, #d9fff7 68%, #f6dcff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-text p,
.home-text h3,
.home-text h4,
.home-text h5,
.home-text h6,
.project-update-desc,
.apod-content p,
.tech-news-header p,
.tech-news-card p,
.contact-intro,
.post-handle,
.post-dot,
.post-date,
.post-caption,
.steam-game-meta,
.interest-note {
  color: var(--text-muted);
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn,
.contact-form button,
.copy-btn {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(var(--glass-blur-soft)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur-soft)) saturate(1.35);
}

.hero-btn:hover,
.contact-form button:hover,
.copy-btn:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.project-update-card {
  background:
    radial-gradient(circle at 88% 18%, rgba(143, 243, 255, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
}

.project-update-label,
.apod-label,
.tech-news-category,
.contact-eyebrow {
  color: var(--accent-cyan);
}

.project-update-meta,
.hashtag,
.contact-fallback a {
  color: var(--accent-blue) !important;
}

.daily-inspiration-section,
.tech-news-section {
  position: relative;
}

.apod-card,
.tech-news-card,
.project-update-card {
  border-radius: var(--glass-radius-md);
}

.apod-media-link,
.post-image,
.work-card,
.home-image img,
.galgame-banner-link,
.galgame-banner,
.steam-game-card img {
  border-radius: var(--glass-radius-sm);
}

.apod-media-link,
.post-image,
.home-image img,
.interest-gallery img,
.galgame-banner,
.steam-game-card img {
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover {
  transform: translateY(var(--glass-hover-y));
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
    var(--glass-bg-strong);
  box-shadow: var(--glass-shadow);
}

.works-grid {
  gap: 22px;
}

.work-card {
  border-radius: var(--glass-radius-md);
  isolation: isolate;
}

.work-card img {
  transition: transform 0.35s ease, filter 0.35s ease;
}

.work-card:hover img {
  transform: scale(1.025);
  filter: saturate(1.08) brightness(1.04);
}

.code-block {
  border-radius: var(--glass-radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(11, 15, 28, 0.68)),
    rgba(10, 13, 24, 0.72);
}

.code-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block pre[class*="language-"] {
  background: rgba(255, 255, 255, 0.035) !important;
  border-radius: 18px;
}

.about-page,
.contact-page {
  max-width: 1120px;
}

.about-content,
.posts-header,
.contact-content,
.image-pool {
  position: relative;
}

.interest-card,
.post-card {
  border-radius: var(--glass-radius-md);
}

.interest-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(var(--glass-blur-soft));
  -webkit-backdrop-filter: blur(var(--glass-blur-soft));
}

.interest-gallery img {
  width: min(1000px, 100%) !important;
  max-width: 100% !important;
}

.galgame-showcase {
  max-width: 1000px;
  border-radius: var(--glass-radius-md);
}

.steam-game-card {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.steam-game-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.contact-form input,
.contact-form textarea {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(142, 197, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 4px rgba(142, 197, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.contact-status {
  margin: 0;
  color: var(--accent-lime);
}

.post-card {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.post-content {
  color: rgba(255, 255, 255, 0.9);
}

.lightbox {
  background:
    radial-gradient(circle at 50% 32%, rgba(142, 197, 255, 0.16), transparent 34%),
    rgba(3, 5, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-img {
  border-radius: var(--glass-radius-md);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .home-hero,
  .project-update-card,
  .apod-card,
  .tech-news-card,
  .work-card,
  .contact-form,
  .code-block,
  .galgame-showcase,
  .post-card {
    background: rgba(22, 27, 43, 0.92);
  }
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 18% 4%, rgba(98, 160, 255, 0.25), transparent 58vw),
      radial-gradient(circle at 86% 16%, rgba(235, 139, 255, 0.18), transparent 56vw),
      linear-gradient(145deg, #05070f 0%, #0d1020 100%);
  }

  .sidebar {
    width: auto;
    height: auto;
    margin: 12px;
    padding: 22px;
    border-radius: 28px;
  }

  .main {
    margin-left: 0;
    padding: 12px;
  }

  .home-hero {
    min-height: auto;
    padding: 28px 22px;
    border-radius: 28px;
  }

  .home-hero::after {
    right: -34%;
    top: -12%;
    width: 82vw;
    height: 82vw;
    opacity: 0.58;
  }

  .project-update-card {
    max-width: none;
  }

  .tech-news-grid,
  .steam-favorites {
    grid-template-columns: 1fr;
  }

  .post-card,
  .interest-card,
  .contact-form {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-btn {
    justify-content: center;
    text-align: center;
  }

  .works-grid {
    grid-auto-rows: minmax(220px, auto);
    gap: 16px;
  }
}

/* =========================
   Above-the-fold Spacing Fix
========================= */

:root {
  --sidebar-offset: 32px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
}

.main {
  padding-top: 16px;
}

.home-hero {
  align-items: flex-start;
  min-height: calc(100vh - var(--sidebar-offset, 0px));
  margin-top: 0;
  padding-top: clamp(20px, 3vw, 44px);
}

.about-page,
.contact-page,
.page-shell,
.content-wrapper {
  min-height: calc(100vh - var(--sidebar-offset, 0px));
  margin-top: 0;
  padding-top: 0;
}

.contact-page {
  align-items: flex-start;
  padding-top: clamp(16px, 3vw, 36px);
}

.posts-header,
.main > h1 {
  margin-top: 0;
}

@media (max-width: 900px) {
  :root {
    --sidebar-offset: 0px;
  }

  .sidebar {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    height: 56px;
    margin: 0;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
  }

  .sidebar-top h1 {
    margin: 0;
    flex: 0 0 auto;
  }

  .sidebar-top h1 a {
    padding: 7px 10px;
  }

  .lang-switch {
    flex: 0 0 auto;
    margin: 0;
    padding: 4px;
  }

  .sidebar-top nav {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    padding: 4px;
    gap: 4px;
  }

  .sidebar-top nav a {
    padding: 7px 9px;
    white-space: nowrap;
  }

  .sidebar-bottom {
    display: none;
  }

  .main {
    padding-top: 72px;
  }

  .home-hero,
  .about-page,
  .contact-page,
  .page-shell,
  .content-wrapper {
    min-height: auto;
    margin-top: 0;
  }
}

/* =========================
   Homepage Hero Height Fix
========================= */

.home-hero {
  min-height: clamp(360px, 52vh, 480px);
  padding-top: clamp(24px, 3vw, 44px);
  padding-bottom: clamp(24px, 3vw, 44px);
}

.daily-inspiration-section {
  margin-top: 20px;
}

@media (max-width: 900px) {
  .home-hero {
    min-height: auto;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .daily-inspiration-section {
    margin-top: 20px;
  }
}

/* =========================
   Liquid Glass Micro Polish
========================= */

@media (min-width: 901px) {
  .sidebar {
    height: calc(100vh - 16px);
    margin-top: 8px;
    margin-bottom: 8px;
    border-radius: 28px;
  }

  .home-hero {
    align-items: center;
    gap: clamp(28px, 4vw, 44px);
    justify-content: center;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    padding-left: clamp(36px, 5vw, 68px);
    padding-right: clamp(36px, 5vw, 68px);
  }

  .home-text {
    flex: 0 1 560px;
  }

  .project-update-card {
    flex: 0 1 500px;
  }
}

.apod-image {
  filter: brightness(1.08) contrast(1.05);
}

.tech-news-card {
  transition:
    transform 0.24s ease,
    border-color 0.24s ease,
    background 0.24s ease,
    box-shadow 0.24s ease;
}

.tech-news-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* =========================
   Final Glass Clarity Polish
========================= */

:root {
  --glass-bg: rgba(255, 255, 255, 0.13);
  --glass-bg-strong: rgba(255, 255, 255, 0.17);
  --glass-bg-soft: rgba(255, 255, 255, 0.085);
  --glass-border: rgba(255, 255, 255, 0.24);
  --glass-border-soft: rgba(255, 255, 255, 0.16);
  --glass-highlight: rgba(255, 255, 255, 0.42);
  --glass-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --glass-shadow-soft: 0 18px 56px rgba(0, 0, 0, 0.22);
}

body {
  background:
    radial-gradient(circle at 15% 8%, rgba(112, 178, 255, 0.4), transparent 30vw),
    radial-gradient(circle at 76% 12%, rgba(242, 166, 255, 0.26), transparent 30vw),
    radial-gradient(circle at 64% 78%, rgba(112, 255, 226, 0.2), transparent 34vw),
    linear-gradient(135deg, #080b16 0%, #11162a 44%, #090d18 100%);
}

.sidebar,
.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 24px 80px rgba(0, 0, 0, 0.28);
}

.sidebar::before,
.home-hero::before,
.project-update-card::before,
.apod-card::before,
.tech-news-card::before,
.work-card::before,
.contact-form::before,
.code-block::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 30%),
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.2), transparent 24%);
  opacity: 0.62;
}

.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(14, 20, 36, 0.64)),
    rgba(12, 18, 32, 0.68);
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 18% 4%, rgba(112, 178, 255, 0.3), transparent 58vw),
      radial-gradient(circle at 86% 16%, rgba(242, 166, 255, 0.2), transparent 56vw),
      linear-gradient(145deg, #080b16 0%, #11162a 100%);
  }
}

/* =========================
   Apple Liquid Glass Light Theme
========================= */

:root {
  color-scheme: light;
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-bg-soft: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-border-soft: rgba(255, 255, 255, 0.52);
  --glass-highlight: rgba(255, 255, 255, 0.86);
  --glass-shadow: 0 24px 80px rgba(80, 140, 210, 0.22);
  --glass-shadow-soft: 0 18px 56px rgba(80, 140, 210, 0.16);
  --accent-blue: #1d68d8;
  --accent-cyan: #0d7fa8;
  --accent-pink: #b653b9;
  --accent-lime: #217a45;
  --text-main: rgba(20, 28, 40, 0.92);
  --text-muted: rgba(70, 82, 100, 0.72);
  --text-soft: rgba(82, 96, 118, 0.52);
}

body {
  background:
    radial-gradient(circle at 10% 12%, rgba(88, 170, 255, 0.36), transparent 28vw),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.82), transparent 30vw),
    radial-gradient(circle at 76% 78%, rgba(160, 214, 255, 0.42), transparent 36vw),
    linear-gradient(135deg, #eaf6ff 0%, #f8fbff 42%, #dcebfb 100%);
  color: var(--text-main);
}

.sidebar,
.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.34)),
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28),
    var(--glass-shadow);
}

.sidebar::before,
.home-hero::before,
.project-update-card::before,
.apod-card::before,
.tech-news-card::before,
.work-card::before,
.contact-form::before,
.code-block::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.18) 34%, transparent 62%),
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.58), transparent 24%);
  opacity: 0.72;
}

.sidebar-top h1 a,
.lang-switch,
.sidebar-top nav,
.hero-btn,
.copy-btn,
.tech-news-tag,
.beta-badge {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 10px 30px rgba(80, 140, 210, 0.12);
}

.home-text h1 {
  background: linear-gradient(120deg, #101722 0%, #245fba 48%, #287f9e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.home-text h3,
.home-text h4,
.home-text h5,
.home-text h6,
.project-update-desc,
.apod-content p,
.tech-news-header p,
.tech-news-card p,
.contact-intro,
.post-content,
.post-handle,
.post-dot,
.post-date,
.post-caption,
.steam-game-meta,
.interest-note,
.sidebar-bottom {
  color: var(--text-muted);
}

.sidebar-top nav a,
.lang-switch a,
.contact-form label,
.post-name,
.steam-game-name,
.code-file {
  color: var(--text-main);
}

.lang-switch a.active,
.sidebar-top nav a:hover,
.contact-fallback a {
  color: rgba(15, 23, 42, 0.96) !important;
}

.project-update-label,
.apod-label,
.tech-news-category,
.contact-eyebrow,
.project-update-meta,
.hashtag {
  color: var(--accent-blue) !important;
}

.contact-form input,
.contact-form textarea,
.code-block pre[class*="language-"] {
  background: rgba(255, 255, 255, 0.48) !important;
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--text-main);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(72, 134, 220, 0.66);
  background: rgba(255, 255, 255, 0.68) !important;
  box-shadow:
    0 0 0 4px rgba(80, 140, 210, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.54);
}

.code-lang,
.code-block .line-numbers-rows > span::before {
  color: rgba(70, 82, 100, 0.48);
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.46)),
    var(--glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 30px 90px rgba(80, 140, 210, 0.26);
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 14% 6%, rgba(88, 170, 255, 0.28), transparent 58vw),
      radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.78), transparent 56vw),
      linear-gradient(145deg, #eaf6ff 0%, #f8fbff 48%, #dcebfb 100%);
  }
}

/* =========================
   macOS Glass Refinement
========================= */

:root {
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.55);
  --glass-bg-soft: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-border-soft: rgba(255, 255, 255, 0.25);
  --glass-highlight: rgba(255, 255, 255, 0.52);
  --glass-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    0 30px 60px rgba(80, 140, 210, 0.12);
  --glass-shadow-soft:
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 22px 46px rgba(80, 140, 210, 0.1);
}

.sidebar,
.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18)),
    var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.sidebar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16)),
    rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 14px 44px rgba(80, 140, 210, 0.14);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
}

.home-hero {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 18px 54px rgba(80, 140, 210, 0.12);
}

.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  border-color: rgba(255, 255, 255, 0.38);
}

.sidebar::before,
.home-hero::before,
.project-update-card::before,
.apod-card::before,
.tech-news-card::before,
.work-card::before,
.contact-form::before,
.code-block::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 32%, transparent 60%),
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.28), transparent 26%);
  opacity: 0.45;
}

.sidebar-top h1 a,
.lang-switch,
.sidebar-top nav,
.hero-btn,
.copy-btn,
.tech-news-tag,
.beta-badge {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 22px rgba(80, 140, 210, 0.08);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.code-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18)),
    rgba(255, 255, 255, 0.34);
}

.contact-form input,
.contact-form textarea,
.code-block pre[class*="language-"] {
  background: rgba(255, 255, 255, 0.34) !important;
  border-color: rgba(255, 255, 255, 0.38);
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.22)),
    var(--glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 12px 34px rgba(0, 0, 0, 0.08),
    0 34px 68px rgba(80, 140, 210, 0.14);
}

/* =========================
   macOS Texture Pass
========================= */

:root {
  --text-main: rgba(28, 36, 52, 0.78);
  --text-muted: rgba(60, 72, 90, 0.55);
}

.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0.35)
    );
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.sidebar {
  border-radius: 26px;
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
}

.home-hero {
  border-radius: 30px;
}

.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  border-radius: 22px;
}

/* =========================
   macOS Ambient Pass
========================= */

body {
  position: relative;
}

body::before {
  inset: -18vh -14vw;
  width: auto;
  height: auto;
  border-radius: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(116, 187, 255, 0.32), transparent 0 30%),
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.62), transparent 0 26%),
    radial-gradient(circle at 64% 82%, rgba(150, 207, 255, 0.24), transparent 0 34%);
  filter: blur(34px);
  opacity: 0.84;
  z-index: 0;
}

.main {
  position: relative;
  z-index: 1;
}

.sidebar {
  border-color: transparent;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.24),
    inset -1px 0 0 rgba(255, 255, 255, 0.08),
    0 12px 34px rgba(80, 140, 210, 0.1);
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover,
.post-card:hover,
.hero-btn:hover,
.contact-form button:hover,
.copy-btn:hover,
.steam-game-card:hover {
  transform: none;
}

.sidebar-top nav a:hover {
  transform: none;
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover,
.post-card:hover {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0.39)
    );
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 10px 28px rgba(0, 0, 0, 0.06),
    0 24px 46px rgba(80, 140, 210, 0.11);
}

.hero-btn:hover,
.contact-form button:hover,
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 20px rgba(80, 140, 210, 0.1);
}

/* =========================
   Tahoe Dynamic Material System
========================= */

:root {
  --blur-sidebar: 30px;
  --blur-hero: 20px;
  --blur-card: 14px;
  --text-main-light: rgba(255, 255, 255, 0.88);
  --text-muted-light: rgba(255, 255, 255, 0.64);
  --text-main-dark: rgba(24, 32, 46, 0.84);
  --text-muted-dark: rgba(56, 68, 86, 0.62);
  --glass-tint-top: 0.45;
  --glass-tint-bottom: 0.25;
  --glass-tint-top-hover: 0.52;
  --glass-tint-bottom-hover: 0.31;
}

body::before {
  inset: -220px -180px;
  width: auto;
  height: auto;
  background:
    radial-gradient(980px circle at 12% 10%, rgba(74, 158, 255, 0.34), transparent 58%),
    radial-gradient(920px circle at 82% 6%, rgba(176, 128, 255, 0.22), transparent 56%),
    radial-gradient(1060px circle at 64% 88%, rgba(92, 220, 230, 0.24), transparent 60%),
    radial-gradient(820px circle at 34% 54%, rgba(255, 255, 255, 0.58), transparent 62%);
  filter: blur(42px) saturate(118%);
  opacity: 0.9;
  transform: none;
}

.sidebar {
  background:
    linear-gradient(
      180deg,
      rgba(46, 84, 128, 0.36),
      rgba(34, 62, 98, 0.22)
    );
  border-color: transparent;
  color: var(--text-main-light);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.2),
    inset -1px 0 0 rgba(255, 255, 255, 0.07),
    0 18px 46px rgba(62, 122, 190, 0.13);
  backdrop-filter: blur(var(--blur-sidebar)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--blur-sidebar)) saturate(170%);
}

.sidebar-top h1 a,
.sidebar-top nav,
.lang-switch {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-main-light);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.sidebar-top nav a,
.lang-switch a,
.sidebar-bottom {
  color: var(--text-muted-light);
}

.sidebar-top nav a:hover,
.lang-switch a.active,
.lang-switch a:hover {
  color: var(--text-main-light) !important;
}

.home-hero {
  color: var(--text-main-dark);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, var(--glass-tint-top)),
      rgba(255, 255, 255, var(--glass-tint-bottom))
    );
  backdrop-filter: blur(var(--blur-hero)) saturate(155%);
  -webkit-backdrop-filter: blur(var(--blur-hero)) saturate(155%);
}

.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  color: var(--text-main-dark);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, var(--glass-tint-top)),
      rgba(255, 255, 255, var(--glass-tint-bottom))
    );
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 30px rgba(0, 0, 0, 0.055),
    0 26px 58px rgba(80, 140, 210, 0.105);
  backdrop-filter: blur(var(--blur-card)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--blur-card)) saturate(145%);
}

.home-text h3,
.project-update-desc,
.apod-content p,
.tech-news-header p,
.tech-news-card p,
.contact-intro,
.post-content,
.post-handle,
.post-dot,
.post-date,
.post-caption,
.steam-game-meta,
.interest-note {
  color: var(--text-muted-dark);
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover,
.post-card:hover {
  transform: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, var(--glass-tint-top-hover)),
      rgba(255, 255, 255, var(--glass-tint-bottom-hover))
    );
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 32px rgba(0, 0, 0, 0.06),
    0 30px 64px rgba(80, 140, 210, 0.12);
}

.hero-btn:hover,
.contact-form button:hover,
.copy-btn:hover,
.steam-game-card:hover,
.work-card:hover img,
.steam-game-card:hover img {
  transform: none;
}

:root {
  --glass-tint-opacity: 0.25;
  --glass-tint-hover-opacity: 0.31;
}

.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, calc(var(--glass-tint-opacity) + 0.2)),
      rgba(255, 255, 255, var(--glass-tint-opacity))
    );
}

.tech-news-card:hover,
.apod-card:hover,
.project-update-card:hover,
.work-card:hover,
.post-card:hover {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, calc(var(--glass-tint-hover-opacity) + 0.21)),
      rgba(255, 255, 255, var(--glass-tint-hover-opacity))
    );
}

.light-text {
  color: var(--text-main-light);
}

.light-text p,
.light-text span,
.light-text small,
.light-text .project-update-desc,
.light-text .apod-content p,
.light-text .tech-news-card p,
.light-text .post-content,
.light-text .post-caption {
  color: var(--text-muted-light);
}

.dark-text {
  color: var(--text-main-dark);
}

.dark-text p,
.dark-text span,
.dark-text small,
.dark-text .project-update-desc,
.dark-text .apod-content p,
.dark-text .tech-news-card p,
.dark-text .post-content,
.dark-text .post-caption {
  color: var(--text-muted-dark);
}

/* =========================
   Material Readability Fix
========================= */

:root {
  --content-text-main: rgba(10, 15, 25, 0.92);
  --content-text-muted: rgba(40, 55, 75, 0.72);
}

.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  color: var(--content-text-main);
}

.home-hero h1,
.home-hero h2,
.home-hero h3,
.project-update-card h1,
.project-update-card h2,
.project-update-card h3,
.apod-card h1,
.apod-card h2,
.apod-card h3,
.tech-news-card h1,
.tech-news-card h2,
.tech-news-card h3,
.work-card h1,
.work-card h2,
.work-card h3,
.post-card h1,
.post-card h2,
.post-card h3,
.contact-form h1,
.contact-form h2,
.contact-form h3,
.code-block h1,
.code-block h2,
.code-block h3,
.post-name,
.steam-game-name,
.code-file {
  color: var(--content-text-main);
}

.home-text h3,
.home-text h4,
.home-text h5,
.home-text h6,
.project-update-desc,
.project-update-meta,
.apod-content p,
.apod-date,
.tech-news-header p,
.tech-news-card p,
.contact-intro,
.post-content,
.post-handle,
.post-dot,
.post-date,
.post-caption,
.steam-game-meta,
.interest-note,
.code-lang,
.code-block .line-numbers-rows > span::before {
  color: var(--content-text-muted) !important;
}

.sidebar,
.sidebar h1,
.sidebar h1 a,
.sidebar-top nav,
.sidebar-top nav a,
.lang-switch,
.lang-switch a,
.sidebar-bottom {
  color: var(--text-main-light);
}

.sidebar-bottom,
.sidebar-top nav a,
.lang-switch a {
  color: var(--text-muted-light);
}

/* =========================
   Production Readability Recovery
========================= */

:root {
  --content-text-main: rgba(10, 15, 25, 0.94);
  --content-text-muted: rgba(45, 58, 78, 0.76);
}

.home-hero,
.project-update-card,
.apod-card,
.tech-news-card,
.work-card,
.post-card,
.contact-form,
.code-block {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.72),
      rgba(235, 248, 255, 0.58)
    );
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: var(--content-text-main);
}

.main,
.main h1,
.main h2,
.main h3,
.posts-header h1,
.contact-page h1,
.about-page h1,
.home-text h1,
.tech-news-section h2,
.tech-news-card h3,
.project-update-card h2,
.apod-card h2,
.post-card h1,
.post-card h2,
.post-card h3,
.contact-form label,
.code-file {
  color: var(--content-text-main) !important;
  -webkit-text-fill-color: currentColor;
}

.main p,
.project-update-desc,
.project-update-meta,
.apod-content p,
.apod-date,
.tech-news-header p,
.tech-news-card p,
.contact-intro,
.post-content,
.post-handle,
.post-dot,
.post-date,
.post-caption,
.steam-game-meta,
.interest-note,
.code-lang {
  color: var(--content-text-muted) !important;
}

.hero-btn,
.contact-form button,
.copy-btn,
.sidebar .hero-btn,
.sidebar .copy-btn {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: rgba(10, 15, 25, 0.88) !important;
  -webkit-text-fill-color: currentColor;
}

.hero-btn:hover,
.contact-form button:hover,
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(255, 255, 255, 0.58);
  color: rgba(10, 15, 25, 0.92) !important;
}

.code-block,
.code-block pre[class*="language-"],
.code-block code[class*="language-"],
pre[class*="language-"],
code[class*="language-"] {
  background: rgba(245, 250, 255, 0.72) !important;
  color: rgba(20, 28, 40, 0.88) !important;
  text-shadow: none !important;
}

.code-block .line-numbers-rows > span::before {
  color: rgba(45, 58, 78, 0.5) !important;
}

.post-card {
  max-width: 760px;
  min-height: auto;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78),
      rgba(235, 248, 255, 0.64)
    );
}

.posts-list,
.posts-grid {
  align-items: start;
}

.sidebar,
.sidebar h1,
.sidebar h1 a,
.sidebar-top nav,
.sidebar-top nav a,
.lang-switch,
.lang-switch a,
.sidebar-bottom {
  color: var(--text-main-light) !important;
}

.sidebar-bottom,
.sidebar-top nav a,
.lang-switch a {
  color: var(--text-muted-light) !important;
}

/* =========================
   Final Readability Tuning
========================= */

.sidebar,
.sidebar a,
.sidebar nav a,
.sidebar-top nav a,
.lang-switch a,
.sidebar-footer,
.sidebar-bottom {
  color: rgba(10, 15, 25, 0.82) !important;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.sidebar-top nav a.active,
.sidebar-top nav a:hover {
  color: rgba(10, 15, 25, 0.94) !important;
}

.sidebar-top h1 a {
  color: rgba(10, 15, 25, 0.9) !important;
}

.posts-header h1,
.main > h1,
.page-title {
  color: rgba(10, 15, 25, 0.94) !important;
  -webkit-text-fill-color: currentColor;
}

.posts-header p,
.page-subtitle {
  color: rgba(45, 58, 78, 0.76) !important;
}

/* =========================
   Apple Typography Polish
========================= */

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.main h1,
.home-text h1,
.contact-page h1,
.posts-header h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.main h2,
.main h3 {
  font-weight: 650;
  letter-spacing: -0.035em;
}

.main p,
.contact-intro,
.post-content,
.tech-news-card p,
.apod-content p {
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.55;
}

.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(80, 120, 170, 0.22);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(80, 120, 170, 0.08);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow:
    0 0 0 4px rgba(0, 113, 227, 0.16),
    inset 0 1px 2px rgba(255, 255, 255, 0.75);
}

/* =========================
   Mobile iOS Drawer
========================= */

body {
  overflow-x: hidden;
}

#menuToggle,
.sidebar-overlay {
  display: none;
}

@media (max-width: 900px) {
  #menuToggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    color: rgba(10, 15, 25, 0.88);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.48),
      0 10px 26px rgba(80, 140, 210, 0.16);
    font: 600 20px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    cursor: pointer;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: auto;
    left: 0;
    z-index: 1000;
    width: 260px;
    height: 100vh;
    margin: 0;
    padding: 72px 18px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 0 26px 26px 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-top {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }

  .sidebar-top h1 {
    margin: 0;
  }

  .lang-switch {
    flex-wrap: wrap;
    margin: 0;
    padding: 8px;
  }

  .sidebar-top nav {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px;
  }

  .sidebar nav a,
  .sidebar-top nav a {
    padding: 14px 16px;
    font-size: 16px;
    white-space: normal;
  }

  .sidebar-bottom {
    display: block;
    margin-top: 28px;
  }

  .main {
    margin-left: 0;
    padding-top: 72px;
    overflow-x: hidden;
  }
}

@media (min-width: 901px) {
  .sidebar {
    position: fixed;
    transform: none !important;
  }

  #menuToggle,
  .sidebar-overlay {
    display: none !important;
  }
}

/* =========================
   Posts Drawer Safety
========================= */

@media (max-width: 900px) {
  .posts-header,
  #postsList,
  .post-card {
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar,
  .sidebar * {
    max-width: 100%;
  }

  .sidebar,
  body .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }

  .sidebar.open,
  body .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-top nav,
  body .sidebar-top nav {
    flex-direction: column;
    overflow-x: visible;
  }
}

/* =========================
   Fix galgame banner hours color
========================= */

#galgameBannerHours {
  color: rgba(45, 58, 78, 0.72) !important;
  font-weight: 500;
}

#galgameBannerName {
  color: rgba(18, 24, 35, 0.92) !important;
}

/* fix: galgame banner text clipping */
.galgame-banner-meta {
  padding-left: 2px;
}

#galgameBannerHours {
  display: block;
  padding-left: 2px;
  color: rgba(45, 58, 78, 0.72) !important;
  font-weight: 500;
}

/* sidebar item 基礎 */
.sidebar-top nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

/* hover */
.sidebar-top nav a:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ✅ active（重點） */
.sidebar-top nav a {
  display: block;
  position: relative;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(15, 23, 42, 0.82);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.sidebar-top nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #0f172a;
}

.sidebar-top nav a.active {
  background: rgba(47, 140, 255, 0.2);
  border-color: rgba(47, 140, 255, 0.5);
  color: #005fc7;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 24px rgba(47, 140, 255, 0.22);
  backdrop-filter: blur(12px);
}

/* =========================
   Unified Page Rail
   統一所有內頁標題與內容左邊界
========================= */

:root {
  --page-rail-width: 1000px;
  --page-top-offset: 56px;
  --page-side-offset: 48px;
  --page-title-gap: 32px;
}

.main {
  padding: var(--page-top-offset) var(--page-side-offset);
}

/* 所有內頁統一同一條內容軌道 */
.about-page,
.works-page,
.work-page,
.posts-page,
.post-page,
.contact-page,
.tools-page,
.tier-maker-page,
.tier-page,
.main:has(.works-grid),
.main:has(.post-card),
.main:has(.posts-grid),
.main:has(.tier-board),
.main:has(.tier-list) {
  width: 100%;
  max-width: var(--page-rail-width);
  margin-left: auto;
  margin-right: auto;
}

/* 取消各頁原本造成上下位置不同的設定 */
.about-page,
.contact-page {
  min-height: auto;
  padding-top: 0;
  padding-bottom: 0;
  display: block;
  align-items: initial;
}

/* 標題全部從同一條左邊界開始 */
.about-title,
.section-title,
.contact-content h1,
.contact-title,
.tools-page h1,
.tier-maker-page h1,
.tier-page h1,
.main:has(.tier-board) h1,
.main:has(.tier-list) h1 {
  margin-top: 0;
  margin-bottom: var(--page-title-gap);
  text-align: left;
}

/* Contact 不要自己縮成小版 */
.contact-content,
.contact-form,
.contact-intro {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Works / Posts / Tools 內容跟標題同軌道 */
.works-grid,
.posts-grid,
.post-list,
.tier-board,
.tier-list {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* About code block 跟標題同軌道 */
.about-content,
.about-content .code-block {
  width: 100%;
}

/* Mobile */
@media (max-width: 900px) {
  :root {
    --page-top-offset: 32px;
    --page-side-offset: 20px;
    --page-title-gap: 24px;
  }

  .main {
    padding: var(--page-top-offset) var(--page-side-offset);
  }
}

/* =========================
   Unified Page Shell
   單一內頁座標系統
========================= */

:root {
  --page-shell-width: 1000px;
  --page-top-offset: 56px;
  --page-side-offset: 48px;
  --page-header-gap: 32px;
}

.main {
  padding: var(--page-top-offset) var(--page-side-offset);
}

.page-shell {
  width: 100%;
  max-width: var(--page-shell-width);
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  width: 100%;
  margin: 0 0 var(--page-header-gap);
}

.page-header h1,
.page-shell > h1,
.about-content h1,
.contact-content h1,
.tier-title-row h1 {
  margin: 0;
  text-align: left;
  line-height: 1.08;
}

.page-header p {
  margin: 10px 0 0;
}

.page-body {
  width: 100%;
}

.about-page,
.contact-page,
.tier-maker-page {
  width: 100%;
  max-width: none;
  min-height: auto;
  margin: 0;
  padding: 0;
  display: block;
  align-items: initial;
}

.about-content,
.contact-content {
  width: 100%;
  max-width: none;
  margin: 0;
}

.contact-form,
.contact-intro {
  width: 100%;
  max-width: none;
}

.tier-header,
.tier-toolbar,
.tier-board,
.image-pool,
.tier-note {
  width: 100%;
}

.tier-title-row {
  align-items: flex-start;
}

.hero,
.works-grid,
#postsList {
  width: 100%;
}

@media (max-width: 900px) {
  :root {
    --page-top-offset: 32px;
    --page-side-offset: 20px;
    --page-header-gap: 24px;
  }

  .main {
    padding: var(--page-top-offset) var(--page-side-offset);
  }
}

/* =========================
   Final Pixel Alignment Patch
   統一內頁標題像素座標
========================= */

:root {
  --page-shell-width: 1000px;
  --page-top-offset: 56px;
  --page-side-offset: 48px;
  --page-header-gap: 32px;
}

/* 主內容起點固定 */
.main {
  padding: var(--page-top-offset) var(--page-side-offset);
}

@media (max-width: 900px) {
  .main {
    padding-top: 72px !important;
  }
}

/* 所有內頁版心固定 */
.page-shell {
  width: 100% !important;
  max-width: var(--page-shell-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* header 座標固定 */
.page-header,
.posts-header,
.tier-header {
  width: 100% !important;
  margin: 0 0 var(--page-header-gap) !important;
  padding: 0 !important;
}

/* 所有標題統一 */
.page-header h1,
.posts-header h1,
.tier-header h1,
.contact-content h1,
.about-content h1 {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.03em;
  text-align: left !important;
}

/* subtitle 不影響標題本身座標 */
.page-header p,
.posts-header p,
.tier-header p,
.contact-intro {
  margin: 10px 0 0 !important;
  padding: 0 !important;
}

/* 取消舊頁面容器造成的偏移 */
.about-page,
.contact-page,
.tier-maker-page {
  width: 100% !important;
  max-width: none !important;
  min-height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  align-items: initial !important;
}

/* 取消 Contact 舊寬度 */
.contact-content,
.contact-form,
.contact-intro {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Tier Maker 標題列避免按鈕影響垂直對齊 */
.tier-title-row {
  align-items: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tier-title-row h1 {
  margin: 0 !important;
}

/* body 不要自己偏移 */
.page-body {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 900px) {
  :root {
    --page-top-offset: 32px;
    --page-side-offset: 20px;
    --page-header-gap: 24px;
  }
}

/* =========================
   Works Page Redesign
========================= */

.works-page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 48px 0 96px;
}

.works-hero {
  margin-bottom: 28px;
}

.works-eyebrow {
  margin: 0 0 10px;
  color: rgba(20, 31, 45, 0.52);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.works-hero h1 {
  margin: 0 0 14px;
  color: #101827;
  font-size: clamp(3.2rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.works-intro {
  max-width: 560px;
  margin: 0;
  color: rgba(20, 31, 45, 0.62);
  font-size: 1rem;
  line-height: 1.8;
}

.works-feature {
  width: 100%;
  aspect-ratio: 16 / 8.8;
  margin-bottom: 28px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: 0 24px 80px rgba(70, 130, 190, 0.16);
}

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

.works-gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 190px;
  gap: 18px;
}

.works-gallery .work-card {
  grid-column: span 2;
  grid-row: span 2;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 18px 50px rgba(40, 90, 140, 0.12);
}

.works-gallery .work-card-wide {
  grid-column: span 4;
  grid-row: span 3;
}

.works-gallery .work-card-tall {
  grid-column: span 2;
  grid-row: span 3;
}

.works-gallery .work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.works-gallery .work-card:hover img,
.works-feature:hover img {
  transform: scale(1.025);
  filter: brightness(1.04);
}

@media (max-width: 900px) {
  .works-page {
    padding: 32px 0 64px;
  }

  .works-feature {
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }

  .works-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 16px;
  }

  .works-gallery .work-card,
  .works-gallery .work-card-wide,
  .works-gallery .work-card-tall {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }
}

/* =========================
   Mobile left drawer safe header
========================= */

@media (max-width: 900px) {
  #menuToggle {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    font-size: 24px !important;
    line-height: 1 !important;
    z-index: 2000 !important;
  }

  .about-title,
  .section-title,
  .posts-page > h1,
  .contact-content > h1,
  .tier-maker-page > h1,
  .works-page > h1 {
    margin-top: 72px !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  .home-text h1 {
    margin-top: 0 !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
}

/* =========================
   Sidebar Home Link
========================= */

.sidebar .sidebar-top h1 a {
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -0.035em !important;
  color: #132033 !important;

  padding: 18px 26px !important;
  min-height: 52px !important;
}

.sidebar .sidebar-top h1 a:hover {
  color: #1677ff !important;
}

.sidebar-top nav a.nav-link.active,
.sidebar-top nav a.nav-link.active .nav-label,
.sidebar-top nav a.nav-link.active .nav-icon {
  color: #009AFF !important;
}

.sidebar-top nav a.nav-link.active {
  background: rgba(0, 154, 255, 0.10);
  border-color: rgba(0, 154, 255, 0.36);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-top nav a.nav-link {
  color: rgba(18, 33, 51, 0.68);
  font-weight: 500;
}

.sidebar-top nav a.nav-link .nav-icon {
  color: rgba(18, 33, 51, 0.52);
  opacity: 1;
}

.sidebar-top nav a.nav-link.active {
  color: #009AFF !important;
  background: rgba(0, 154, 255, 0.11);
  border-color: rgba(0, 154, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(0, 154, 255, 0.12);
}

.sidebar-top nav a.nav-link.active .nav-icon,
.sidebar-top nav a.nav-link.active .nav-label {
  color: #009AFF !important;
}

.nav-icon svg {
  transform: translateY(2px);
}