html {
  height: 100%;
}

body {
  font-family: "Averia", "SF Pro Text", "Helvetica", "Arial", sans-serif;
  font-size: 1em;
  margin: 0;
  overflow-x: hidden;
}

/* Links */
a:link,
a:visited,
a:hover,
a:active {
  text-decoration: none;
}

/* Wondercrab tag */
#wondercrab-tag {
  display: block;
  position: absolute;
  right: 40px;
  top: -3px;
  height: calc(576px / 4);
  width: calc(528px / 4);
  background: url("../images/wondercrab-tag.png") center / cover no-repeat;
  z-index: 1000;
  transition: 0.1s;
}

#wondercrab-tag:hover {
  top: 0;
}

/* Bonus content button (invisible click target) */
#bonus-content-button {
  display: block;
  position: relative;
  margin: 0 auto;
  margin-bottom: -122px;
  top: 493px;
  left: -364px;
  height: 120px;
  width: 120px;
  z-index: 10000;
}

/* Header banner */
#header-banner {
  display: block;
  position: relative;
  height: 680px;
  background: url("../images/header-3-COMP.jpg") center / 1450px no-repeat;
  z-index: 1;
  margin-bottom: 130px;
}

/* CTA / store links */
#available-link-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: calc(960px / 2);
  top: 530px;
  left: 200px;
  margin: 0 auto;
  z-index: 100;
  background: #9ed5ca;
  border-radius: 5px;
  padding: 20px 0 12px;
}

#available-link-container > *:not(:first-child) {
  margin-top: 6px;
}

#cta-text {
  height: 40px;
}

#store-buttons {
  display: flex;
  justify-content: center;
}

#store-buttons a:not(:first-child) {
  margin-left: 6px;
}

.available-link {
  width: calc(256px / 2);
  height: calc(80px / 2);
  position: relative;
  z-index: 10000;
  transition: 0.1s;
}

.available-link:hover {
  margin-top: -2px;
  box-shadow: 0 0 12px 0 rgb(255, 225, 169);
}

/* Newsticker */
.newsticker {
  display: block;
  width: 420px;
  height: 106px;
  position: relative;
  top: 545px;
  left: 200px;
  margin: 0 auto;
  z-index: 1000;
  cursor: default;
  overflow: hidden;
  background: none;
}

.book-review {
  position: relative;
  top: -20px;
  width: calc(840px / 2.5);
  height: calc(300px / 2.5);
}

.newsticker ul li {
  width: 730px;
  height: 30px;
  white-space: nowrap;
  display: none;
  overflow: visible;
}

/* Content layout */
.content-block {
  display: block;
  position: relative;
  max-width: 1124px;
  min-width: 615px;
  margin: 0 auto;
  padding: 0 40px;
  z-index: 100;
}

.text-block {
  position: relative;
  z-index: 500;
}

.image-block {
  display: block;
  position: relative;
}

.content-block #first-left,
.content-block #third-left {
  background: url("../images/grad-left.png") 0 0 / 560px 50px repeat-y;
  width: 560px;
  float: left;
}

.content-block #second-right,
.content-block #fourth-right {
  background: url("../images/grad-right.png") top right / 560px 50px repeat-y;
  width: 560px;
  float: right;
}

#first-left,
#third-left {
  margin-left: 60px;
}

#second-right,
#fourth-right {
  margin-right: 60px;
}

.title-decoration-left {
  display: block;
  background: url("../images/title-decoration-LEFT.png") top left / contain no-repeat;
  width: 631px;
  height: 82px;
  padding-top: 2px;
}

.title-decoration-right {
  display: block;
  background: url("../images/title-decoration-RIGHT.png") top right / contain no-repeat;
  width: 631px;
  height: 82px;
  padding-top: 2px;
}

.title-decoration-left + *,
.title-decoration-right + * {
  margin-top: 24px;
}

/* Type */
h1 {
  font-family: "Alpaca";
  font-size: 2em;
  text-transform: uppercase;
  font-weight: normal;
  color: #3a9086;
  letter-spacing: 0.02em;
  margin-top: 20px;
}

h2 {
  font-size: 0.95em;
  text-transform: uppercase;
  margin: 0;
  font-weight: normal;
  color: #734;
}

p {
  font-size: 1.15em;
  line-height: 1.4em;
  letter-spacing: -0.05em;
  margin: 0 0 0.8em 0;
  font-weight: 300;
  color: #4e4e4e;
  padding: 0;
  width: 470px;
  text-align: justify;
}

.text-right {
  text-align: justify;
}

.position-right {
  position: absolute;
  right: 0;
  text-align: right;
}

.right-text-block {
  position: absolute;
  right: 0;
}

.right-text-block p:first-child {
  margin-top: 92px;
}

.uppercase {
  text-transform: uppercase;
}

/* Section sizing */
.block-01 {
  height: 480px;
}

.block-02 {
  height: 690px;
}

.block-03 {
  height: 470px;
}

.block-04 {
  height: 470px;
}

/* Hero images */
#hero-image-ingots {
  height: 480px;
  width: 640px;
  background: url("../images/hero-ingots.png") center / contain no-repeat;
  box-sizing: border-box;
  position: absolute;
  top: -40px;
  right: -10px;
  z-index: 0;
}

#hero-image-feathers {
  height: 580px;
  width: 640px;
  background: url("../images/hero-feathers.png") center / contain no-repeat;
  box-sizing: border-box;
  position: absolute;
  top: -20px;
  left: -25px;
  z-index: 0;
}

#hero-image-three-objects {
  height: 550px;
  background: url("../images/hero-three-objects.png") center / contain no-repeat;
  box-sizing: border-box;
  max-width: 500px;
  min-width: 610px;
  position: absolute;
  top: -95px;
  right: 5px;
  z-index: 0;
}

#hero-image-portrait {
  height: 550px;
  background: url("../images/hero-portrait.png") center / contain no-repeat;
  box-sizing: border-box;
  max-width: 500px;
  min-width: 610px;
  position: absolute;
  top: -50px;
  left: 5px;
  z-index: 0;
}

/* Footer */
#content-footer {
  display: block;
  background: url("../images/footer-fish-scale-tiles.png") center / 750px 280px repeat-x;
  position: relative;
  height: 280px;
  z-index: 1000;
  margin-top: 0;
}

#footer-info-box {
  display: block;
  position: relative;
  background-color: #fff;
  top: 110px;
  border-radius: 10px;
  height: 120px;
  width: 396px;
  margin: 0 auto;
}

#content-footer p {
  text-transform: uppercase;
  font-size: 1em;
  color: #3a9086;
  text-align: center;
  margin: 0 auto;
  padding-top: 18px;
  width: 100%;
}

#content-footer a {
  text-transform: uppercase;
  text-decoration: underline;
  font-size: 1em;
  color: #3a9086;
  position: relative;
  top: 0;
  transition: 0.2s;
  letter-spacing: -0.05em;
}

#content-footer a:visited {
  color: #3a9086;
}

#content-footer a:hover {
  color: #0a6066;
}

#content-footer a:active {
  color: #5ab0a6;
}



/************** CODE PAGE - DESKTOP - NOT MOBILE VERSION!!! ***************/

.code-page #code-entry, .code-page #download-link-box  {
    margin-top: 90px;
}

body.code-page #footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff; /* Ensure legibility over background */
    z-index: -100;
    padding: 0px 0;
    margin: 0; 
  }

#code-entry {
    display: block;
    background-image: url("../images/enter-code-box.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: contain;
    position: relative;
    height: 445px;
    width: 616px;
    margin: 0 auto;
}

#download-link-box {
    display: none;
    background-image: url("../images/download-link-box.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: contain;
    position: relative;
    height: 445px;
    width: 616px;
    margin: 0 auto;
}

#comp-box {
    display: block;
    background-image: url("../images/comp-box.jpg");
    background-position: center;
    background-repeat: repeat-x;
    background-size: contain;
    position: relative;
    height: calc(1360px/2);
    width: calc(1730px/2);
    margin: 0 auto;
}

#comp-box p {
    position: relative;
    left: 130px;
    top: 35px;
    text-align: center;
    margin: 0 auto;
}

#Torril-Book-3D {
    display: none;
    background-image: url("../images/torril-book-3D.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: contain;
    position: absolute;
    height: calc(800px/2);
    width: calc(800px/2);
    margin: 0 auto;
    left: calc(50vw - 580px);
    top: 480px;
    z-index: 1000;
}

#code-entry h1, #comp-box h1 {
    text-align: center;
    position: relative;
    top: 30px;
}

#code-entry p {
    position: relative;
    top: 120px;
    text-align: center;
    margin: 0 auto;
}


.bodylink:link   {
    text-decoration: underline;
    color: cadetblue;
    position: relative;
    top: 0px;
    transition: 0.2s;
}

.bodylink:visited   {
    text-decoration: underline;
    color: cadetblue;
    top: 0px;
    transition: 0.2s;
}

.bodylink:hover   {
    text-decoration: none;
    color: rgb(126, 196, 199);
    top: 0px;
    transition: 0.2s;
}


#download-link-box h1 {
    text-align: center;
    position: relative;
    top: 30px;
}

#download-link-box p {
    position: relative;
    top: 35px;
    text-align: center;
    margin: 0 auto;
}

.hover-tooltip {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    width: 363px;
    height: 196px;
    background-image: url("../images/tooltip-bubble.png");
    background-size: contain;
    background-repeat: no-repeat;
    color: #fff;
    text-align: center;
    padding: 0px 0;
    border-radius: 6px;
    bottom: -20%;
    left: 50%;
    margin-left: -180px;
    /* Use half of the width, to center the tooltip */
    transition: 0.5s;
}

.tooltip-trigger {
    position: relative;
    display: inline-block;
    text-decoration: underline;
    color: #3a9086;
}

/* Show the tooltip text when you mouse over the tooltip container */

.tooltip-trigger:hover .hover-tooltip {
    visibility: visible;
    opacity: 100;
    transition: 0.2s;
    cursor: help;
}

.tooltip-text-h1 {
    color: #3a9086;
    position: relative;
    top: 40px;
}

.tooltip-text-p {
    color: #333;
    font-style: italic;
    line-height: 1.2em;
    text-transform: none;
    display: block;
    font-size: 1em;
    width: 250px;
    margin: 0 auto;
    margin-top: 0px;
}

.tooltip-text-success-h1    {
    width: 460px;
    top: 44px;
    color: #3a9086;
    position: relative;
    display: block;
    margin: 0 auto;
    line-height: 1em;
    font-size: 1.2em;
    }

.tooltip-text-success-p {
    width: 310px;
    position: relative;
    top: -15px;
    display: block;
    margin: 0 auto;
    line-height: 1em;
    font-size: 1.1em;
}

#download-link-box .tooltip-text-h1 {
    color: #3a9086;
    position: relative;
    top: 40px;
}

#download-link-box .tooltip-text-p {
    color: #333;
    font-style: normal;
    line-height: 1.2em;
    text-transform: none;
    display: block;
    font-size: 1em;
    width: 250px;
    margin: 0 auto;
    margin-top: 0px;
}

#download-link-and-icon {
    display: block;
    position: relative;
    top: 40px;
    width: 250px;
    height: 100px;
    margin: 0 auto;
}

#zip-icon {
    width: 95px;
    height: 97px;
    background-image: url("../images/zip-icon.png");
    background-size: contain;
    background-repeat: no-repeat;
    position: relative;
    top: 0px;
}

#download-button {
    height: 39px;
    width: 135px;
    border-radius: 5px;
    background-color: #3a9086;
    padding: 0px;
    border: 0px;
    margin: 0px;
    margin-left: 6px;
    color: #FFF;
    font-family: "Averia", "SF Pro Text", "Helvetica", "Arial", sans-serif;
    font-size: 1.1em;
    transition: 0.2s;
    position: absolute;
    top: 16px;
    right: 0px;
    text-decoration: none;
}

#download-button-text {
    display: block;
    text-align: center;
    position: relative;
    top: 8px;
}

#download-link-caption {
    display: block;
    width: 50px;
    text-align: center;
    position: relative;
    top: -34px;
    left: 55px;
    margin: 0 auto;
    color: #777;
}

#download-button:hover {
    background-color: #5ab0a6;
    transition: 0.2s;
}

#code-input {
    position: relative;
    top: 130px;
    width: 350px;
    margin: 0 auto;
}

.code-input-field {
    height: 25px;
    width: 220px;
    border-radius: 5px;
    border: 2px solid #3a9086;
    padding: 5px;
    font-size: 1em;
    line-height: 1em;
    font-family: "Averia", "SF Pro Text", "Helvetica", "Arial", sans-serif;
    text-transform: uppercase;
    position: absolute;
    top: 0px;
    left: 0px;
}

.code-input-button {
    height: 39px;
    width: 105px;
    border-radius: 5px;
    background-color: #3a9086;
    padding: 0px;
    border: 0px;
    margin: 0px;
    margin-left: 6px;
    color: #FFF;
    font-family: "Averia", "SF Pro Text", "Helvetica", "Arial", sans-serif;
    font-size: 1.1em;
    transition: 0.2s;
    position: absolute;
    top: 0px;
    right: 0px;
}

.code-input-button:hover {
    background-color: #5ab0a6;
    transition: 0.2s;
}

.code-input-button:active {
    background-color: #1a7066;
    transition: 0.2s;
}

#back-home-link {
    display: block;
    position: relative;
    top: 0px;
    color: #1a7066;
    font-size: 1.3em;
    text-align: center;
}

#back-home-link:hover {
    color: #5ab0a6;
}

#back-home-link:visited {
    color: #1a7066;
}

#comp-link:link {
    display: block;
    position: relative;
    top: 0px;
    color: #FFF;
    font-size: 1.3em;
    text-align: center;
    border-radius: 8px;
    background-color: #0a6066;
    margin: 0 auto;
    margin-top: 20px;
    padding-top: 16px;
    width: 260px;
    height: 40px;
    transition: 0.2s;
}

#comp-link:visited {
    color: #FFF;
    background-color: #0a6066;
    transition: 0.2s;
}

#comp-link:hover {
    color: #FFF;
    top: -2px;
    background-color: #208f97;
    transition: 0.2s;
}




/* Mobile: readable, minimal, ticker restored, no overlaps */
@media (max-width: 768px) {

  /* --- Base typography & spacing --- */
  body {
    font-size: 18px;
    line-height: 1.6;
  }

  #content-body  {
    margin-top: 0px; /* fixed distance under ticker */
}

  h1 {
    font-size: 1.2em;
    margin: 25px 0px;
    letter-spacing: 0;
  }

  h2 {
    font-size: 0.95em;
    margin: 0 0 12px;
  }

  p {
    width: auto;
    max-width: 65ch;
    margin: 0 0 14px;
    font-size: 1.1em;
    line-height: 1.2;
    letter-spacing: -0.04em;
    text-align: justify;
  }

  /* Kill the heavy decorative tag */
  #wondercrab-tag { display: none; }

  /* If that invisible click target is desktop-only alignment magic */
  #bonus-content-button { display: none; }

  /* --- Header becomes a stacked column layout --- */
  #header-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;              /* fixed spacing between CTA and ticker */
    padding-top: 80vw;      /* this replaces “top: 85vw” positioning */
    margin-bottom: 0;
    background: url("../images/hero-panel-MOBILE.png") top center / 100vw no-repeat;
    height: auto;
  }


  #available-link-container,
  .newsticker {
    top: auto;
    left: auto;
    margin: 0 auto;
  }


  /* CTA box flows normally (no overlay) */
  #available-link-container {
    position: relative;
    margin-inline: auto;
    width: clamp(280px, 92vw, 400px);
    padding: 15px 0px 10px 0px;
    box-sizing: border-box;
    margin-top: 20px;
  }

  #cta-text {
    height: auto;
    max-width: 85%;
  }

  #store-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
  }

  #store-buttons a:not(:first-child) {
    margin-left: 0;
  }

  .available-link {
    scale: 110%;
  }

  .available-link:hover {
    margin-top: 0;
    box-shadow: none;
  }

  /* --- News ticker restored (compact + readable) --- */
  .newsticker {
    position: relative;
    width: min(350px);
    height: 150px;
    overflow: hidden;
    z-index: 5;
    cursor: default;
    background: none;
  }

  /* Keep the ticker’s original behavior: JS can toggle display */
  .newsticker ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .newsticker ul li {
    width: 100%;
    height: auto;
    white-space: normal;
    overflow: hidden;
    display: none;
  }

  /* If your JS doesn’t add a class, this ensures at least one is visible */
  .newsticker ul li:first-child {
    display: block;
  }

  /* If you DO toggle a class (nice), this supports it */
  .newsticker ul li.active {
    display: block;
  }

  .book-review {
    width: 100%;
    height: auto;
    top: 0;
  }

  /* --- Main content: single column, no gradient panels/floats --- */
  .content-block {
    width: 84vw;
    max-width: 640px;
    min-width: 0;
    padding: 0;
    margin-bottom: 90px;
    margin-top: 60px;
}

  .content-block #first-left,
  .content-block #second-right,
  .content-block #third-left,
  .content-block #fourth-right {
    float: none;
    width: 100%;
    margin: 0;
    background: none;
  }

  .right-text-block,
  .position-right {
    position: static;
    text-align: left;
  }

  .right-text-block p:first-child { margin-top: 0; }

  /* Hide the large body hero images (minimal mode) */
  .image-block,
  #hero-image-ingots,
  #hero-image-feathers,
  #hero-image-three-objects,
  #hero-image-portrait {
    display: none !important;
  }

  /* Auto-height sections */
  .block-01, .block-02, .block-03, .block-04 {
    height: auto;
  }

    .title-decoration-left {
    display: block;
    background: url("../images/title-decoration-LEFT-smaller.png") top center / 540px no-repeat;
    padding-top: 2px;
    width: auto;
    text-align: center;
    }

    .title-decoration-right {
    display: block;
    background: url("../images/title-decoration-LEFT-smaller.png") top center / 540px no-repeat;
    padding-top: 2px;
    width: auto;
    text-align: center;
    }

    .title-decoration-left + *,
    .title-decoration-right + * {
    margin-top: 24px;
    }


  /* Footer simplified */
  #content-footer {
    height: auto;
    padding: 80px 0 34px;
    background-size: 700px 260px;
  }

  #footer-info-box {
    width: min(92vw, 520px);
    height: auto;
    top: 0;
    padding: 14px 12px;
    border-radius: 12px;
  }

  #content-footer p {
    padding-top: 0;
    font-size: 0.95em;
  }

/* =========================================
   CODE PAGE SPECIFIC STYLES (index.html)
   ========================================= */

body.code-page h1 {
  font-size: 1.8em;
}

body.code-page p {
  font-size: 1em;
}

body.code-page #code-entry h1, body.code-page #comp-box h1, body.code-page #download-link-box h1 {
    text-align: center;
    position: relative;
    top: 20px;
}

#code-entry {
    display: block;
    background-image: url("../images/enter-code-box.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: 648px;
    position: relative;
    height: 445px;
    width: 616px;
    margin: 0 auto;
}


/* 1. Page Layout & Background */
body.code-page {
    /* Use the background image seen in your mockup */
    background: url('../images/your-background-image.jpg') no-repeat center center fixed; 
    background-size: cover;
    min-height: 100vh; /* Full screen height */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content */
    align-items: center;     /* Horizontally center content */
    margin: 0;
    padding: 0;
    overflow-x: hidden;      /* Prevent horizontal scroll */
}

/* 2. Hide sections not in the mockup (Header/About) to clean the view */
body.code-page #header-banner,
body.code-page #about-the-book {
    display: none;
}

/* 3. Main Code Section Container */
body.code-page #code-section {
    width: 90%;
    max-width: 500px; /* Keeps it looking good on desktop too */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 80px; /* Space for the footer */
    z-index: 10;
}

/* 4. The "Wondercrab" Tag (Top Right hanging element) */
body.code-page #wondercrab-tag {
    position: fixed;
    top: -10px;
    right: 20px;
    width: 80px;  /* Adjust based on your image size */
    height: 100px;
    background-size: contain;
    z-index: 20;
}

/* 5. Input Field & Button Row */
body.code-page #code-input {
    display: flex;
    flex-direction: row; /* Side-by-side layout */
    width: 60%;
    gap: 10px; /* Space between input and button */
    margin-top: 0px;
}

/* The Text Input Box */
body.code-page .code-input-field {
    flex: 2; /* Takes up 2/3 of the space */
    height: 50px;
    border: 2px solid #3a9086;
    border-radius: 6px;
    padding: 0 15px;
    font-family: 'Averia', serif;
    font-size: 1.2rem;
    background-color: #fdfdfd;
    color: #000;
    outline: none;
}

/* The Check Button */
body.code-page .code-input-button {
    flex: 1; /* Takes up 1/3 of the space */
    height: 54px; /* Matches input height + borders */
    background-color: #3a9086;
    color: #fff;
    border: none;
    font-family: 'Averia', serif;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 6. Success/Download Area (Hidden by default, styled for when it appears) */
body.code-page #download-link-box {
    display: none;
    background-image: url("../images/download-link-box.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: 648px;
    position: relative;
    height: 445px;
    width: 616px;
    margin: 0 auto;
}


/* 7. Footer - STUCK TO BOTTOM */
body.code-page #footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff; /* Ensure legibility over background */
    z-index: -100;
    padding: 0px 0;
    margin: 0; 
  }
}
