:root {
  --sunshine: #f9df4b;
  --sunshine-deep: #f1c742;
  --van-cream: #fff6de;
  --canvas: #f6efe0;
  --forest: #27322c;
  --pine: #365244;
  --sky: #cfe4ff;
  --highlight: #ff8a5f;
  --ink: #161915;
  --muted: #5f625c;
  --card: rgba(255, 255, 255, 0.92);
  --border: rgba(20, 35, 28, 0.12);
  --flower-red: #e04452;
  --flower-purple: #7b5bd6;
  --flower-orange: #ff9a3d;
  --flower-pink: #f76da4;
  --pup: #c8874d;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: "Space Grotesk", "Sen", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.8), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 238, 188, 0.7), transparent 60%),
    linear-gradient(135deg, #fffef8, #fff1c4 55%, #f4fbff);
  min-height: 100vh;
  padding: 2.5rem clamp(1.5rem, 6vw, 4rem) 4rem;
  position: relative;
}

body.modal-open {
  overflow: hidden;
}

body.site-locked {
  overflow: hidden;
}

body.site-locked > :not(.site-gate) {
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 200ms ease;
}

.site-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(circle at 20% 20%, rgba(249, 223, 75, 0.15), transparent 45%), rgba(15, 19, 17, 0.92);
  z-index: 2000;
}

.site-gate[hidden] {
  display: none;
}

.site-gate__card {
  max-width: 420px;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 32px;
  border: 1px solid rgba(20, 35, 28, 0.12);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.site-gate__brand {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--sunshine);
  color: var(--forest);
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(249, 223, 75, 0.4);
}

.site-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-gate__form input {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  background: #fff;
}

.site-gate__error {
  color: var(--flower-red);
  font-size: 0.9rem;
}

.site-gate__hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.texture {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(249, 223, 75, 0.15) 20%, transparent 21%),
    linear-gradient(120deg, rgba(246, 217, 88, 0.18) 0%, rgba(36, 80, 69, 0.1) 52%, rgba(255, 123, 84, 0.16) 100%);
  background-size: 120px 120px, auto;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: -1;
}

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

button {
  font: inherit;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sunshine);
  outline-offset: 2px;
}

button.solid {
  background: var(--forest);
  color: white;
  box-shadow: 0 10px 25px rgba(30, 59, 44, 0.25);
}

button.ghost {
  border: 1px solid var(--forest);
  color: var(--forest);
  background: transparent;
}

button.small {
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
}

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

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.top-bar nav {
  display: flex;
  gap: 1.25rem;
  font-weight: 600;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sunshine);
  color: var(--forest);
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 20px rgba(246, 217, 88, 0.45);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  background: var(--card);
  border-radius: 32px;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  box-shadow: 0 30px 40px rgba(20, 35, 28, 0.12);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: rgba(246, 217, 88, 0.35);
  border-radius: 50%;
  top: -60px;
  right: -40px;
  filter: blur(10px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.1;
  color: var(--forest);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  list-style: none;
  display: flex;
  gap: 2rem;
  padding: 0;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hero-stats span {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--highlight);
}

.hero-card {
  background: linear-gradient(150deg, var(--van-cream), #fff) border-box;
  border-radius: 28px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  position: relative;
  isolation: isolate;
  animation: float 6s ease-in-out infinite;
}

.hero-card__banner,
.hero-card__footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hero-card__illustration {
  width: 100%;
  background: var(--van-cream);
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.hero-card__illustration img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.stories,
.share-panel,
.feed {
  background: var(--card);
  border-radius: 28px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(20, 35, 28, 0.08);
}

.stories header,
.feed header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.story-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1rem;
}

.story-chip {
  aspect-ratio: 1 / 1.2;
  border-radius: 18px;
  padding: 0.5rem;
  background: linear-gradient(180deg, rgba(246, 217, 88, 0.5), rgba(255, 255, 255, 0.9));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  animation: slideUp 500ms ease both;
}

.story-chip img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--forest);
}

.share-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  background: #fff;
}

textarea {
  resize: vertical;
}

.upload {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.upload input {
  flex: 1;
}

[data-file-name] {
  font-size: 0.9rem;
  color: var(--muted);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.card {
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--van-cream);
  border: 1px solid var(--border);
}

.card-avatar--gry {
  background: linear-gradient(135deg, #f7e7f0, #f0d1d9);
}

.card-avatar--helge {
  background: linear-gradient(135deg, #d9a16d, #c4854f);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}

.card-actions button {
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--van-cream);
  font-size: 0.75rem;
}

.badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(246, 217, 88, 0.35);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

footer {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

footer a {
  color: var(--forest);
  font-weight: 600;
}

.rig {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.2rem;
  background: var(--card);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  box-shadow: 0 25px 45px rgba(32, 40, 33, 0.12);
}

.rig-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rig-specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rig-specs li {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
}

.rig-art {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.6));
  border-radius: 24px;
  border: 1px dashed rgba(0, 0, 0, 0.08);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rig-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rig-photo img {
  max-width: 100%;
  border-radius: 20px;
  display: block;
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.18);
}

.rig-photo figcaption {
  font-size: 0.85rem;
  color: var(--muted);
}

.crew {
  background: var(--card);
  border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  box-shadow: 0 25px 40px rgba(20, 35, 28, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.crew header {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.crew-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.toon {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.05);
}

.toon img {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  background: var(--van-cream);
  padding: 0.5rem;
}

.toon figcaption p {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-modal[hidden] {
  display: none;
}

.post-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.post-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 25, 21, 0.7);
  backdrop-filter: blur(4px);
}

.post-modal__card {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  max-width: min(900px, 95vw);
  max-height: 90vh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  align-items: stretch;
  overflow: hidden;
  gap: 0;
}

.post-modal__card > * {
  min-height: 0;
}

.post-modal__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-modal__body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  overflow-y: auto;
}

.post-modal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-modal__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-modal__caption {
  font-size: 1rem;
  line-height: 1.5;
}

.post-modal__footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-modal__comments {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-modal__comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.comment {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

.comment .card-avatar {
  flex-shrink: 0;
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment-text {
  font-size: 0.92rem;
  line-height: 1.4;
}

.comment-empty {
  font-size: 0.9rem;
  color: var(--muted);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.comment-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.75rem;
  font-family: inherit;
}

.comment-helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .post-modal__card {
    grid-template-columns: 1fr;
    max-width: 95vw;
  }

  .post-modal__body {
    padding: 1.5rem;
  }

  .post-modal__comments-list {
    max-height: 160px;
  }
}

@supports (-moz-appearance: none) {
  .post-modal__card {
    height: min(900px, 90vh);
  }

  .post-modal__body {
    height: 100%;
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body {
    padding: 1.5rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-cta,
  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .upload {
    flex-direction: column;
    align-items: flex-start;
  }

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