:root {
  --bg: #f7f1e8;
  --surface: rgba(255, 251, 245, 0.82);
  --surface-strong: #fffdfa;
  --surface-soft: rgba(255, 248, 238, 0.88);
  --text: #201d19;
  --muted: #70695e;
  --line: rgba(49, 39, 29, 0.11);
  --accent: #c59c47;
  --accent-deep: #825f1f;
  --nav-pill: rgba(201, 166, 92, 0.16);
  --blue: #335b95;
  --red: #7e2f1f;
  --deep: #1f3766;
  --sand: #9f835f;
  --green: #819b5f;
  --violet: #7b6fa5;
  --amber: #c17f43;
  --shadow: 0 20px 44px rgba(67, 52, 35, 0.09);
}

body.theme-dark {
  --bg: #0d1830;
  --surface: rgba(17, 29, 56, 0.82);
  --surface-strong: #142342;
  --surface-soft: rgba(20, 35, 66, 0.9);
  --text: #eef4ff;
  --muted: #aab8d7;
  --line: rgba(204, 224, 255, 0.12);
  --accent: #77a6ff;
  --accent-deep: #9ec0ff;
  --nav-pill: rgba(97, 146, 255, 0.16);
  --shadow: 0 20px 44px rgba(4, 10, 24, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(213, 183, 119, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(184, 128, 93, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 240px),
    linear-gradient(180deg, #fbf8f3 0%, var(--bg) 100%);
  font-family: "Space Grotesk", sans-serif;
  transition: background 220ms ease, color 220ms ease;
}

body.theme-dark {
  background:
    radial-gradient(circle at top left, rgba(84, 128, 221, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(36, 77, 149, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 240px),
    linear-gradient(180deg, #0a1224 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 31, 29, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 31, 29, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 48px;
}

.home-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.76);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

body.theme-dark .topbar {
  background: rgba(16, 27, 51, 0.78);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(197, 156, 71, 0.95), rgba(233, 218, 170, 0.95));
  color: #fffdfa;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.theme-dark .brand-mark {
  background: linear-gradient(135deg, rgba(72, 123, 223, 0.95), rgba(154, 191, 255, 0.95));
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: "Noto Serif SC", serif;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.topnav a,
.contact-links a,
.feature-link,
.friend-card {
  color: inherit;
  text-decoration: none;
}

.topnav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
}

.topnav a:hover,
.topnav a.is-active {
  background: var(--nav-pill);
  color: var(--accent-deep);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 251, 245, 0.9);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

body.theme-dark .theme-toggle {
  background: rgba(21, 36, 67, 0.96);
}

.brand:hover,
.theme-toggle:hover,
.contact-links a:hover,
.feature-link:hover,
.friend-card:hover {
  color: var(--accent-deep);
}

.theme-toggle:hover {
  background: var(--nav-pill);
  transform: translateY(-1px);
}

main {
  display: grid;
  gap: 38px;
}

.home-main {
  gap: 24px;
}

.hero,
.page-hero,
.panel,
.contact-strip,
.sidebar-card,
.cloud-gate-card,
.cloud-links {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 76px 32px 60px;
  text-align: center;
}

.hero-home {
  min-height: 62vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding-top: 110px;
  padding-bottom: 110px;
  background:
    radial-gradient(circle at 35% 28%, rgba(219, 165, 78, 0.18), transparent 18%),
    radial-gradient(circle at 72% 18%, rgba(78, 123, 211, 0.12), transparent 18%),
    linear-gradient(135deg, rgba(19, 18, 27, 0.96), rgba(11, 17, 34, 0.98));
}

body.theme-dark .hero-home {
  background:
    radial-gradient(circle at 35% 28%, rgba(231, 174, 83, 0.22), transparent 18%),
    radial-gradient(circle at 72% 18%, rgba(78, 123, 211, 0.16), transparent 18%),
    linear-gradient(135deg, rgba(14, 20, 39, 0.98), rgba(7, 12, 24, 0.99));
}

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -110px 0;
  height: 240px;
  background:
    radial-gradient(circle at 20% 30%, rgba(197, 156, 71, 0.1), transparent 24%),
    radial-gradient(circle at 72% 40%, rgba(147, 96, 82, 0.08), transparent 18%);
  pointer-events: none;
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 240, 212, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 75% 26%, rgba(255, 240, 212, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 62%, rgba(255, 240, 212, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 34% 74%, rgba(255, 240, 212, 0.38) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 84%, rgba(255, 240, 212, 0.45) 0 1px, transparent 2px);
  background-size: 220px 220px, 260px 260px, 320px 320px, 280px 280px, 340px 340px;
  opacity: 0.7;
  pointer-events: none;
}

body.theme-dark .hero::after,
body.theme-dark .page-hero::after {
  background:
    radial-gradient(circle at 20% 30%, rgba(119, 166, 255, 0.14), transparent 24%),
    radial-gradient(circle at 72% 40%, rgba(71, 114, 196, 0.15), transparent 18%);
}

.eyebrow,
.section-tag,
.card-kicker {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.section-heading h2,
.panel h2,
.contact-strip h2,
.cloud-gate-card h2 {
  margin: 0;
  line-height: 0.95;
  font-size: clamp(2.8rem, 5.8vw, 5.5rem);
  letter-spacing: -0.05em;
  font-family: "Noto Serif SC", serif;
}

.hero h1 span {
  display: block;
  color: var(--accent-deep);
}

.lead,
.copy-stack p,
.post-card p,
.feature-content p,
.footer p,
.dialog-copy,
.section-subtitle,
.friend-card span,
.gallery-body p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.lead {
  max-width: 700px;
  margin: 24px auto 0;
}

.home-lead {
  max-width: 480px;
  color: rgba(240, 236, 231, 0.8);
}

.centered-copy {
  text-align: center;
}

.hero-badge {
  margin: 0 0 18px;
  padding: 10px 18px;
  border: 1px solid rgba(229, 180, 95, 0.32);
  border-radius: 999px;
  color: rgba(248, 219, 173, 0.96);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.poem-title {
  max-width: 900px;
  color: #fff7ea;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.34);
}

.poem-meta {
  margin: 18px 0 0;
  color: rgba(248, 225, 191, 0.82);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

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

.button-primary {
  color: #fff8f0;
  background: #2c241d;
}

body.theme-dark .button-primary {
  background: #2b5ec7;
}

.button-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

body.theme-dark .button-secondary {
  background: rgba(255, 255, 255, 0.06);
}

.intro-grid,
.contact-strip {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  padding: 32px;
}

.copy-stack {
  font-family: "Noto Serif SC", serif;
}

.intro-copy h2 {
  max-width: 460px;
}

.highlight-copy {
  padding-top: 12px;
}

.cards-section,
.cloud-links {
  display: grid;
  gap: 18px;
}

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

.section-heading {
  padding: 0 6px;
}

.card-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  position: relative;
  min-height: 370px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.feature-blue::before {
  background-image:
    linear-gradient(180deg, rgba(20, 39, 77, 0.18), rgba(20, 39, 77, 0.48)),
    linear-gradient(135deg, rgba(77, 125, 199, 0.7), rgba(38, 67, 111, 0.78));
}

.feature-red::before {
  background-image:
    linear-gradient(180deg, rgba(68, 20, 16, 0.2), rgba(68, 20, 16, 0.52)),
    linear-gradient(135deg, rgba(148, 56, 34, 0.74), rgba(87, 26, 17, 0.84));
}

.feature-deep::before {
  background-image:
    linear-gradient(180deg, rgba(11, 27, 53, 0.22), rgba(11, 27, 53, 0.54)),
    linear-gradient(135deg, rgba(46, 82, 146, 0.82), rgba(18, 34, 66, 0.88));
}

.feature-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 26%, rgba(18, 18, 18, 0.4) 100%),
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.18), transparent 22%);
}

.feature-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px;
  color: #fffaf3;
}

.feature-content .card-kicker {
  color: rgba(248, 231, 205, 0.82);
}

.feature-content p {
  color: rgba(255, 244, 228, 0.86);
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.feature-content h3,
.post-card h3,
.friend-card strong,
.gallery-body h3 {
  margin: 0 0 14px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  font-family: "Noto Serif SC", serif;
}

.feature-link {
  display: inline-flex;
  margin-top: 8px;
  font-weight: 700;
}

.blog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.post-card,
.gallery-card,
.friend-card {
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.post-cover {
  height: 210px;
}

.cover-green {
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.45), transparent 16%),
    linear-gradient(135deg, rgba(157, 196, 132, 0.9), rgba(87, 126, 83, 0.92));
}

.cover-violet {
  background:
    linear-gradient(180deg, rgba(240, 232, 255, 0.26), transparent 50%),
    linear-gradient(135deg, rgba(131, 126, 197, 0.9), rgba(94, 88, 146, 0.95));
}

.cover-amber {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.28), transparent 14%),
    linear-gradient(135deg, rgba(223, 173, 98, 0.92), rgba(179, 114, 57, 0.95));
}

.post-body,
.gallery-body,
.friend-card {
  padding: 24px;
}

.post-tag {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(201, 166, 92, 0.14);
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 700;
}

.sidebar-card {
  padding: 18px;
  background: var(--surface-soft);
}

.sidebar-block + .sidebar-block {
  margin-top: 18px;
}

.sidebar-title {
  margin: 0 0 14px;
  font-weight: 700;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

body.theme-dark .search-shell {
  background: rgba(255, 255, 255, 0.04);
}

.search-shell input,
.password-input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
  text-decoration: none;
}

body.theme-dark .category-list a {
  background: rgba(255, 255, 255, 0.05);
}

.gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.gallery-card .gallery-art {
  height: 220px;
}

.wallpaper-card {
  overflow: hidden;
}

.wallpaper-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.wallpaper-cover img {
  transition: transform 220ms ease;
}

.wallpaper-cover:hover img,
.thumb-card:hover img {
  transform: scale(1.03);
}

.wallpaper-section {
  display: grid;
  gap: 18px;
}

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

.thumb-card {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.tone-blue .gallery-art {
  background: linear-gradient(135deg, rgba(87, 129, 212, 0.92), rgba(34, 67, 123, 0.95));
}

.tone-red .gallery-art {
  background: linear-gradient(135deg, rgba(174, 81, 55, 0.92), rgba(113, 34, 24, 0.95));
}

.tone-sand .gallery-art {
  background: linear-gradient(135deg, rgba(213, 175, 113, 0.92), rgba(138, 102, 49, 0.95));
}

.cloud-gate {
  display: grid;
  justify-items: center;
}

.cloud-gate-card {
  width: min(560px, 100%);
  padding: 28px;
}

.inline-form {
  padding: 0;
  margin-top: 18px;
}

.password-form {
  display: grid;
  gap: 14px;
}

.password-label {
  font-weight: 700;
}

.password-input {
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

body.theme-dark .password-input {
  background: rgba(255, 255, 255, 0.05);
}

.password-error {
  min-height: 24px;
  margin: 0;
  color: #bb5236;
}

.cloud-links {
  padding: 32px;
}

.is-hidden {
  display: none;
}

.contact-links {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: start;
}

.contact-links a {
  font-size: 1.1rem;
  font-weight: 500;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 8px 0;
}

.home-footer {
  color: var(--muted);
}

@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .intro-grid,
  .contact-strip,
  .card-grid,
  .blog-grid,
  .home-grid,
  .footer {
    grid-template-columns: 1fr;
  }

  .topbar,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .page-hero,
  .intro-grid,
  .contact-strip,
  .cloud-gate-card,
  .cloud-links {
    padding: 24px;
  }

  .hero-home {
    min-height: auto;
    padding-top: 96px;
    padding-bottom: 88px;
  }

  .hero h1,
  .page-hero h1,
  .section-heading h2,
  .panel h2,
  .contact-strip h2,
  .cloud-gate-card h2 {
    line-height: 1;
  }

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

  .wallpaper-grid,
  .thumb-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 20px, 1120px);
  }

  .topbar {
    border-radius: 18px;
  }

  .hero,
  .page-hero,
  .panel,
  .contact-strip,
  .cloud-gate-card,
  .cloud-links {
    border-radius: 24px;
  }

  .hero::after,
  .page-hero::after {
    inset: auto 0 -80px 0;
    height: 180px;
  }
}
