/* ============================================================
   css.css — styles for the model-test gallery
   Palette: soft romantic reds/pinks on a dark wine background.
   System fonts only.
   ============================================================ */

/* ---------- Reset & tokens ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-start: #2b0b16;         /* deep wine */
  --bg-end:   #4a1030;          /* warm plum */
  --card-bg:  rgba(255, 240, 245, 0.06);
  --card-border: rgba(255, 150, 180, 0.25);
  --text:     #ffe4ec;          /* soft pink-white */
  --text-dim: #e8a8bf;          /* muted rose */
  --accent:   #ff5c8a;          /* bright rose pink */
  --accent-2: #ff2d64;          /* deep rose red */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-attachment: fixed;   /* gradient stays put while scrolling */
  min-height: 100vh;
  overflow-x: hidden;             /* falling petals may drift sideways */
  line-height: 1.6;
}

/* ---------- Hero header ---------- */
.hero {
  text-align: center;
  padding: clamp(2.5rem, 7vw, 5rem) 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.7rem, 5vw, 3rem);
  background: linear-gradient(90deg, #ffb3c6, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-dim);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.readme-link {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.readme-link:hover {
  background: rgba(255, 92, 138, 0.18);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Gallery: one section per round ---------- */
#gallery {
  max-width: 1250px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.round-group + .round-group {
  margin-top: 3rem;
}

.round-title {
  text-align: center;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  color: #ffd0dd;
  margin-bottom: 1.25rem;
}

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

/* One model = one card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: card-in 0.6s ease both;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(255, 45, 100, 0.22);
}

/* Staggered entrance for the cards */
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-header h2 {
  font-size: 1.15rem;
  color: #ffd0dd;
}

.model-index {
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}

/* Browser-style preview window */
.preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #1a0912;
  /* Fixed height keeps the grid rows even */
  height: 300px;
}

.preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #1a0912;
}

/* Small "browser chrome" dots on top of the preview */
.preview::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background: rgba(255, 255, 255, 0.07);
  z-index: 2;
  /* three dots drawn as box-shadows */
  background-image: radial-gradient(circle 3px at 12px 7px, #ff5c8a 98%, transparent),
                    radial-gradient(circle 3px at 24px 7px, #ffb3c6 98%, transparent),
                    radial-gradient(circle 3px at 36px 7px, #e8a8bf 98%, transparent);
  pointer-events: none;
}

/* Overlay hint shown while the iframe loads */
.preview .loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.preview.loaded .loading {
  opacity: 0;
  pointer-events: none;
}

/* Card footer: folder link + open button */
.card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto; /* keep buttons aligned at the bottom of the card */
}

.btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  transition: background 0.25s ease, transform 0.15s ease;
  cursor: pointer;
}

.btn-outline {
  color: var(--text-dim);
  border: 1px solid var(--card-border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-fill {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-fill:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0 1.5rem 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- No-JS fallback ---------- */
.noscript-note {
  text-align: center;
  color: var(--text-dim);
  padding: 0 1.5rem;
}

.noscript-list {
  list-style: none;
  text-align: center;
  padding-bottom: 1rem;
}

.noscript-list a {
  color: var(--accent);
}

/* ---------- Falling petals (page level) ---------- */
#petals {
  position: fixed;
  inset: 0;
  pointer-events: none;   /* never block clicks */
  overflow: hidden;
  z-index: 0;             /* behind hero/cards but above body gradient */
}

.petal {
  position: absolute;
  top: -4vh;
  border-radius: 60% 60% 60% 0;   /* asymmetric shape = petal look */
  opacity: 0.8;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  will-change: transform;
}

@keyframes fall {
  /* Drift down with a sideways sway, then rotate away */
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  25%  { transform: translate(15px, 24vh) rotate(90deg) scale(1); }
  50%  { transform: translate(-15px, 50vh) rotate(180deg) scale(1); }
  75%  { transform: translate(15px, 75vh) rotate(270deg) scale(1); }
  100% { transform: translate(-10px, 108vh) rotate(360deg) scale(1); }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;   /* single column on phones */
    gap: 1.1rem;
  }

  .preview {
    height: 240px;
  }

  .card {
    padding: 1rem;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .card, .card:hover { animation: none; transition: none; }
  .petal { animation-duration: 0.001s; opacity: 0; } /* petals effectively off */
}
