/* =========================================================
   THE NURTURED KEIKI
   Main Stylesheet
   ========================================================= */


/* =========================================================
   1. ROOT & RESET
   ========================================================= */

:root {
  --cream: #f7f3ea;
  --cream-dark: #eee7d8;
  --paper: #fbf9f4;

  --ink: #26342e;
  --ink-soft: #526059;

  --sage: #a9b99f;
  --sage-dark: #758b72;

  --sand: #d9c29f;

  --terracotta: #c98267;
  --terracotta-dark: #a95f49;

  --blue: #9dbbc1;
  --yellow: #e8c875;
  --pink: #d7a5a1;

  --white: #fffdf8;

  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 40px;

  --shadow-soft: 0 15px 45px rgba(38, 52, 46, 0.08);

  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;

  --container: 1240px;

  --dark-bg: #202428;
  --dark-bg-deep: #181b1f;
  --dark-bg-soft: #282d32;

  --dark-text: #f5f1e8;
  --dark-text-soft: #b9bdb9;
}


/* ---------------------------------------------------------
   GLOBAL RESET
   --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;

  background: var(--cream);
  color: var(--ink);

  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


img {
  display: block;
  max-width: 100%;
}


a {
  color: inherit;
  text-decoration: none;
}


button {
  font: inherit;
}


/* =========================================================
   2. TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
p {
  margin-top: 0;
}


h1,
h2,
h3 {
  font-weight: 400;
}


h1,
h2 {
  font-family: var(--serif);
  letter-spacing: -0.045em;
}


h1 em,
h2 em {
  color: var(--terracotta);
  font-style: italic;
}


h1 span {
  display: block;
}


.eyebrow {
  margin-bottom: 18px;

  color: var(--sage-dark);

  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;

  text-transform: uppercase;
}


/* =========================================================
   11. HERO
   ========================================================= */

.hero {
  min-height: 100vh;
  min-height: 760px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    140px
    40px
    100px;

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 255, 255, 0.72),
      transparent 36%
    ),
    var(--cream);
}


/*
   Hero decoration sits inside the hero only.
*/

.hero .section-decor {
  z-index: 0;
}


/* ---------------------------------------------------------
   HERO CONTENT
   --------------------------------------------------------- */

.hero-content {
  position: relative;
  z-index: 5;

  width: min(760px, 100%);

  text-align: center;

  animation: heroReveal 1s ease both;
}


.hero h1 {
  margin-bottom: 30px;

  font-size: clamp(4rem, 8vw, 7.8rem);
  line-height: 0.92;
}


.hero h1 span {
  margin-top: 9px;

  color: var(--ink);

  font-family: var(--sans);
  font-size: 0.28em;
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: 1.3;

  text-transform: uppercase;
}


.hero-description {
  width: min(560px, 100%);

  margin: 0 auto 34px;

  color: var(--ink-soft);

  font-size: 1.03rem;
  line-height: 1.75;
}


/* ---------------------------------------------------------
   HERO ACTIONS
   --------------------------------------------------------- */

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 28px;
}


.button {
  display: inline-flex;
  align-items: center;

  gap: 22px;

  padding:
    15px
    22px
    15px
    25px;

  border-radius: 100px;

  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;

  text-transform: uppercase;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}


.button-primary {
  background: var(--ink);
  color: var(--cream);

  box-shadow:
    0 10px 25px rgba(38, 52, 46, 0.12);
}


.button-primary span {
  font-size: 1.1rem;
  line-height: 1;

  transition: transform 0.3s ease;
}


.button-primary:hover {
  transform: translateY(-3px);

  box-shadow:
    0 15px 30px rgba(38, 52, 46, 0.18);
}


.button-primary:hover span {
  transform: translateX(4px);
}


.text-link {
  display: inline-flex;
  align-items: center;

  gap: 10px;

  padding-bottom: 4px;

  border-bottom:
    1px solid rgba(38, 52, 46, 0.25);

  color: var(--ink-soft);

  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;

  text-transform: uppercase;

  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}


.text-link span {
  transition: transform 0.3s ease;
}


.text-link:hover {
  border-color: var(--terracotta);

  color: var(--terracotta);
}


.text-link:hover span {
  transform: translateY(4px);
}


/* ---------------------------------------------------------
   HERO FOOTER
   --------------------------------------------------------- */

.hero-bottom {
  position: absolute;
  z-index: 5;

  right: 40px;
  bottom: 35px;
  left: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 18px;

  color: var(--ink-soft);

  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;

  text-transform: uppercase;
}


.hero-line {
  width: 65px;
  height: 1px;

  background: rgba(38, 52, 46, 0.25);
}


/* =========================================================
   12. GENERAL SECTIONS
   ========================================================= */

.section {
  width: min(calc(100% - 80px), var(--container));

  margin: 0 auto;

  padding: 140px 0;
}


/* ---------------------------------------------------------
   SECTION LABEL
   --------------------------------------------------------- */

.section-label {
  display: flex;
  align-items: center;

  gap: 12px;

  margin-bottom: 55px;

  color: var(--ink-soft);

  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;

  text-transform: uppercase;
}


.section-label span:first-child {
  color: var(--terracotta);
}


.section-label span:last-child {
  display: flex;
  align-items: center;

  gap: 12px;
}


.section-label span:last-child::before {
  content: "";

  width: 32px;
  height: 1px;

  background: rgba(38, 52, 46, 0.25);
}


/* =========================================================
   13. ABOUT
   ========================================================= */

.about {
  border-top:
    1px solid rgba(38, 52, 46, 0.08);
}


.about-grid {
  display: grid;

  grid-template-columns:
    1.05fr
    0.95fr;

  gap: 100px;

  align-items: start;
}


.about-heading h2 {
  max-width: 620px;

  margin-bottom: 0;

  font-size: clamp(3.1rem, 5vw, 5.5rem);
  line-height: 0.98;
}


.about-copy {
  padding-top: 15px;
}


.about-copy p {
  max-width: 520px;

  color: var(--ink-soft);
}


.about-copy .large-copy {
  margin-bottom: 28px;

  color: var(--ink);

  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.45;

  letter-spacing: -0.02em;
}


.arrow-link {
  display: inline-flex;
  align-items: center;

  gap: 15px;

  margin-top: 25px;
  padding-bottom: 7px;

  border-bottom:
    1px solid rgba(38, 52, 46, 0.25);

  color: var(--ink);

  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;

  text-transform: uppercase;

  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}


.arrow-link span {
  color: var(--terracotta);

  font-size: 1.1rem;

  transition: transform 0.3s ease;
}


.arrow-link:hover {
  border-color: var(--terracotta);

  color: var(--terracotta);
}


.arrow-link:hover span {
  transform: translate(4px, -4px);
}


/* =========================================================
   14. EXPLORE
   ========================================================= */

.explore {
  width: 100%;
  max-width: none;

  padding-right:
    max(40px, calc((100vw - var(--container)) / 2));

  padding-left:
    max(40px, calc((100vw - var(--container)) / 2));

  background: var(--paper);
}


/* ---------------------------------------------------------
   EXPLORE HEADER
   --------------------------------------------------------- */

.explore-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  margin-bottom: 60px;
}


.explore-header .section-label {
  margin-bottom: 28px;
}


.explore-header h2 {
  margin-bottom: 0;

  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 0.95;
}


.explore-header > p {
  max-width: 250px;

  margin-bottom: 7px;

  color: var(--ink-soft);

  font-size: 0.9rem;
}


/* =========================================================
   15. CATEGORY CAROUSEL
   ========================================================= */

.category-wrapper {
  position: relative;
  z-index: 2;
}


.category-carousel {
  display: flex;

  gap: 22px;

  overflow-x: auto;

  padding:
    10px
    0
    30px;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;

  scrollbar-width: none;
}


.category-carousel::-webkit-scrollbar {
  display: none;
}


/* ---------------------------------------------------------
   CATEGORY CARD
   --------------------------------------------------------- */

.category-card {
  flex: 0 0 220px;

  scroll-snap-align: start;

  padding:
    25px
    0
    20px;

  transition:
    transform 0.35s ease;
}


.category-card:hover {
  transform: translateY(-8px);
}


/* ---------------------------------------------------------
   CATEGORY CIRCLE
   --------------------------------------------------------- */

.category-circle {
  position: relative;

  width: 190px;
  height: 190px;

  margin-bottom: 25px;

  display: grid;

  place-items: center;

  overflow: hidden;

  border-radius: 50%;

  transition:
    transform 0.4s ease;
}


.category-card:hover .category-circle {
  transform:
    rotate(5deg)
    scale(1.03);
}


.circle-sage {
  background: #c4d0bd;
}


.circle-sand {
  background: #e5d1ae;
}


.circle-terracotta {
  background: #d99a82;
}


.circle-blue {
  background: #b6cfd2;
}


.circle-yellow {
  background: #ead58e;
}


.circle-pink {
  background: #dfb9b6;
}


.circle-icon {
  color: rgba(38, 52, 46, 0.65);

  font-family: var(--serif);
  font-size: 4rem;

  line-height: 1;

  transition:
    transform 0.4s ease;
}


.category-card:hover .circle-icon {
  transform:
    scale(1.15)
    rotate(-8deg);
}


.category-card h3 {
  margin-bottom: 6px;

  font-family: var(--serif);
  font-size: 1.35rem;

  letter-spacing: -0.02em;
}


.category-card p {
  max-width: 190px;

  margin-bottom: 0;

  color: var(--ink-soft);

  font-size: 0.78rem;
  line-height: 1.5;
}


/* =========================================================
   16. CAROUSEL BUTTONS
   ========================================================= */

.carousel-button {
  position: absolute;
  z-index: 5;

  top: 80px;

  display: grid;

  width: 45px;
  height: 45px;

  place-items: center;

  border:
    1px solid rgba(38, 52, 46, 0.15);

  border-radius: 50%;

  background:
    rgba(251, 249, 244, 0.92);

  color: var(--ink);

  cursor: pointer;

  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}


.carousel-button:hover {
  background: var(--ink);
  color: var(--cream);

  transform: scale(1.08);
}


.carousel-prev {
  left: -23px;
}


.carousel-next {
  right: -23px;
}


/* =========================================================
   17. SWIPE HINT
   ========================================================= */

.swipe-hint {
  display: flex;
  align-items: center;

  gap: 12px;

  margin-top: 5px;

  color: var(--ink-soft);

  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;

  text-transform: uppercase;
}


.swipe-hint span {
  position: relative;

  width: 42px;
  height: 1px;

  background:
    rgba(38, 52, 46, 0.3);
}


.swipe-hint span::after {
  content: "";

  position: absolute;

  top: -2px;
  right: 0;

  width: 5px;
  height: 5px;

  border-top:
    1px solid var(--ink-soft);

  border-right:
    1px solid var(--ink-soft);

  transform: rotate(45deg);
}


/* =========================================================
   18. FOOTER
   ========================================================= */

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 30px;

  padding:
    70px
    max(40px, calc((100vw - var(--container)) / 2));

  background: var(--ink);
  color: var(--cream);
}


.site-footer strong {
  display: block;

  margin-bottom: 8px;

  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
}


.site-footer p {
  margin: 0;

  color:
    rgba(247, 243, 234, 0.62);

  font-size: 0.8rem;
}


.site-footer > span {
  color:
    rgba(247, 243, 234, 0.5);

  font-size: 0.65rem;
  letter-spacing: 0.08em;

  text-transform: uppercase;
}


/* =========================================================
   19. DARK MODE
   ========================================================= */

body.dark-mode {
  background: var(--dark-bg);
  color: var(--dark-text);

  position: relative;
}


/* ---------------------------------------------------------
   CELESTIAL STAR FIELD
   --------------------------------------------------------- */

body.dark-mode::before {
  content: "";

  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;

  background-image:

    radial-gradient(
      circle at 12% 18%,
      rgba(255, 238, 194, 0.85) 0 1px,
      transparent 1.6px
    ),

    radial-gradient(
      circle at 72% 12%,
      rgba(255, 255, 255, 0.75) 0 1px,
      transparent 1.5px
    ),

    radial-gradient(
      circle at 34% 67%,
      rgba(255, 255, 255, 0.7) 0 1px,
      transparent 1.5px
    ),

    radial-gradient(
      circle at 88% 73%,
      rgba(255, 238, 194, 0.8) 0 1px,
      transparent 1.6px
    ),

    radial-gradient(
      circle at 54% 31%,
      rgba(255, 255, 255, 0.9) 0 1.4px,
      transparent 2px
    ),

    radial-gradient(
      circle at 19% 84%,
      rgba(255, 255, 255, 0.65) 0 1.3px,
      transparent 2px
    ),

    radial-gradient(
      circle at 91% 38%,
      rgba(255, 228, 172, 0.8) 0 1.5px,
      transparent 2.2px
    ),

    radial-gradient(
      circle at 44% 8%,
      rgba(255, 255, 255, 0.7) 0 1px,
      transparent 1.8px
    );

  background-size:
    180px 180px,
    230px 230px,
    270px 270px,
    320px 320px,
    380px 380px,
    450px 450px,
    520px 520px,
    620px 620px;

  opacity: 0.65;

  animation:
    celestialDrift 30s linear infinite;
}


/* ---------------------------------------------------------
   TWINKLING STAR FIELD
   --------------------------------------------------------- */

/*
   The star field is divided into several independent
   animation groups.

   Each group has:
   - its own timing
   - its own delay
   - its own brightness cycle

   This prevents the entire sky from pulsing together.
*/


body.dark-mode::after {
  content: "";

  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;

  background-image:

    /* -----------------------------------------------
       GROUP 1 — warm bright stars
       ----------------------------------------------- */

    radial-gradient(
      circle at 8% 22%,
      rgba(255, 238, 194, 1) 0 1.2px,
      transparent 2px
    ),

    radial-gradient(
      circle at 67% 78%,
      rgba(255, 235, 190, 1) 0 1px,
      transparent 1.8px
    ),

    radial-gradient(
      circle at 91% 38%,
      rgba(255, 228, 172, 1) 0 1.2px,
      transparent 2px
    ),

    /* -----------------------------------------------
       GROUP 2 — white stars
       ----------------------------------------------- */

    radial-gradient(
      circle at 27% 11%,
      rgba(255, 255, 255, 1) 0 1px,
      transparent 1.8px
    ),

    radial-gradient(
      circle at 48% 52%,
      rgba(255, 255, 255, 1) 0 1.3px,
      transparent 2px
    ),

    radial-gradient(
      circle at 84% 42%,
      rgba(255, 255, 255, 1) 0 1.2px,
      transparent 2px
    ),

    /* -----------------------------------------------
       GROUP 3 — smaller background stars
       ----------------------------------------------- */

    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.85) 0 1px,
      transparent 1.7px
    );


  background-size:

    210px 230px,
    370px 390px,
    520px 540px,

    260px 280px,
    310px 330px,
    430px 450px,

    155px 170px;


  background-position:

    20px 40px,
    40px 180px,
    120px 70px,

    80px 120px,
    150px 20px,
    200px 80px,

    40px 80px;


  opacity: 0.35;

  /*
     The main layer slowly changes brightness.
     The different background groups are further
     separated spatially so the twinkle feels organic.
  */

  animation:
    starsTwinkle 6s ease-in-out infinite;
}


/* =========================================================
   INDEPENDENT STAR TWINKLE
   ========================================================= */

/*
   Because a single pseudo-element can only have one
   opacity value, the trick here is to make the star
   field move through different brightness phases.

   The drift + different spatial scales prevent the
   stars from visually reading as one giant pulse.
*/


@keyframes starsTwinkle {

  0% {
    opacity: 0.22;
  }

  18% {
    opacity: 0.48;
  }

  32% {
    opacity: 0.28;
  }

  47% {
    opacity: 0.72;
  }

  63% {
    opacity: 0.34;
  }

  78% {
    opacity: 0.62;
  }

  91% {
    opacity: 0.27;
  }

  100% {
    opacity: 0.22;
  }
}


/* ---------------------------------------------------------
   CONTENT ABOVE STAR FIELD
   --------------------------------------------------------- */

body.dark-mode > * {
  position: relative;
  z-index: 1;
}



/* =========================================================
   20. DARK MODE SECTIONS
   ========================================================= */

body.dark-mode .hero {
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(135, 153, 160, 0.12),
      transparent 34%
    ),
    transparent;
}


body.dark-mode .about {
  background:
    radial-gradient(
      circle at 80% 20%,
      rgba(169, 185, 159, 0.035),
      transparent 30%
    ),
    transparent;

  border-top-color:
    rgba(245, 241, 232, 0.08);
}


body.dark-mode .explore {
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(157, 187, 196, 0.045),
      transparent 28%
    ),
    transparent;
}


body.dark-mode .site-footer {
  background:
    radial-gradient(
      circle at 70% 20%,
      rgba(157, 187, 196, 0.05),
      transparent 30%
    ),
    var(--dark-bg-deep);

  color: var(--dark-text);
}


/* =========================================================
   22. DARK MODE TYPOGRAPHY
   ========================================================= */

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: var(--dark-text);
}

body.dark-mode h1 em,
body.dark-mode h2 em {
  color: #e39a7f;
}

body.dark-mode .eyebrow {
  color: #a9bea3;
}

body.dark-mode .hero-description,
body.dark-mode .about-copy p,
body.dark-mode .explore-header > p,
body.dark-mode .category-card p {
  color: var(--dark-text-soft);
}

body.dark-mode .hero h1 span {
  color: var(--dark-text);
}

body.dark-mode .hero-bottom {
  color: #999f9d;
}

body.dark-mode .hero-line {
  background: rgba(245, 241, 232, 0.2);
}


/* =========================================================
   23. DARK MODE BUTTONS
   ========================================================= */

body.dark-mode .button-primary {
  background: #f5f1e8;
  color: #202428;

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.3);
}

body.dark-mode .button-primary:hover {
  background: #ffffff;
}

body.dark-mode .text-link {
  border-color:
    rgba(245, 241, 232, 0.25);

  color: #b9bdb9;
}

body.dark-mode .text-link:hover {
  border-color: #e39a7f;
  color: #e39a7f;
}

body.dark-mode .arrow-link {
  border-color:
    rgba(245, 241, 232, 0.25);

  color: var(--dark-text);
}

body.dark-mode .arrow-link:hover {
  border-color: #e39a7f;
  color: #e39a7f;
}


/* =========================================================
   24. DARK MODE SECTION LABELS
   ========================================================= */

body.dark-mode .section-label {
  color: #aeb4b0;
}

body.dark-mode .section-label span:first-child {
  color: #e39a7f;
}

body.dark-mode .section-label span:last-child::before {
  background:
    rgba(245, 241, 232, 0.2);
}


/* =========================================================
   25. DARK MODE CATEGORY CARDS
   ========================================================= */

body.dark-mode .category-card h3 {
  color: var(--dark-text);
}

body.dark-mode .category-card p {
  color: #aeb4b0;
}

body.dark-mode .circle-icon {
  color:
    rgba(255, 255, 255, 0.68);
}

body.dark-mode .circle-sage {
  background: #71836e;
}

body.dark-mode .circle-sand {
  background: #a88f68;
}

body.dark-mode .circle-terracotta {
  background: #a96452;
}

body.dark-mode .circle-blue {
  background: #718f96;
}

body.dark-mode .circle-yellow {
  background: #b39a54;
}

body.dark-mode .circle-pink {
  background: #a87876;
}


/* =========================================================
   26. DARK MODE CAROUSEL
   ========================================================= */

body.dark-mode .carousel-button {
  border-color:
    rgba(245, 241, 232, 0.15);

  background: #292e33;

  color: var(--dark-text);
}

body.dark-mode .carousel-button:hover {
  background: #f5f1e8;
  color: #202428;
}

body.dark-mode .swipe-hint {
  color: #9da39f;
}

body.dark-mode .swipe-hint span {
  background:
    rgba(245, 241, 232, 0.25);
}


/* =========================================================
   27. ANIMATIONS
   ========================================================= */

@keyframes heroReveal {

  from {
    opacity: 0;

    transform:
      translateY(25px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }

}


@keyframes childFloat {

  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -12px;
  }

}


/* ---------------------------------------------------------
   STAR DRIFT
   --------------------------------------------------------- */

@keyframes celestialDrift {

  from {
    transform:
      translate3d(0, 0, 0);
  }

  to {
    transform:
      translate3d(-35px, -20px, 0);
  }

}


/* =========================================================
   28. TABLET
   ========================================================= */

@media (max-width: 900px) {

  /* -------------------------------------------------------
     HERO
     ------------------------------------------------------- */

  .hero {
    padding-right: 25px;
    padding-left: 25px;
  }


  /* -------------------------------------------------------
     ABOUT
     ------------------------------------------------------- */

  .about-grid {
    grid-template-columns: 1fr;

    gap: 50px;
  }

  .about-heading h2 {
    max-width: 700px;
  }


  /* -------------------------------------------------------
     EXPLORE
     ------------------------------------------------------- */

  .explore-header {
    align-items: flex-start;

    flex-direction: column;

    gap: 25px;
  }

  .explore-header > p {
    margin-bottom: 0;
  }

  .carousel-prev {
    left: -15px;
  }

  .carousel-next {
    right: -15px;
  }

}


/* =========================================================
   29. MOBILE
   ========================================================= */

@media (max-width: 640px) {

  /* -------------------------------------------------------
     HERO
     ------------------------------------------------------- */

  .hero {
    padding-right: 18px;
    padding-left: 18px;
  }


  /* -------------------------------------------------------
     GENERAL MOBILE SPACING
     ------------------------------------------------------- */

  .about-grid {
    gap: 35px;
  }


  /* -------------------------------------------------------
     EXPLORE
     ------------------------------------------------------- */

  .explore-header {
    gap: 20px;
  }

}
