* {
  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;
}

.sidebar-top nav a {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-top nav a:hover {
  color: #fff;
}

.tools-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.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%);
  }
}
