:root {
  color-scheme: dark;
  --bg: #11100f;
  --panel: #1a1816;
  --panel-2: #23201c;
  --text: #f5f0e8;
  --muted: #b9aea0;
  --line: #39332c;
  --accent: #4ed28a;
  --accent-2: #f0b84f;
  --accent-3: #ef6f61;
  --ink: #090908;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body.is-modal-open {
  overflow: hidden;
}

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

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(245, 240, 232, 0.08);
  background: rgba(17, 16, 15, 0.92);
  backdrop-filter: blur(18px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.site-header .section-tabs { flex: 1 1 auto; justify-content: center; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 16px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
}

.lang-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lang-btn {
  min-height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.lang-btn.is-active {
  background: var(--text);
  color: var(--ink);
}

.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
  cursor: pointer;
  font-family: inherit;
}

.account-link:hover,
.account-link.is-authenticated {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.section-tabs {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  padding: 0;
  min-width: 0;
}

.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(145deg, #211e1a, #171513);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 5px 16px #0003;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.section-tab:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: #1d2922;
}

.section-tab.is-current {
  border-color: var(--accent);
  background: #1d2922;
  box-shadow: inset 0 0 0 1px #4ed28a25;
}

.page-main { min-height: calc(100vh - 72px); }
.project-page { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) 18px; }
.project-back { display: inline-flex; margin-bottom: 24px; }
.project-detail { display: grid; gap: 24px; }
.project-detail .gallery-heading { align-items: center; padding-right: 0; }
.project-detail h1 { margin: 0; }
.project-detail .gallery-viewer img { max-height: 70vh; object-fit: contain; }
.project-comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.project-comments h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.comment-guest { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.comment-guest p { margin: 0 0 14px; color: var(--muted); }
.comment-form { display: grid; gap: 12px; }
.comment-form textarea { width: 100%; min-height: 120px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; }
.comment-form button { justify-self: start; cursor: pointer; }
.comment-list { display: grid; gap: 16px; margin: 20px 0; }
.comment-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.comment-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.comment-heading strong { overflow-wrap: anywhere; }
.comment-heading time { color: var(--muted); font-size: 0.8rem; }
.comment-card p { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-page { padding: clamp(24px, 5vw, 64px) 18px; }
.profile-card { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.profile-card h1 { margin: 0 0 28px; }
.profile-details { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); align-items: start; gap: 24px; }
.profile-identity { display: grid; justify-items: start; align-content: start; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #141311; }
.profile-identity .profile-avatar { width: 84px; height: 84px; }
.profile-identity h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.profile-identity .profile-email { margin: 0; }
.profile-details h2 { margin: 0; overflow-wrap: anywhere; }
.profile-details .profile-email { overflow-wrap: anywhere; }
.profile-settings { display: grid; width: 100%; gap: 18px; margin: 8px 0; }
.profile-setting { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #141311; }
.profile-setting h3 { margin: 0; font-size: 1.05rem; }
.profile-setting .auth-form { gap: 8px; }
.profile-setting .auth-form label { margin-top: 4px; }
.profile-setting .auth-form input { min-height: 42px; }
.profile-setting .auth-form button { justify-self: start; margin-top: 8px; cursor: pointer; }
.profile-form-message { min-height: 1.3em; margin: 0; color: var(--accent-3); font-size: .9rem; }
.profile-form-message.is-success { color: var(--accent); }
.profile-password-hint { margin: 0; color: var(--muted); font-size: .85rem; }
#authLogout { justify-self: start; }
#profileError { grid-column: 2; margin: -22px 0 0; color: var(--accent-3); }
@media (max-width: 760px) {
  .profile-details { grid-template-columns: minmax(0, 1fr); }
  #profileError { grid-column: 1; margin: -12px 0 0; }
  .profile-card { padding: 22px; }
}
.page-main h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.1; }

.section-tab-icon {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.auth-dialog h2 { margin: 0 42px 16px 0; font-size: 1.8rem; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #11100f; }
.auth-tab { flex: 1; min-height: 40px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.auth-tab.is-active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: 0.88rem; }
.auth-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #11100f; color: var(--text); font: inherit; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #4ed28a20; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 5px; justify-content: center; cursor: pointer; }
.auth-message { min-height: 1.4em; margin: 14px 0 0; color: var(--accent-3); font-size: 0.88rem; }
.auth-message.is-success { color: var(--accent); }
.auth-message:empty { display: none; }
.auth-profile { display: grid; justify-items: center; gap: 8px; padding: 12px 0 0; }
.profile-avatar { display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid #72e8a7; border-radius: 20px; background: linear-gradient(145deg, #7cf0ad, #2eaa70); color: #092014; font-size: 1.8rem; font-weight: 900; }
.profile-name { margin: 8px 0 0; font-size: 1.2rem; font-weight: 800; }
.profile-email { margin: 0 0 12px; color: var(--muted); }

.hero-section,
.section-band,
.contact-section {
  padding: clamp(56px, 8vw, 100px) clamp(18px, 4vw, 56px);
}

.hero-section {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  min-height: auto;
  padding-bottom: clamp(34px, 6vw, 76px);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.04;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3.2rem, 8vw, 7.6rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2.25rem, 4.8vw, 4.8rem);
  letter-spacing: 0;
}

h3 {
  font-size: 1.55rem;
  letter-spacing: 0;
}

.hero-text,
.section-heading p,
.contact-copy p {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}

.hero-actions,
.social-row,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.action,
.social-link,
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action:hover,
.social-link:hover,
.project-link:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 240, 232, 0.38);
}

.action.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--ink);
}

.social-link-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.social-link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-link-icon--github svg {
  fill: currentColor;
  stroke: none;
}

.social-link-icon svg path {
  vector-effect: non-scaling-stroke;
}

.social-link-label {
  white-space: nowrap;
}

.section-band {
  border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(260px, 0.4fr);
  align-items: end;
  gap: 28px;
  margin-bottom: 32px;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -18px;
}

.section-heading p {
  margin: 0;
}

.section-heading.compact {
  grid-template-columns: 1fr;
  align-items: start;
}

.section-heading.compact .eyebrow {
  grid-column: auto;
  margin-bottom: 0;
}

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

.project-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-card.is-clickable {
  cursor: pointer;
}

.project-card.is-clickable:hover,
.project-card.is-clickable:focus-visible {
  transform: translateY(-8px);
  border-color: rgba(245, 240, 232, 0.34);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  outline: none;
}

.project-card.is-clickable:hover .project-art img,
.project-card.is-clickable:focus-visible .project-art img {
  transform: scale(1.04);
}

.project-art {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(245, 240, 232, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(245, 240, 232, 0.08) 1px, transparent 1px),
    var(--art-bg, #2a3126);
  background-size: 28px 28px;
}

.project-art img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  object-position: center;
  transition: transform 220ms ease;
}

.project-art.has-image::before,
.project-art.has-image::after {
  content: none;
}

.project-art::before,
.project-art::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(245, 240, 232, 0.86);
}

.project-art::before {
  left: 18%;
  top: 24%;
  width: 24%;
  height: 36%;
  background: var(--art-a, #4ed28a);
  box-shadow: 78px 38px 0 -18px var(--art-b, #f0b84f);
}

.project-art::after {
  right: 13%;
  bottom: 17%;
  width: 22%;
  height: 22%;
  background: var(--art-c, #ef6f61);
  transform: rotate(8deg);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.project-meta,
.tag-list,
.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span,
.tag,
.platform {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.project-card h3 {
  min-height: 2.9rem;
}

.project-card p {
  margin: 0;
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.screenshot-thumb {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d0c0b;
  padding: 0;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.screenshot-thumb:hover img {
  transform: scale(1.06);
}

.project-link {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.88rem;
}

.skill-band {
  background: #151311;
}

.skill-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.skill-tree {
  display: grid;
  gap: 14px;
}

.skill-root {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 14px;
  font-weight: 900;
}

.skill-root::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 14px;
  background: rgba(245, 240, 232, 0.16);
}

.skill-branch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.skill-branch {
  padding: 18px;
  border-left: 4px solid var(--skill-accent, var(--accent));
}

.skill-branch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.skill-branch-head h3 {
  margin-top: 4px;
  font-size: 1.08rem;
}

.skill-branch-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.skill-node-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.skill-node {
  border: 1px solid rgba(245, 240, 232, 0.08);
  border-radius: 8px;
  background: rgba(13, 12, 11, 0.34);
  padding: 14px;
}

.skill-node-top,
.skill-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.skill-node-top strong {
  display: block;
  font-size: 1.02rem;
}

.skill-node-top span,
.skill-summary-rank,
.skill-summary-meta,
.skill-node-foot {
  color: var(--muted);
}

.skill-tier {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: var(--skill-accent, var(--accent));
  color: var(--ink);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 900;
}

.skill-node p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.skill-node-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.skill-track {
  overflow: hidden;
  height: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d0c0b;
}

.skill-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--skill-accent, var(--accent));
  transition: width 260ms ease;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(260px, 0.25fr);
  align-items: center;
  gap: 28px;
  border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.contact-links {
  justify-content: flex-end;
  margin-top: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 8, 0.72);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-modal .modal-backdrop {
  border: 0;
  margin: 0;
  padding: 0;
}

.modal-dialog.auth-dialog {
  --auth-size: min(520px, calc(100vw - 36px), calc(100vh - 36px));
  width: var(--auth-size);
  height: var(--auth-size);
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: clamp(18px, 4vw, 24px);
  border-radius: 12px;
}

.auth-dialog::-webkit-scrollbar {
  display: none;
}

@supports (height: 100dvh) {
  .modal-dialog.auth-dialog {
    --auth-size: min(520px, calc(100vw - 36px), calc(100dvh - 36px));
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.modal-text {
  color: var(--muted);
}

.email-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 20px;
}

.email-copy-row code {
  display: flex;
  align-items: center;
  min-height: 46px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0c0b;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
}

.copy-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 900;
}

.copy-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.gallery-dialog {
  width: min(100%, 1080px);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto;
  grid-auto-rows: max-content;
  gap: 16px;
  overflow: auto;
}

.gallery-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-right: 44px;
}

.gallery-counter {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.gallery-details {
  display: grid;
  gap: 12px;
}

.gallery-details p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
}

.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.gallery-trailer {
  display: block;
}

.trailer-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0c0b;
  aspect-ratio: 16 / 9;
}

.trailer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer-empty {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
}

.trailer-empty span {
  color: var(--text);
  font-weight: 900;
}

.trailer-empty p {
  margin: 0;
}

.trailer-link {
  width: max-content;
}

.gallery-viewer {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  height: clamp(240px, 58vh, 720px);
  height: clamp(240px, 58dvh, 720px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0c0b;
}

.gallery-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 54px;
  border: 1px solid rgba(245, 240, 232, 0.22);
  border-radius: 8px;
  background: rgba(17, 16, 15, 0.82);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-arrow-prev {
  left: 12px;
}

.gallery-arrow-next {
  right: 12px;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 112px;
  overflow-x: auto;
  padding: 3px 3px 8px;
  gap: 8px;
}

.gallery-thumb {
  overflow: hidden;
  min-width: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #0d0c0b;
  padding: 0;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.gallery-thumb.is-active {
  border-color: var(--accent);
}

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

/* Dimensional accents, built entirely with CSS. */
.hero-section {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  overflow: hidden;
  background: radial-gradient(ellipse at 85% 45%, #4ed28a12, transparent 55%);
}

.hero-sculpture {
  position: relative;
  display: grid;
  place-items: center;
  height: 390px;
  perspective: 900px;
  pointer-events: none;
}

.sculpture-cube {
  position: relative;
  width: 170px;
  height: 170px;
  transform-style: preserve-3d;
  transform: translateY(-28px) rotateX(-24deg) rotateY(-34deg);
  animation: cube-hover 7s ease-in-out infinite;
}

.cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid #b3ffd5aa;
  background: linear-gradient(145deg, #72edaa, #239458);
  box-shadow: inset 0 0 24px #c7ffe940;
  color: #103a27;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  backface-visibility: hidden;
}

.cube-front { transform: translateZ(85px); }
.cube-back { transform: rotateY(180deg) translateZ(85px); }
.cube-right {
  transform: rotateY(90deg) translateZ(85px);
  background: linear-gradient(145deg, #27925a, #12442e);
  color: #91f7be;
  font-size: 4rem;
}
.cube-left { transform: rotateY(-90deg) translateZ(85px); }
.cube-top {
  transform: rotateX(90deg) translateZ(85px);
  background: linear-gradient(145deg, #c0ffdb, #59d891);
}
.cube-bottom { transform: rotateX(-90deg) translateZ(85px); }

.sculpture-plinth {
  position: absolute;
  bottom: 24px;
  width: 260px;
  height: 160px;
  border: 1px solid #4ed28a40;
  border-radius: 50%;
  background: radial-gradient(ellipse, #4ed28a25, #232a24 55%, #171b18 72%);
  transform: rotateX(64deg);
  box-shadow: 0 12px 0 #101713, 0 14px 0 #355040, 0 35px 50px #0009;
}

.sculpture-orbit {
  position: absolute;
  width: 310px;
  height: 310px;
  border: 1px solid #4ed28a26;
  border-radius: 50%;
  transform: rotateX(62deg) rotateZ(-25deg);
}

.brand-mark {
  background: linear-gradient(145deg, #96f5bf, var(--accent) 60%, #32ac6b);
  border-color: #9af8c36b;
  box-shadow: inset 0 1px 0 #ffffff70, 0 3px 0 #22653f, 0 6px 12px #0005;
}

.action,
.social-link,
.project-link {
  background: linear-gradient(160deg, #302c27, var(--panel));
  box-shadow: inset 0 1px 0 #ffffff0d, 0 3px 0 #090908, 0 6px 12px #0003;
}

.action.primary {
  background: linear-gradient(155deg, #8aefb5, var(--accent) 65%, #36b573);
  box-shadow: inset 0 1px 0 #ffffff70, 0 4px 0 #216840, 0 9px 22px #4ed28a18;
}

.action:active,
.social-link:active,
.project-link:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 4px #0003, 0 1px 0 #090908;
}

.project-card,
.skill-branch {
  background: linear-gradient(145deg, #2a2621, var(--panel) 65%);
  border-top-color: #665b4b;
  box-shadow: inset 0 1px 0 #ffffff06, 0 5px 0 #0c0b0a, 0 16px 28px #0003;
}

.participant-count { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.posts-section { max-width: 1380px; margin: 0 auto; padding-top: clamp(48px, 7vw, 88px); }
.posts-hero { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 270px; gap: 28px; overflow: hidden; padding: clamp(28px, 5vw, 60px); border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(ellipse at 86% 12%, #4ed28a22, transparent 34%), linear-gradient(135deg, #211f1b, #151412 72%); box-shadow: inset 0 1px 0 #ffffff0a, 0 18px 38px #0003; }
.posts-hero::after { position: absolute; right: 145px; bottom: -160px; width: 360px; height: 360px; border: 1px solid #4ed28a22; border-radius: 50%; box-shadow: 0 0 0 28px #4ed28a08, 0 0 0 58px #4ed28a06; content: ""; pointer-events: none; }
.posts-hero-copy { position: relative; z-index: 1; max-width: 720px; }
.posts-hero-copy .eyebrow { color: var(--accent); }
.posts-hero h1 { margin: 12px 0 14px; font-size: clamp(3rem, 7vw, 5.5rem); }
.posts-hero-copy > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); }
.posts-hero-stamp { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; flex: 0 0 180px; width: 180px; height: 180px; border: 1px solid #4ed28a66; border-radius: 50%; background: #11100f99; color: var(--accent); transform: rotate(8deg); }
.posts-hero-stamp span { font-size: .75rem; font-weight: 900; letter-spacing: .24em; }
.posts-hero-stamp strong { margin-top: 5px; color: var(--text); font-size: 2rem; line-height: .95; letter-spacing: .1em; text-align: center; }
.posts-feed-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 980px; margin: 46px auto 18px; }
.posts-feed-heading > div { display: flex; align-items: center; gap: 10px; }
.posts-feed-heading h2 { margin: 0; font-size: 1.1rem; }
.posts-feed-heading > span { color: var(--muted); font-size: .88rem; }
.posts-feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px #4ed28a88; }
.posts-list { display: grid; gap: 22px; max-width: 980px; margin: 0 auto; }
.post-empty { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 20px; min-height: 190px; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #211f1b, #171614 72%); box-shadow: inset 0 1px 0 #ffffff08, 0 12px 28px #0002; }
.post-empty-icon { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid #4ed28a55; border-radius: 18px; background: linear-gradient(145deg, #4ed28a24, #4ed28a08); color: var(--accent); font-size: .9rem; font-weight: 950; letter-spacing: .08em; }
.post-empty-copy { display: grid; gap: 7px; }
.post-empty-kicker { margin: 0; color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.post-empty h2 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.post-empty-copy > p:last-child { margin: 0; color: var(--muted); }
.post-empty-loading { min-height: 130px; }
.post-empty-loading > p { margin: 0; color: var(--muted); }
.post-empty.is-error { border-color: #ef6f6166; }
.post-card { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; background: linear-gradient(145deg, #211f1b, var(--panel) 68%); box-shadow: inset 0 1px 0 #ffffff08, 0 14px 30px #0002; }
.post-head, .post-reactions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.post-head h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.post-head time, .post-comment time { color: var(--muted); font-size: .84rem; }
.post-body { margin: 0; color: #e5ddd1; white-space: pre-wrap; line-height: 1.75; }
.post-media { display: block; width: 100%; max-height: 680px; border: 1px solid var(--line); border-radius: 10px; background: #0d0c0b; object-fit: contain; }
.post-reactions { justify-content: flex-start; padding-bottom: 4px; }
.post-reactions .action { min-width: 82px; }
.post-reactions .is-reacted { border-color: var(--accent); color: var(--accent); }
.post-comments { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.post-comments h3 { margin: 0; font-size: 1rem; }
.post-comment-list { display: grid; gap: 10px; }
.post-comment { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 14px; border: 1px solid #ffffff0a; border-radius: 9px; background: rgba(0,0,0,.18); }
.post-comment p { grid-column: 1 / -1; margin: 0; white-space: pre-wrap; }
.post-comment-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 8px; }
.post-comment-form textarea { grid-column: 1 / -1; width: 100%; }
@media (max-width: 680px) {
  .posts-hero { min-height: 220px; }
  .posts-hero-stamp { flex-basis: 92px; width: 92px; height: 92px; }
  .posts-hero-stamp strong { font-size: 1.25rem; }
  .posts-feed-heading { align-items: flex-start; flex-direction: column; margin-top: 32px; }
  .post-empty { grid-template-columns: 1fr; gap: 14px; }
  .post-comment-form { grid-template-columns: minmax(0,1fr); }
  .post-comment-form button { justify-self: start; }
}

.giveaways-section { max-width: 1380px; margin: 0 auto; padding-top: clamp(48px, 7vw, 88px); }
.giveaways-hero { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 270px; gap: 28px; overflow: hidden; padding: clamp(28px, 5vw, 60px); border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(ellipse at 84% 14%, #f0b84f20, transparent 34%), linear-gradient(135deg, #211f1b, #151412 72%); box-shadow: inset 0 1px 0 #ffffff0a, 0 18px 38px #0003; }
.giveaways-hero::after { position: absolute; right: 150px; bottom: -160px; width: 360px; height: 360px; border: 1px solid #f0b84f22; border-radius: 50%; box-shadow: 0 0 0 28px #f0b84f08, 0 0 0 58px #f0b84f06; content: ""; pointer-events: none; }
.giveaways-hero-copy { position: relative; z-index: 1; max-width: 740px; }
.giveaways-hero-copy .eyebrow { color: var(--accent-2); }
.giveaways-hero h1 { margin: 12px 0 14px; font-size: clamp(3rem, 7vw, 5.5rem); }
.giveaways-hero-copy > p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); }
.giveaways-hero-stamp { position: relative; z-index: 1; display: grid; place-content: center; justify-items: center; flex: 0 0 180px; width: 180px; height: 180px; border: 1px solid #f0b84f66; border-radius: 50%; background: #11100f99; color: var(--accent-2); transform: rotate(-8deg); }
.giveaways-hero-stamp span { font-size: .75rem; font-weight: 900; letter-spacing: .24em; }
.giveaways-hero-stamp strong { color: var(--text); font-size: 1.55rem; letter-spacing: .12em; }
.giveaways-hero-stamp i { margin-top: 4px; font-size: 1.5rem; font-style: normal; }
.giveaways-feed-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 46px 0 18px; }
.giveaways-feed-heading > div { display: flex; align-items: center; gap: 10px; }
.giveaways-feed-heading h2 { margin: 0; font-size: 1.1rem; }
.giveaways-feed-heading > span { color: var(--muted); font-size: .88rem; }
.giveaways-feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 14px #f0b84f88; }
.giveaway-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); align-items: stretch; gap: 18px; }
.giveaway-card { position: relative; display: grid; align-content: start; gap: 14px; min-width: 0; padding: 24px; border: 1px solid var(--line); border-top-color: #f0b84f66; border-radius: 14px; background: linear-gradient(145deg, #211f1b, var(--panel) 68%); box-shadow: inset 0 1px 0 #ffffff08, 0 12px 26px #0002; }
.giveaway-card.is-completed { border-top-color: #777064; }
.giveaway-status { justify-self: start; padding: 6px 10px; border: 1px solid #f0b84f55; border-radius: 999px; color: var(--accent-2); font-size: .72rem; font-weight: 850; letter-spacing: .05em; }
.giveaway-status.is-completed { border-color: #77706466; color: var(--muted); }
.giveaway-card h2 { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.65rem); line-height: 1.2; overflow-wrap: anywhere; }
.giveaway-project { margin: -6px 0 0; color: var(--accent); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.giveaway-description { margin: 0; color: var(--muted); line-height: 1.6; }
.giveaway-prize { display: flex; align-items: baseline; gap: 9px; margin: 2px 0; }
.giveaway-prize strong { color: var(--accent-2); font-size: 2.3rem; line-height: 1; }
.giveaway-prize span { color: var(--text); font-size: .9rem; font-weight: 750; }
.giveaway-timer-block { display: grid; gap: 4px; padding: 13px 15px; border: 1px solid #f0b84f25; border-radius: 9px; background: #f0b84f08; }
.giveaway-timer-block small { color: var(--muted); font-size: .76rem; }
.giveaway-timer { color: var(--accent-2); font-size: 1rem; font-variant-numeric: tabular-nums; }
.giveaway-timer-block.is-completed .giveaway-timer { color: var(--muted); font-size: .88rem; }
.giveaway-card-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 4px; }
.giveaway-participants { color: var(--muted); font-size: .85rem; }
.giveaway-empty { display: flex; align-items: center; gap: 20px; min-height: 170px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #211f1b, #171614 72%); box-shadow: inset 0 1px 0 #ffffff08, 0 12px 28px #0002; }
.giveaway-empty-icon { display: grid; place-items: center; flex: 0 0 70px; width: 70px; height: 70px; border: 1px solid #f0b84f55; border-radius: 18px; background: #f0b84f10; color: var(--accent-2); font-size: .85rem; font-weight: 950; letter-spacing: .08em; }
.giveaway-empty small { color: var(--accent-2); font-size: .72rem; font-weight: 850; letter-spacing: .15em; }
.giveaway-empty h2 { margin: 6px 0; font-size: 1.4rem; }
.giveaway-empty p { margin: 0; color: var(--muted); }
.giveaway-empty.is-error { border-color: #ef6f6166; }
@media (max-width: 680px) {
  .giveaways-hero { min-height: 220px; }
  .giveaways-hero-stamp { flex-basis: 92px; width: 92px; height: 92px; }
  .giveaways-hero-stamp strong { font-size: 1rem; }
  .giveaways-feed-heading { align-items: flex-start; flex-direction: column; margin-top: 32px; }
  .giveaway-empty { align-items: flex-start; flex-direction: column; }
}

.skill-node {
  background: linear-gradient(150deg, #24211d, #171512);
  box-shadow: inset 0 1px 0 #ffffff08, 0 3px 6px #0003;
}

.skill-track { box-shadow: inset 0 2px 4px #0009; }
.skill-fill {
  background: linear-gradient(#ffffff50, #ffffff00 55%, #00000028), var(--skill-accent, var(--accent));
  box-shadow: inset 0 1px 0 #ffffff70;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

@media (hover: hover) and (pointer: fine) {
  .project-card.is-clickable:hover {
    transform: perspective(1100px) translateY(-8px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 5px 8px 0 #0c0b0a, 0 24px 40px #0006;
  }
}

@keyframes cube-hover {
  0%, 100% { transform: translateY(-28px) rotateX(-24deg) rotateY(-34deg); }
  50% { transform: translateY(-42px) rotateX(-19deg) rotateY(-24deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .project-card.is-clickable:hover,
  .project-card.is-clickable:focus-visible { transform: none; }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand-text { display: none; }
  .section-tabs { overflow-x: auto; justify-self: stretch; }
  .header-actions { gap: 8px; }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .account-link {
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .hero-section,
  .section-heading,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-sculpture {
    height: 300px;
  }

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

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    gap: 12px;
    min-height: 66px;
  }

  .section-tabs {
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding: 0;
  }

  .section-tab {
    flex: 0 0 auto;
    min-height: 42px;
    gap: 7px;
    padding: 0 14px;
    font-size: 0.82rem;
  }

  .section-tab-icon { display: none; }
  .lang-switch { min-width: 64px; }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text {
    max-width: 150px;
  }

  .account-link {
    max-width: 116px;
    padding: 4px 7px;
    font-size: 0.69rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }

  .hero-section,
  .section-band,
  .contact-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 3rem;
  }

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

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

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

  .gallery-heading {
    display: block;
  }

  .skill-branch-head,
  .skill-node-top {
    flex-direction: column;
  }

  .skill-branch-count,
  .skill-tier {
    width: max-content;
  }

  .gallery-thumbs {
    grid-auto-columns: 88px;
  }

  .gallery-arrow {
    width: 38px;
    height: 48px;
  }
}

/* Studio posts feed and full post dialog */
.posts-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)); align-items: stretch; gap: 18px; max-width: 1120px; }
.post-card { position: relative; display: flex; flex-direction: column; gap: 0; min-width: 0; max-width: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid #ffffff12; border-top-color: #4ed28a55; border-left: 1px solid #ffffff12; border-radius: 16px; background: linear-gradient(145deg, #211f1c, #171614 72%); box-shadow: inset 0 1px #ffffff08, 0 12px 30px #0003; transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
.post-card:hover { transform: translateY(-4px); border-color: #4ed28a52; box-shadow: inset 0 1px #ffffff0b, 0 20px 42px #0005; }
.post-card-open { display: flex; flex: 1; flex-direction: column; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.post-card-open:hover { border-color: transparent; background: transparent; transform: none; box-shadow: none; }
.post-card-open:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -4px; }
.post-card-media { position: relative; width: 100%; aspect-ratio: 16 / 8.5; overflow: hidden; border-bottom: 1px solid #ffffff12; background: radial-gradient(ellipse at 50% 20%, #4ed28a20, transparent 60%), #11120f; }
.post-card-image, .post-card-video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms cubic-bezier(.2,.8,.2,1), filter 400ms ease; }
.post-card:hover .post-card-image, .post-card:hover .post-card-video { transform: scale(1.035); filter: saturate(1.08); }
.post-media-badge { position: absolute; right: 12px; bottom: 12px; padding: 7px 10px; border: 1px solid #ffffff24; border-radius: 999px; background: #0d100edb; color: #f1f0e9; font-size: .72rem; font-weight: 800; backdrop-filter: blur(8px); }
.post-card-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 12px; width: 100%; padding: 21px 22px 17px; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; width: 100%; }
.post-card-label { color: var(--accent); font-size: .66rem; font-weight: 900; letter-spacing: .15em; }
.post-card-meta time { color: var(--muted); font-size: .76rem; }
.post-card h2 { margin: 0; color: var(--text); font-size: clamp(1.35rem, 2.3vw, 1.8rem); line-height: 1.18; letter-spacing: -.025em; overflow-wrap: anywhere; }
.post-card-excerpt { display: -webkit-box; margin: 0; overflow: hidden; color: #c1beb5; font-size: .92rem; line-height: 1.65; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.post-open-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; color: var(--accent); font-size: .82rem; font-weight: 800; }
.post-open-hint span { display: inline-block; transition: transform 180ms ease; }
.post-card:hover .post-open-hint span { transform: translate(3px, -2px); }
.post-card-footer { display: flex; align-items: center; min-height: 60px; padding: 10px 20px; border-top: 1px solid #ffffff10; background: #0c0e0d44; }
.post-card-reactions { display: flex; justify-content: flex-start; align-items: center; gap: 8px; width: 100%; padding: 0; }
.post-reaction { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 64px; min-height: 36px; padding: 0 10px; border: 1px solid #ffffff13; border-radius: 9px; background: #ffffff05; color: #c8c9c1; font-size: .84rem; transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.post-reaction > span { color: #9da69d; font-size: 1rem; }
.post-reaction > b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.post-reaction:hover { transform: translateY(-2px); border-color: #ffffff36; background: #ffffff0b; color: var(--text); }
.post-reaction[data-reaction="like"] > span { color: #67d99b; }
.post-reaction[data-reaction="dislike"] > span { color: #d0a78e; }
.post-reaction.is-reacted { border-color: #4ed28a66; background: #4ed28a12; color: #9ceabb; }
.post-reaction[data-reaction="dislike"].is-reacted { border-color: #d6907666; background: #d6907612; color: #f1b59e; }
.post-comment-count { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.post-comment-count > span { color: var(--accent); font-size: 1rem; }
.post-comment-count b { color: var(--text); font-variant-numeric: tabular-nums; }

.post-dialog { width: min(1060px, calc(100vw - 32px)); max-width: none; max-height: min(900px, calc(100vh - 32px)); margin: auto; padding: 0; overflow: auto; border: 1px solid #58635a; border-radius: 18px; background: #171a18; color: var(--text); box-shadow: 0 30px 100px #000b; scrollbar-color: #59655c #111412; }
.post-dialog[open] { animation: post-dialog-enter 220ms cubic-bezier(.2,.8,.2,1) both; }
.post-dialog::backdrop { background: #080a09c9; backdrop-filter: blur(9px); animation: post-backdrop-enter 200ms ease both; }
.post-dialog-shell { padding: clamp(18px, 3vw, 30px); }
.post-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #ffffff13; }
.post-dialog-heading { min-width: 0; }
.post-dialog-kicker { margin: 0 0 8px; color: var(--accent); font-size: .66rem; font-weight: 900; letter-spacing: .16em; }
.post-dialog-header h2 { margin: 0; padding-right: 8px; font-size: clamp(1.65rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.post-dialog-header time { display: block; margin-top: 9px; color: var(--muted); font-size: .8rem; }
.post-dialog-close { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; padding: 0 0 3px; border: 1px solid #ffffff1c; border-radius: 12px; background: #ffffff08; color: #dddcd4; font-size: 1.7rem; line-height: 1; cursor: pointer; transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease; }
.post-dialog-close:hover { transform: rotate(5deg); border-color: #ef8f8566; background: #ef8f8512; color: #ffb4a9; }
.post-dialog-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 24px; padding-top: 22px; }
.post-dialog-main { display: grid; align-content: start; gap: 18px; min-width: 0; }
.post-dialog-main .post-media { max-height: 520px; aspect-ratio: 16 / 10; background: #0e100f; }
.post-dialog-body { margin: 0; color: #dedbd2; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-dialog-reactions { display: flex; justify-content: flex-start; align-items: center; gap: 9px; padding-top: 16px; border-top: 1px solid #ffffff13; }
.post-modal-comments { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 17px; border: 1px solid #ffffff12; border-radius: 13px; background: linear-gradient(155deg, #1d211e, #141715); }
.post-modal-comments-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.post-modal-comments-header h3 { margin: 0; font-size: 1.05rem; }
.post-modal-comment-total { display: grid; min-width: 27px; height: 27px; place-items: center; padding: 0 7px; border: 1px solid #4ed28a44; border-radius: 999px; background: #4ed28a10; color: #8ce2b1; font-size: .76rem; font-weight: 850; }
.post-comment-list { display: grid; align-content: start; gap: 9px; max-height: 370px; overflow: auto; padding-right: 3px; }
.post-comment { grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; padding: 11px; border: 1px solid #ffffff0c; border-radius: 11px; background: #101311a8; }
.post-comment-avatar { display: grid; grid-row: span 2; place-items: center; width: 32px; height: 32px; border: 1px solid #4ed28a44; border-radius: 10px; background: linear-gradient(145deg, #4ed28a27, #4ed28a08); color: #85e3ac; font-size: .8rem; font-weight: 900; }
.post-comment-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.post-comment-heading strong { overflow: hidden; color: #f0eee7; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.post-comment-heading time { flex: 0 0 auto; font-size: .66rem; }
.post-comment p { grid-column: 2; margin: 0; color: #c6c7bf; font-size: .84rem; line-height: 1.55; overflow-wrap: anywhere; }
.post-comments-status { margin: 0; padding: 16px 10px; color: var(--muted); font-size: .84rem; line-height: 1.5; text-align: center; }
.post-comments-status.is-error { color: #efaaa0; }
.post-comment-form { grid-template-columns: minmax(0, 1fr); gap: 9px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid #ffffff12; }
.post-comment-form textarea { grid-column: 1; min-height: 94px; padding: 12px; border: 1px solid #424d45; border-radius: 10px; background: #101412; color: var(--text); font: inherit; line-height: 1.5; resize: vertical; }
.post-comment-form textarea:focus { border-color: #4ed28a99; outline: 3px solid #4ed28a19; }
.post-comment-form button { width: 100%; min-height: 43px; border-radius: 10px; }
.post-comment-status { min-height: 1em; color: var(--muted); font-size: .76rem; line-height: 1.4; }
@keyframes post-dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes post-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .posts-section { padding-top: 26px; }
  .posts-hero { min-height: 210px; padding: 28px; }
  .posts-list { grid-template-columns: minmax(0, 1fr); }
  .post-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  .post-dialog-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .post-comment-list { max-height: 300px; }
}
@media (max-width: 480px) {
  .post-card-content { padding: 17px; }
  .post-card-footer { padding: 9px 14px; }
  .post-card-reactions { gap: 5px; }
  .post-reaction { min-width: 55px; padding: 0 8px; }
  .post-comment-count { gap: 4px; font-size: .7rem; }
  .post-dialog-shell { padding: 16px; }
  .post-dialog-header { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card-image, .post-card-video, .post-reaction, .post-open-hint span, .post-dialog[open], .post-dialog::backdrop { animation-duration: .01ms; transition-duration: .01ms; }
}

/* Keep the shared header geometry unchanged while account and stats load. */
html { scrollbar-gutter: stable; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: 72px;
  align-items: center;
  gap: 0 14px;
  height: 72px;
  min-height: 72px;
  flex-wrap: nowrap;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(17, 16, 15, .96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.site-header > .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.site-header > .section-tabs {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  grid-column: auto;
  grid-row: auto;
  flex: none;
  justify-self: auto;
  width: max-content;
  max-width: calc(100vw - 980px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 3px;
  scrollbar-width: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.site-header > .section-tabs::-webkit-scrollbar { display: none; }
.site-header > .participant-count {
  grid-column: 2;
  grid-row: 1;
  width: 150px;
  min-width: 150px;
  min-height: 38px;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 0 9px;
  text-overflow: ellipsis;
}
.site-header > .header-actions { grid-column: 3; grid-row: 1; gap: 12px; margin: 0; }
.site-header .lang-switch { flex: 0 0 80px; width: 80px; }
.site-header .account-link { flex: 0 0 156px; width: 156px; min-width: 0; padding: 0 8px; white-space: nowrap; }

@media (max-width: 1540px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-rows: 58px 48px;
    gap: 0 12px;
    height: auto;
    min-height: 106px;
    padding-top: 5px;
    padding-bottom: 7px;
  }
  .site-header > .brand { grid-column: 1; grid-row: 1; }
  .site-header > .participant-count { grid-column: 3; grid-row: 1; }
  .site-header > .header-actions { grid-column: 4; grid-row: 1; }
  .site-header > .section-tabs {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    transform: none;
  }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .site-header > .brand-text { display: none; }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 52px 46px;
    gap: 0 8px;
    min-height: 104px;
    padding: 5px 12px 7px;
  }
  .site-header > .brand { grid-column: 1; grid-row: 1; }
  .site-header > .participant-count {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 110px;
    min-width: 0;
    min-height: 34px;
    font-size: .7rem;
  }
  .site-header > .header-actions { grid-column: 3; grid-row: 1; gap: 6px; }
  .site-header .lang-switch { flex-basis: 62px; width: 62px; min-width: 62px; }
  .site-header .account-link {
    flex-basis: 96px;
    width: 96px;
    max-width: 96px;
    min-height: 36px;
    padding: 3px 6px;
    font-size: .68rem;
    line-height: 1.1;
    white-space: normal;
    text-align: center;
  }
  .site-header > .section-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 7px;
    padding: 0 1px 2px;
  }
}
