/* ===========================================================
   SolarNest Stylesheet
   Namespaced with slug: sn-
   =========================================================== */

/* -----------------------------------------------------------
   COLOR TOKENS
   ----------------------------------------------------------- */
:root {
  --sn-primary: #f4c86c;         /* warm solar accent */
  --sn-primary-soft: #f8dca0;
  --sn-paper: #faf7f2;           /* page background */
  --sn-ink: #1a1a1a;             /* main text color */
  --sn-muted: #6b6b6b;

  --sn-surface: #ffffff;
  --sn-surface-soft: #f3efe7;

  --sn-shadow-soft: rgba(0,0,0,0.08);
  --sn-shadow-warm: rgba(0,0,0,0.12);

  --sn-edge-soft: rgba(0,0,0,0.15);
  --sn-edge-strong: rgba(0,0,0,0.28);

  /* Motion tokens */
  --sn-motion-fast: 150ms;
  --sn-motion-med: 260ms;
  --sn-motion-slow: 420ms;
  --sn-easing: cubic-bezier(.22,.61,.36,1);
}

/* Reduced motion override */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* -----------------------------------------------------------
   BASE RESET + TYPOGRAPHY
   ----------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  background: var(--sn-paper);
  color: var(--sn-ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

/* Mandatory paragraph justification */
article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
}

/* -----------------------------------------------------------
   LAYOUT SYSTEM (single wide column)
   ----------------------------------------------------------- */
.sn-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
}

.sn-article {
  background: var(--sn-surface);
  padding: 28px;
  border-radius: 14px;
  box-shadow: 0 4px 18px var(--sn-shadow-soft);
}

/* -----------------------------------------------------------
   HEADER + NAVIGATION
   ----------------------------------------------------------- */
.sn-header {
  background: var(--sn-surface);
  box-shadow: 0 2px 10px var(--sn-shadow-soft);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Pill style nav buttons */
.sn-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sn-nav li {
  margin: 0;
}

.sn-nav a {
  color: var(--sn-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
  display: inline-block;
  transition:
    background var(--sn-motion-fast) var(--sn-easing),
    box-shadow var(--sn-motion-fast) var(--sn-easing),
    transform var(--sn-motion-fast) var(--sn-easing);
}

/* Link underline grow */
.sn-link,
.sn-nav a {
  position: relative;
  border-bottom: none;
}

.sn-link::after,
.sn-nav a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--sn-primary), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--sn-motion-med) var(--sn-easing);
}

.sn-link:hover::after,
.sn-nav a:hover::after {
  transform: scaleX(1);
}

.sn-nav a:hover {
  background: var(--sn-primary-soft);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* -----------------------------------------------------------
   HEADINGS
   ----------------------------------------------------------- */
.sn-h1 {
  font-size: 40px;
  margin-top: 0;
  line-height: 1.25;
}

/* -----------------------------------------------------------
   HERO IMAGE
   ----------------------------------------------------------- */
.sn-hero {
  margin: 24px 0 36px 0;
}

.sn-hero img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 2px solid var(--sn-ink);
  box-shadow: 0 4px 16px var(--sn-shadow-warm);
  max-height: 420px;
  object-fit: cover;
}

/* -----------------------------------------------------------
   SECTION SPACING + NEW DOTTED DIVIDERS
   ----------------------------------------------------------- */
section.sn-section {
  margin-bottom: 48px;
  padding-top: 20px;
  position: relative;
}

/* “Solar bead” dotted divider that grows across the section */
section.sn-section::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  height: 10px;
  width: 0%;
  background-image: radial-gradient(circle, var(--sn-primary) 0 2px, transparent 3px);
  background-repeat: repeat-x;
  background-size: 12px 10px;
  opacity: 0.9;
  transition: width var(--sn-motion-slow) var(--sn-easing);
}

section.sn-section.is-seen::before {
  width: 100%;
}

/* -----------------------------------------------------------
   CARD HOVER LIFT (for future use)
   ----------------------------------------------------------- */
.sn-card {
  border: 1px solid var(--sn-edge-soft);
  border-radius: 12px;
  background: var(--sn-surface);
  padding: 20px;
  transition: transform var(--sn-motion-fast) var(--sn-easing),
              box-shadow var(--sn-motion-fast) var(--sn-easing),
              border-color var(--sn-motion-fast) var(--sn-easing);
}

.sn-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--sn-shadow-soft);
  border-color: var(--sn-edge-strong);
}

/* -----------------------------------------------------------
   SOLAR BACKGROUND WASH (very subtle)
   ----------------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(120% 60% at 70% 20%, rgba(255,255,255,0.07), transparent 60%),
              linear-gradient(120deg, rgba(255,220,150,0.04), rgba(255,255,255,0.04));
  animation: sn-wash 24s ease-in-out infinite alternate;
  opacity: .05;
}

@keyframes sn-wash {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2%,0) scale(1.02); }
}

/* -----------------------------------------------------------
   READING PROGRESS BAR
   ----------------------------------------------------------- */
.sn-progress {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--sn-primary), transparent);
  z-index: 9998;
}

/* -----------------------------------------------------------
   FOOTER (centered and encapsulated in a capsule)
   ----------------------------------------------------------- */
.sn-footer {
  text-align: center;
  padding: 32px;
  margin-top: 60px;
  color: var(--sn-muted);
  font-size: 15px;
}

/* Capsule around the copyright text */
.sn-footer p {
  display: inline-block;
  margin: 0;
  padding: 8px 22px;
  background: var(--sn-surface-soft);
  border-radius: 999px 999px 18px 18px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

/* Fallback if your footer is plain <footer> without class */
footer {
  text-align: center;
}

/* -----------------------------------------------------------
   BACK TO TOP BUTTON (hex-like shape)
   ----------------------------------------------------------- */
.sn-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 0;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--sn-primary);
  color: #111;
  font: 700 20px/54px system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 9999 !important;
  overflow: hidden;

  /* Hexagon shape via clip-path */
  clip-path: polygon(
    50% 0%,
    90% 20%,
    100% 55%,
    50% 100%,
    0% 55%,
    10% 20%
  );
}

.sn-to-top:hover {
  background: #fff;
}

.sn-to-top.sn-show {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;  /* ✅ fixed */
}

/* Ripple animation inside the hex button */
.sn-to-top .ripple {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: .35;
  transform: translate(-50%, -50%) scale(0);
  background: #fff;
  animation: sn-ripple .6s ease-out forwards;
}

@keyframes sn-ripple {
  to {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

/* -----------------------------------------------------------
   RESPONSIVE TWEAKS
   ----------------------------------------------------------- */
@media (max-width: 600px) {
  .sn-article {
    padding: 20px;
  }
  .sn-container {
    padding: 20px;
  }
  .sn-h1 {
    font-size: 32px;
  }
}
