:root {
  --bg: #fff8fb;
  --surface: #ffffff;
  --surface-soft: #fff0f7;
  --text: #231826;
  --muted: #6b5d70;
  --brand: #d94d8c;
  --brand-2: #8b65d9;
  --border: #ecdce8;
  --short-bg: #07070b;
  --shadow: 0 12px 32px rgba(62, 28, 54, .12);
}

.dark-mode {
  --bg: #111016;
  --surface: #1a1821;
  --surface-soft: #24202d;
  --text: #fff8fb;
  --muted: #c9bdcc;
  --border: #342c3a;
  --shadow: 0 16px 36px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.75;
  padding-bottom: 68px;
}
a { color: inherit; text-decoration: none; }
img, video, iframe { max-width: 100%; }
button, input, textarea {
  font: inherit;
}
.skip-link {
  position: absolute;
  top: -60px;
  right: 16px;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  z-index: 20;
}
.skip-link:focus { top: 12px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1180px;
  margin: auto;
  padding: 12px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 10px;
}
.desktop-nav { margin-inline-start: auto; }
.desktop-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.desktop-nav a, .theme-toggle, .button, .download-button, .like-button, .share-button, .icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.desktop-nav a:hover, .button-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.site-search {
  display: flex;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 12px;
  padding: 0 18px;
}
.site-search input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
}
.site-search button {
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--brand-2);
  color: #fff;
}
.site-main {
  max-width: 1180px;
  margin: auto;
  padding: 18px;
}
.home-hero {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 18px;
  align-items: stretch;
  min-height: 420px;
  padding: 38px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 20%, rgba(217, 77, 140, .18), transparent 30%),
    linear-gradient(135deg, #fff, #f6edff);
  box-shadow: var(--shadow);
}
.dark-mode .home-hero {
  background: linear-gradient(135deg, #1c1725, #21172b);
}
.home-hero h1 {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.15;
}
.home-hero p { color: var(--muted); }
.eyebrow {
  color: var(--brand);
  font-weight: 800;
}
.hero-actions, .action-row, .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.today-tip {
  align-self: end;
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.dark-mode .today-tip { background: rgba(26, 24, 33, .82); }
.today-tip span {
  color: var(--brand-2);
  font-weight: 800;
}
.content-band {
  margin: 34px 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-heading h1, .section-heading h2 { margin: 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.content-card, .comment-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.content-card__media {
  display: grid;
  place-items: center;
  min-height: 180px;
  aspect-ratio: 16 / 10;
  background: var(--surface-soft);
  color: var(--muted);
}
.content-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.short-card__media { aspect-ratio: 9 / 16; }
.content-card__body, .comment-card {
  padding: 14px;
}
.content-card h3, .comment-card h3 { margin: 0 0 6px; }
.content-card p { color: var(--muted); margin: 0 0 12px; }
.masonry-grid {
  columns: 3 220px;
  column-gap: 16px;
}
.masonry-grid .content-card {
  break-inside: avoid;
  margin-bottom: 16px;
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.feature-list a {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.term-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: thin;
}
.term-filter a {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}
.shorts-stage {
  max-width: none;
  width: min(100vw, 520px);
  margin: -18px auto;
  background: var(--short-bg);
  color: #fff;
}
.shorts-feed {
  height: calc(100vh - 92px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}
.short-slide {
  position: relative;
  height: calc(100vh - 92px);
  min-height: 620px;
  scroll-snap-align: start;
  background: #050507;
}
.short-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.short-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 22px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}
.short-copy h2 { margin: 0 0 4px; }
.short-copy p { margin: 0; color: rgba(255, 255, 255, .82); }
.short-actions {
  display: grid;
  gap: 10px;
  align-content: end;
}
.short-actions button, .short-actions a {
  min-width: 44px;
  min-height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .25);
}
.single-short-layout, .design-detail {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}
.single-short-player {
  position: sticky;
  top: 100px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.single-content, .reader-layout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}
.single-content.narrow { max-width: 760px; margin: auto; }
.reader-toolbar {
  position: sticky;
  top: 78px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  margin: -10px -10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 3;
}
.reader-toolbar button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--text);
}
.reader-content {
  max-width: 760px;
  margin: auto;
  font-size: 19px;
}
.reader-night {
  background: #111;
  color: #f4edf7;
}
.pdf-reader iframe {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.part-nav {
  display: flex;
  justify-content: space-between;
  max-width: 760px;
  margin: 20px auto;
}
.design-detail__image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.comments-area {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.ajax-comment-form {
  display: grid;
  gap: 12px;
}
.ajax-comment-form input, .ajax-comment-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
}
.ajax-comment-form button {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
}
.comment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.quote-mark {
  color: var(--brand);
  font-size: 3rem;
  line-height: 1;
}
.comment-card__meta {
  color: var(--muted);
}
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, .82);
  z-index: 50;
  padding: 18px;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-height: 88vh;
  object-fit: contain;
}
.lightbox button {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 18px 86px;
  color: var(--muted);
}
.site-footer__inner {
  max-width: 1180px;
  margin: auto;
}
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .bottom-nav { display: grid; }
  .site-main { padding: 12px; }
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px;
    border-radius: 12px;
  }
  .home-hero h1 { font-size: 2.15rem; }
  .card-grid, .comment-grid, .feature-list {
    grid-template-columns: 1fr;
  }
  .card-grid--shorts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .single-short-layout, .design-detail {
    grid-template-columns: 1fr;
  }
  .single-short-player {
    position: relative;
    top: auto;
    max-height: 76vh;
  }
  .shorts-stage {
    width: calc(100vw - 24px);
  }
  .shorts-feed, .short-slide {
    height: calc(100vh - 145px);
  }
  .short-slide {
    min-height: 520px;
  }
}

@media (min-width: 821px) {
  body { padding-bottom: 0; }
}
