/* =============================================
   ISI & THE DINO NUGGETS — Stylesheet
   ============================================= */

/* === CUSTOM PROPERTIES === */
:root {
  /* Colour palette */
  --clr-bg:          #fefce8;   /* warm cream */
  --clr-bg-green:    #f0fdf4;   /* soft mint */
  --clr-bg-warm:     #fff7ed;   /* peach */
  --clr-bg-light:    #fffbeb;   /* pale gold */

  --clr-green-deep:  #15803d;
  --clr-green-mid:   #22c55e;
  --clr-green-light: #bbf7d0;

  --clr-nugget:      #d97706;   /* amber / nugget gold */
  --clr-nugget-lt:   #fde68a;
  --clr-nugget-bg:   #fffbeb;

  --clr-volcano:     #f97316;
  --clr-volcano-dk:  #c2410c;

  --clr-text:        #292524;
  --clr-muted:       #78716c;
  --clr-faint:       #a8a29e;
  --clr-border:      #e7e5e4;
  --clr-white:       #ffffff;

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  32px;

  /* Shadows */
  --shadow-sm: 0 2px 8px  rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .10);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .14);

  /* Layout */
  --max-w:     960px;
  --sec-pad:   5rem 1.5rem;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
          Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--clr-text);
  background-color: var(--clr-bg);
}

img, svg { display: block; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* === TYPOGRAPHY SCALE === */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

/* === LAYOUT HELPERS === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* =============================================
   SITE HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 252, 232, .95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--clr-nugget-lt);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--clr-text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  padding: .25rem .1rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--clr-nugget);
  border-bottom-color: var(--clr-nugget);
  outline: none;
}


/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background-color .2s;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--clr-nugget);
  outline-offset: 3px;
}

.btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0);    box-shadow: none; }

.btn-primary {
  background-color: var(--clr-nugget);
  color: var(--clr-white);
}
.btn-primary:hover { background-color: #b45309; }

.btn-secondary {
  background-color: var(--clr-green-deep);
  color: var(--clr-white);
}
.btn-secondary:hover { background-color: #166534; }


/* =============================================
   HERO
   ============================================= */
.hero {
  background-color: var(--clr-bg);
  overflow: hidden;
}

/* The SVG illustration fills full width */
.hero-scene {
  width: 100%;
  height: auto;
  max-height: 230px;
}

.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

/* Text side of the hero */
.hero-text {
  flex: 1;
  min-width: 0;
  text-align: center;
}

/* Kawaii nugget mascot, right side */
.hero-mascot {
  flex-shrink: 0;
  margin: 0;
}

.hero-mascot img {
  width: 260px;
  max-width: 100%;
  filter: drop-shadow(0 10px 28px rgba(217, 119, 6, .22));
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  color: var(--clr-green-deep);
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
}

.hero-subtitle {
  font-size: clamp(.95rem, 2.4vw, 1.15rem);
  color: var(--clr-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* Random wisdom quote area */
.wisdom-text {
  min-height: 1.5em;
  font-style: italic;
  color: var(--clr-green-deep);
  font-size: 1.05rem;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0;
  transition: opacity .45s ease;
}

.wisdom-text.visible {
  opacity: 1;
}


/* =============================================
   SECTIONS — shared styles
   ============================================= */
.section        { padding: var(--sec-pad); }
.section-green  { background-color: var(--clr-bg-green); }
.section-warm   { background-color: var(--clr-bg-warm);  }
.section-light  { background-color: var(--clr-bg-light); }

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--clr-green-deep);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--clr-muted);
  max-width: 680px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* Prose blocks (running text) */
.prose {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--clr-text);
  margin-bottom: 2.5rem;
}

/* Clearfix so floated images don't escape the prose box */
.prose::after {
  content: "";
  display: table;
  clear: both;
}

/* Image floating right inside a prose block */
.prose-float-right {
  float: right;
  margin: 0 0 1.5rem 2.5rem;
  width: 38%;
  max-width: 300px;
  min-width: 160px;
}

.prose-float-right img {
  width: 100%;
  border-radius: var(--r-lg);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .10));
}

/* Lexicon header: intro text + heldenpose mascot side by side */
.lexicon-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.lexicon-header .section-intro {
  margin-bottom: 0;
  flex: 1;
}

.lexicon-mascot {
  flex-shrink: 0;
  margin: 0;
}

.lexicon-mascot img {
  width: 190px;
  max-width: 100%;
  filter: drop-shadow(0 8px 20px rgba(217, 119, 6, .20));
}


/* =============================================
   FOREST RULES BOX
   ============================================= */
.forest-rules {
  background: var(--clr-white);
  border-radius: var(--r-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--clr-green-mid);
  max-width: 700px;
}

.rules-title {
  font-size: 1.15rem;
  color: var(--clr-green-deep);
  margin-bottom: 1.25rem;
}

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.rules-list li {
  padding-left: 1.9rem;
  position: relative;
  line-height: 1.65;
}

.rules-list li::before {
  content: "🌿";
  position: absolute;
  left: 0;
  top: .05em;
}


/* =============================================
   VOLCANO SECTION LAYOUT
   ============================================= */
.volcano-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

/* Safety badge panel */
.safety-panel {
  background: var(--clr-white);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  flex-shrink: 0;
}

.safety-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-muted);
  margin-bottom: 1rem;
}

.safety-levels {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
}

.safety-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-orange { background: #ffedd5; color: #c2410c; }

.safety-note {
  font-size: .78rem;
  color: var(--clr-faint);
  font-style: italic;
}


/* =============================================
   DINO NUGGET LEXICON GRID
   ============================================= */
.nugget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.nugget-card {
  background: var(--clr-white);
  border: 2px solid var(--clr-nugget-lt);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.nugget-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.nugget-icon {
  font-size: 2rem;
  margin-bottom: .75rem;
  line-height: 1;
}

.nugget-name {
  font-size: 1.1rem;
  color: var(--clr-nugget);
  margin-bottom: .55rem;
}

.nugget-desc {
  font-size: .95rem;
  color: var(--clr-muted);
  line-height: 1.65;
}


/* =============================================
   DAILY ROUTINE TIMELINE
   ============================================= */
.timeline {
  list-style: none;
  position: relative;
  max-width: 720px;
}

/* Vertical connecting line */
.timeline::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--clr-green-light);
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }

/* Circular icon marker */
.timeline-marker {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--clr-white);
  border: 2px solid var(--clr-green-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-green-deep);
  z-index: 1;
}

.timeline-content {
  flex: 1;
  background: var(--clr-white);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-top: .1rem;
}

.timeline-time {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-nugget);
  background: var(--clr-nugget-lt);
  padding: .18rem .6rem;
  border-radius: 20px;
  margin-bottom: .4rem;
}

.timeline-title {
  font-size: 1.05rem;
  color: var(--clr-text);
  margin: .35rem 0 .5rem;
}

.timeline-content p {
  font-size: .95rem;
  color: var(--clr-muted);
  line-height: 1.65;
}


/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--clr-green-deep);
  color: var(--clr-white);
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-text {
  font-size: 1.05rem;
  font-style: italic;
  opacity: .9;
  margin-bottom: .5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  font-size: .85rem;
  opacity: .55;
}


/* =============================================
   MANIFESTO MODAL
   ============================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* When the hidden attribute is present, don't show */
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(3px);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--clr-white);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: var(--clr-bg-green);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--clr-text);
  font-family: var(--font);
  transition: background-color .15s;
}
.modal-close:hover        { background-color: var(--clr-green-light); }
.modal-close:focus-visible { outline: 3px solid var(--clr-nugget); outline-offset: 3px; }

.modal-title {
  font-size: 1.5rem;
  color: var(--clr-green-deep);
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

.manifesto-list {
  list-style: none;
  counter-reset: manifesto-counter;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: 1.5rem;
}

.manifesto-list li {
  counter-increment: manifesto-counter;
  padding-left: 2.4rem;
  position: relative;
  line-height: 1.65;
}

.manifesto-list li::before {
  content: counter(manifesto-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--clr-nugget);
  min-width: 1.6rem;
}

.manifesto-footer {
  font-size: .875rem;
  font-style: italic;
  color: var(--clr-faint);
  border-top: 1px solid var(--clr-border);
  padding-top: 1rem;
}

/* Prevent body scroll while modal is open */
body.modal-open { overflow: hidden; }


/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */
@media (max-width: 700px) {
  :root { --sec-pad: 3.5rem 1rem; }

  /* Hero: stack text above, mascot below */
  .hero-content {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }

  .hero-mascot img { width: 190px; }

  /* Collapse volcano layout to single column */
  .volcano-layout {
    grid-template-columns: 1fr;
  }

  /* Compact timeline on small screens */
  .timeline::before { left: 20px; }

  .timeline-marker {
    width: 42px;
    height: 42px;
  }

  .timeline-content {
    padding: 1rem;
  }

  /* Full-width nugget cards */
  .nugget-grid {
    grid-template-columns: 1fr;
  }

  /* Safety panel no minimum width */
  .safety-panel { min-width: unset; }

  /* Prose float: un-float, centre below text */
  .prose-float-right {
    float: none;
    width: 55%;
    max-width: 220px;
    margin: 0 auto 1.75rem;
    display: block;
  }

  /* Lexicon header: stack intro text above mascot */
  .lexicon-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lexicon-mascot img { width: 150px; }
}

@media (max-width: 480px) {
  .hero-content {
    padding: 2rem 1rem 3.5rem;
  }

  .hero-mascot img { width: 150px; }

  .modal-box {
    padding: 1.75rem 1.25rem;
  }
}
