/* $ALTISM — styles.css (paper/crayon aesthetic, subtle & polished) */

/* Global Reset */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: #1a1a1a;
  background: #f8f5f0;
  line-height: 1.6;
}

/* Sticky Header */
header.sticky {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  border-bottom: 3px solid rgba(255, 148, 77, 0.35);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
}
header .brand { font-weight: 800; letter-spacing: 0.5px; }
#burger { background: none; border: none; display: inline-flex; flex-direction: column; gap: 4px; cursor: pointer; }
#burger span { width: 24px; height: 3px; background: linear-gradient(90deg,#ff7eb6,#ffc857,#6ecb63,#62b6cb,#b896ff); border-radius: 2px; display: block; }
#slideout {
  position: fixed; left: -320px; top: 0; width: 300px; height: 100vh;
  background: #fff; border-right: 4px solid rgba(98,182,203,0.4);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0);
  transition: left .25s ease, box-shadow .25s ease;
  padding: 16px;
}
#slideout.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.25); }
#slideout #close-menu { background: none; border: none; font-size: 20px; cursor: pointer; }
#slideout ul { list-style: none; padding: 0; margin: 12px 0; }
#slideout li { margin: 10px 0; }
#slideout a { text-decoration: none; color: #1a1a1a; font-weight: 700; }

/* Sections */
.section { padding: 56px 16px; max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 24px; }
.section h2 { margin: 0 0 8px; font-size: 28px; }
.section .sub { color: #555; margin: 0; }

/* Hero */
.hero { position: relative; padding: 0; min-height: 70vh; display: grid; place-items: center; overflow: hidden; }
.hero .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero .hero-content { position: relative; text-align: center; padding: 80px 16px; backdrop-filter: saturate(1.1); }
.hero h1 { font-size: 40px; margin: 0 0 8px; letter-spacing: 1px; }
.hero .tagline { font-weight: 700; margin: 0 0 16px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-block; padding: 10px 16px; border: 3px solid #1a1a1a; border-radius: 10px; text-decoration: none; color: #1a1a1a; font-weight: 800; background: #fff; }
.btn:hover { box-shadow: 0 3px 0 #1a1a1a; transform: translateY(-1px); }
.btn.puzzle { border-color: #62b6cb; }
.btn.outline { background: transparent; }

/* Grids */
.grid { display: grid; gap: 16px; align-items: center; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1.1fr .9fr; }
}

/* Frames & Cards */
.frame { width: 100%; height: auto; border: 4px solid rgba(255,200,87,.45); border-radius: 12px; background: #fff; }
.frame.wide { display: block; margin: 0 auto; }
.codes { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; }
.code-card { width: 100%; height: auto; border: 3px solid rgba(110,203,99,.5); border-radius: 12px; background: #fff; }

/* FAQ */
.faq details { border: 3px solid rgba(184,150,255,.4); border-radius: 12px; padding: 8px 12px; margin: 8px 0; background: #fff; }
.faq summary { cursor: pointer; font-weight: 800; }

/* Impact */
.impact .total { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.impact .donations { list-style: none; padding: 0; margin: 0; }
.impact .donations li { display: flex; justify-content: space-between; border-bottom: 1px dashed #ccc; padding: 8px 0; }

/* Footer */
#site-footer { text-align: center; opacity: .9; }
#site-footer .links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#site-footer .tag { color: #444; }

/* Back to Top */
#backToTop {
  position: fixed; right: 16px; bottom: 16px; z-index: 1001;
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid #1a1a1a; background: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 0 #1a1a1a;
}

/* Masonry-ish grid */
.masonry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.masonry.preview { grid-template-columns: repeat(3, 1fr); }
.masonry a img { width: 100%; height: auto; border-radius: 8px; border: 3px solid rgba(255,126,182,.35); background: #fff; }
@media (max-width: 720px) {
  .masonry, .masonry.preview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .masonry, .masonry.preview { grid-template-columns: 1fr; }
}

/* Subpage hero */
.hero-sub { text-align: center; padding-top: 96px; }
.hero-sub h1 { margin: 0; }
.hero-sub .sub { margin: 4px 0 0; }
.tagline.small { margin: 6px 0 0; font-weight: 700; }

/* Hero texture + inline visual */
.hero { background: #f8f5f0; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 6px 6px, 8px 8px;
  background-position: 0 0, 3px 3px;
  mix-blend-mode: multiply;
}
.hero .hero-visual {
  margin: 12px auto 6px;
  display: block;
  width: min(680px, 85vw);
  height: auto;
  border: 4px solid rgba(255,200,87,.45);
  border-radius: 12px;
  background: #fff;
}


/* Hero refinements: no background image; centered visual; subtle crayon texture */
.hero { background: transparent; }
.hero .hero-bg { display: none !important; }
.hero-content.narrow { max-width: 880px; margin: 0 auto; }
.hero-visual { width: min(720px, 90%); height: auto; display: block; margin: 16px auto 8px; border: 4px solid rgba(255,200,87,.45); border-radius: 12px; background: #fff; }

/* Faint crayon texture using multiple subtle gradients */
.hero-paper {
  background:
    repeating-linear-gradient(0deg, rgba(255, 170, 130, 0.05), rgba(255, 170, 130, 0.05) 2px, transparent 2px, transparent 18px),
    repeating-linear-gradient(90deg, rgba(120, 200, 255, 0.035), rgba(120, 200, 255, 0.035) 3px, transparent 3px, transparent 22px);
}
/* Spectrum Archive — 3-column grid layout */
.masonry.archive {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
  gap: 12px;
  align-items: start;
}

.masonry.archive img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.masonry.archive img:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Optional: keep layout consistent on small screens */
@media (max-width: 600px) {
  .masonry.archive {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}
