/* ========================================
   RESET
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}




.resources-intro h1 {
    margin-bottom: 18px;

    color: #203931;

    font-size: clamp(1.8rem, 4vw, 3rem);

    font-weight: 700;

    line-height: 1.2;
}


/* ========================================
   RESOURCE OVERVIEW
   COMPACT CATEGORY CAROUSEL
======================================== */

.resource-overview {
    width: min(100% - 32px, 1050px);

    margin: 0 auto;

    padding:
        5px
        0
        38px;
}




/* ========================================
   RESOURCE DIRECTORY
======================================== */

.resource-directory {
    width: min(100% - 32px, 1200px);

    margin: 0 auto;

    padding:
        30px
        0
        55px;

    border-top: 1px solid rgba(32, 57, 49, 0.10);
}

/* ========================================
   DIRECTORY HEADER
======================================== */

.directory-header {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 30px;

    margin-bottom: 28px;

    padding-bottom: 22px;

    border-bottom: 1px solid rgba(32, 57, 49, 0.12);
}


.directory-heading {
    max-width: 600px;
}


.directory-kicker {
    display: block;

    margin-bottom: 7px;

    color: #82918b;

    font-size: 0.7rem;

    font-weight: 800;

    letter-spacing: 0.14em;
}


.directory-heading h2 {
    margin-bottom: 7px;

    color: #203931;

    font-size: clamp(1.5rem, 3vw, 2.2rem);

    line-height: 1.2;
}


.directory-heading p {
    color: #687770;

    font-size: 0.88rem;

    line-height: 1.55;
}


/* ========================================
   CATEGORY FILTERS
======================================== */

.resource-filters {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 7px;

    max-width: 560px;
}


.resource-filter {
    padding:
        7px
        12px;

    border: 1px solid rgba(32, 57, 49, 0.18);

    border-radius: 999px;

    background: transparent;

    color: #50615a;

    font-family: inherit;

    font-size: 0.72rem;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.resource-filter:hover {
    transform: translateY(-1px);

    border-color: #203931;

    color: #203931;
}


.resource-filter.active {
    background: #203931;

    border-color: #203931;

    color: #ffffff;
}


.resource-filter:focus-visible {
    outline: 3px solid rgba(32, 57, 49, 0.25);

    outline-offset: 2px;
}


/* ========================================
   RESOURCE LIST
======================================== */

.resource-list {
    display: flex;

    flex-direction: column;

    gap: 14px;
}


/* ========================================
   RESOURCE CARD
======================================== */

.resource-card {
    display: grid;

    grid-template-columns: 150px 1fr;

    gap: 25px;

    align-items: center;

    min-height: 155px;

    padding:
        18px
        22px;

    background: #f8faf9;

    border: 1px solid rgba(32, 57, 49, 0.08);

    border-radius: 12px;

    box-shadow:
        0 4px 15px rgba(32, 57, 49, 0.035);

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


.resource-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 22px rgba(32, 57, 49, 0.08);
}


/* ========================================
   RESOURCE PUZZLE IMAGE
======================================== */

.resource-puzzle {
    position: relative;

    width: 150px;

    height: 120px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;
    background: rgba(32, 57, 49, 0.05);
}





/* ========================================
   RESOURCE INFORMATION
======================================== */

.resource-content {
    min-width: 0;
}


.resource-title {
    margin-bottom: 9px;

    color: #203931;

    font-size: clamp(1.15rem, 2vw, 1.45rem);

    font-weight: 700;

    line-height: 1.25;
}


.resource-categories {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    margin-bottom: 13px;

    list-style: none;
}


.resource-category-tag {
    display: inline-flex;

    align-items: center;

    padding:
        4px
        8px;

    border-radius: 999px;

    background: #e8eeeb;

    color: #52645c;

    font-size: 0.66rem;

    font-weight: 700;

    line-height: 1.2;
}


/* ========================================
   RESOURCE LINKS
======================================== */

.resource-links {
    display: flex;

    flex-wrap: wrap;

    gap:
        5px
        18px;

    list-style: none;
}


.resource-links a {
    position: relative;

    color: #31594b;

    font-size: 0.78rem;

    font-weight: 700;

    text-decoration: none;

    line-height: 1.4;

    transition:
        color 0.2s ease;
}


.resource-links a::after {
    content: "↗";

    margin-left: 5px;

    font-size: 0.72rem;
}


.resource-links a:hover {
    color: #172c25;

    text-decoration: underline;

    text-underline-offset: 3px;
}


.resource-links a:focus-visible {
    outline: 2px solid #203931;

    outline-offset: 3px;

    border-radius: 2px;
}


/* ========================================
   LOADING / EMPTY STATES
======================================== */

.resource-loading,
.resource-empty {
    padding:
        35px
        20px;

    text-align: center;

    color: #687770;

    font-size: 0.85rem;
}


.resource-empty {
    margin: 0;

    border: 1px dashed rgba(32, 57, 49, 0.16);

    border-radius: 10px;

    background: rgba(248, 250, 249, 0.6);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 900px) {

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

        flex-direction: column;

        gap: 18px;
    }


    .resource-filters {
        justify-content: flex-start;

        max-width: none;
    }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {

    .resource-directory {
        width: calc(100% - 28px);

        padding-bottom: 40px;
    }


    .directory-header {
        margin-bottom: 20px;

        padding-bottom: 18px;
    }


    .resource-filters {
        width: 100%;

        gap: 6px;
    }


    .resource-filter {
        padding:
            6px
            9px;

        font-size: 0.66rem;
    }


    .resource-card {
        grid-template-columns: 1fr;

        gap: 15px;

        padding: 18px;
    }


    .resource-puzzle {
        width: 135px;

        height: 105px;

        margin: 0 auto;
    }


    .resource-content {
        text-align: center;
    }


    .resource-categories,
    .resource-links {
        justify-content: center;
    }


    .resource-title {
        margin-bottom: 8px;
    }

}


/* ========================================
   VERY SMALL PHONES
======================================== */

@media (max-width: 380px) {

    .resource-filter {
        padding:
            6px
            8px;

        font-size: 0.62rem;
    }


    .resource-card {
        padding: 15px;
    }


    .resource-puzzle {
        width: 120px;

        height: 94px;
    }

}


/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    .resource-card,
    .resource-filter,
    .resource-links a {
        transition: none;
    }

}


/* ========================================
   CLOSING NOTE
======================================== */

.resources-note {
    width: min(100% - 32px, 850px);

    margin: 0 auto;

    padding:
        15px
        0
        55px;

    text-align: center;
}


.resources-note p {
    color: #505a56;

    font-size: 0.82rem;

    line-height: 1.6;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 900px) {

    .resource-overview {
        grid-template-columns: 1fr;
    }
}


/* ========================================
   MOBILE
======================================== */

/* ========================================
   MOBILE PUZZLE NAVIGATION
   Screens smaller than 767px
======================================== */

@media (max-width: 767px) {

    /* ========================================
       MOBILE RESOURCE CONTENT
    ======================================== */

    .resources-intro {
        width: calc(100% - 28px);

        padding-top: 28px;
    }


    .resources-intro h1 {
        margin-bottom: 14px;
    }


    .intro-text {
        font-size: 0.92rem;

        line-height: 1.6;
    }


    .resource-overview {
        width: calc(100% - 28px);

        gap: 12px;
    }


    .resource-category {
        grid-template-columns: 34px 1fr;

        gap: 12px;

        padding: 18px;
    }


    .category-content p {
        font-size: 0.84rem;
    }


    .category-content li {
        font-size: 0.7rem;
    }
}


/* ========================================
   VERY SMALL PHONES
======================================== */

@media (max-width: 380px) {
    
    .resource-category {
        padding: 16px;
    }
}

/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }


    *,
    *::before,
    *::after {
        transition: none !important;

        animation: none !important;
    }
}




/* Added new layout styles, overiding most of above */


.hero-title {
  color: #203931;

  /*
    Fluid sizing.

    The middle value uses viewport width,
    allowing the title to continuously
    shrink as the screen becomes smaller.
  */
  font-size: clamp(1.5rem, 5.2vw, 5rem);

  font-weight: 500;

  line-height: 1.1;

  /*
    Slight positive spacing keeps the
    complete title visually wider.
  */
  letter-spacing: 0.015em;

  /*
    Keeps:
    Brother's Keeper Initiative

    on one line.
  */
  white-space: nowrap;

  margin-bottom: 25px;

  -webkit-text-stroke: 1px #ffffff;

  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.16);
}

/* ========================================
HERO B / K / I
======================================== */

.hero-title .logo-letter {
  /*
    B, K and I remain larger than the
    surrounding letters.
  */
  font-size: 1.35em;

  font-weight: 800;

  letter-spacing: 0.01em;

  /*
    Makes the logo artwork inside the
    letters more visible horizontally.
  */
  transform: scaleX(1.08);

  transform-origin: center;

  margin-right: 0.015em;

  vertical-align: baseline;
}



/* ========================================
TABLET
======================================== */

@media (max-width: 900px) {

  .hero-title {
    /*
      Still fluid on tablets.
      No fixed tablet size.
    */
    font-size: clamp(2rem, 5.8vw, 4.5rem);

    letter-spacing: 0.01em;
  }

  .hero-title .logo-letter {
    font-size: 1.32em;

    transform: scaleX(1.06);
  }
}

/* ========================================
MOBILE — 767px AND BELOW
======================================== */

@media (max-width: 767px) {

  /* ====================================
     MOBILE HERO TITLE
  ==================================== */

  .hero-title {
    width: 100%;

    /*
      Center the actual title box.
    */
    margin-left: auto;
    margin-right: auto;

    font-size: clamp(1.45rem, 7.2vw, 3.5rem);

    line-height: 1.15;

    letter-spacing: 0.005em;

    white-space: nowrap;

    text-align: center;

    margin-bottom: 20px;
  }

  .hero-title .logo-letter {
    font-size: 1.28em;

    font-weight: 800;

    /*
      Reduced from 1.05 so the B/K/I
      don't visually extend too far
      outside their normal text box.
    */
    transform: scaleX(1.02);

    transform-origin: center;

    margin-right: 0.005em;
  }

}

/* ========================================
VERY SMALL PHONES — 380px AND BELOW
======================================== */

@media (max-width: 380px) {

  .hero-title {
    /*
      Continue scaling instead of using
      a fixed 1.9rem value.

      This is the important fix for
      320px / 360px phones.
    */
    font-size: clamp(1.3rem, 7vw, 2.1rem);

    letter-spacing: 0;

    margin-bottom: 18px;
  }

  .hero-title .logo-letter {
    font-size: 1.25em;

    transform: scaleX(1.04);
  }

}

/* ========================================
EXTRA SMALL SCREENS — BELOW 300px
======================================== */

@media (max-width: 300px) {

  /* ====================================
     HERO TITLE
  ==================================== */

  .hero-title {
    /*
      Smaller minimum size allows the
      title to continue shrinking below
      300px instead of getting stuck.
    */
    font-size: clamp(1rem, 6.5vw, 1.8rem);

    line-height: 1.15;

    letter-spacing: -0.01em;

    white-space: nowrap;

    margin-bottom: 15px;
  }

  /* ====================================
     B / K / I
  ==================================== */

  .hero-title .logo-letter {
    /*
      Keep B/K/I prominent, but reduce
      their enlargement slightly so
      they don't force the title outside
      the screen.
    */
    font-size: 1.2em;

    transform: scaleX(1.02);

    margin-right: 0;
  }

}




/* ========================================
   PERSONAL PROJECT DISCLAIMER
======================================== */

.resources-disclaimer {
    width: min(100% - 32px, 850px);
    margin: 0 auto;
    padding: 28px 0 45px;
    border-top: 1px solid rgba(32, 57, 49, 0.10);
}

.resources-disclaimer h2 {
    margin-bottom: 12px;
    color: #43564e;
    font-size: 0.9rem;
    font-weight: 700;
}

.resources-disclaimer p {
    margin-bottom: 10px;
    color: #687770;
    font-size: 0.76rem;
    line-height: 1.8;
}

.resources-disclaimer p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .resources-disclaimer {
        width: calc(100% - 28px);
        padding-bottom: 35px;
    }
}






/* =========================================
   GENERAL RESOURCES — MATCH REFERENCE PAGE
   Viewport, background, typography and Home
========================================= */

/* -----------------------------------------
   RESET + BASE
----------------------------------------- */

:root {
    --outline: 15px;
}

@media (max-width: 600px) {
    :root {
        --outline: 10px;
    }
}

@media (max-width: 320px) {
    :root {
        --outline: 8px;
    }
}



/* -----------------------------------------
   FIXED ORANGE VIEWPORT OUTLINE
----------------------------------------- */

#viewport-outline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    border: var(--outline) solid #ff7e00;
    z-index: 9999;
}


/* -----------------------------------------
   RESET + BASE
----------------------------------------- */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;

    background-color: #17251f;
    background-image: url("../images/home-background.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

html,
body {
    overflow-x: hidden;
}

body {
    font-family: "Courier New", Courier, monospace;
    color: #fff;
    line-height: 1.6;
}


/* -----------------------------------------
   IN-APP SCROLL CONTAINER
----------------------------------------- */

.app-scroll-container {
    position: fixed;
    top: var(--outline);
    left: var(--outline);

    width: calc(100vw - var(--outline) * 2);
    height: calc(100vh - var(--outline) * 2);

    overflow-y: auto;
    overflow-x: hidden;

    padding-top: 110px;
    padding-bottom: 60px;

    /* Let the background image show through. */
    background: transparent;

    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #7cfc00 rgba(255, 255, 255, 0.15);
}


/* -----------------------------------------
   MAIN CONTENT
----------------------------------------- */

main {
    width: 100%;
    overflow: visible;

    /* Prevent the main element hiding the image. */
    background: transparent;
    color: #fff;
}



/* -----------------------------------------
   FIXED TOP-LEFT HOME BUTTON
----------------------------------------- */

#top-left-home {
    position: fixed;
    top: calc(var(--outline) + 12px);
    left: calc(var(--outline) + 12px);

    display: flex;
    flex-direction: column;
    align-items: center;

    z-index: 10000;
    pointer-events: auto;
}

#top-left-home a {
    display: flex;
    flex-direction: column;
    align-items: center;

    color: #fff;
    font-family: "Courier New", Courier, monospace;
    text-decoration: none;
}

#top-left-home img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;

    cursor: pointer;
    transition: transform 0.25s ease;
}

#top-left-home img:hover {
    transform: scale(1.15);
}

#top-left-home span {
    margin-top: 6px;

    color: #fff;
    font-size: 0.9rem;
    font-family: "Courier New", Courier, monospace;

    opacity: 0.85;
    text-shadow: 1px 1px 2px #000;
}

@media (max-width: 500px) {
    #top-left-home img {
        width: 50px;
        height: 50px;
    }

    #top-left-home span {
        font-size: 0.7rem;
    }
}

@media (max-width: 380px) {
    #top-left-home img {
        width: 35px;
        height: 35px;
    }

    #top-left-home span {
        font-size: 0.6rem;
    }
}


/* -----------------------------------------
   GENERAL TEXT COLORS
----------------------------------------- */

.resources-intro h1,
.directory-heading h2,
.resource-title {
    color: #ff7e00;
}

.intro-text,
.intro-supporting,
.category-carousel-kicker,
.category-carousel-position,
.category-number,
.category-content p,
.category-content li,
.directory-heading p,
.directory-kicker,
.resource-loading,
.resource-empty,
.resources-note p,
.resources-disclaimer h2,
.resources-disclaimer p {
    color: rgba(255, 255, 255, 0.88);
}


/* -----------------------------------------
   HEADINGS — MONOSPACE FORMAT
----------------------------------------- */

.resources-intro h1,
.category-carousel-header h2,
.category-content h2,
.directory-heading h2,
.resource-title,
.resources-disclaimer h2 {
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    line-height: 1.3;
}

.resources-intro h1 {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;

    white-space: normal;
    overflow-wrap: anywhere;

    -webkit-text-stroke: 0;
    text-shadow: none;
}

.resources-intro h1 .logo-letter {
    font-size: 1.2em;
    font-weight: 900;
    transform: none;
    color: #ff7e00;
}

.category-carousel-kicker,
.directory-kicker {
    color: #ff7e00;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}


/* -----------------------------------------
   INTRODUCTION
----------------------------------------- */

.resources-intro {
    width: min(100% - 32px, 900px);
    margin: 0 auto;
    padding: 20px 0 45px;
    text-align: center;
}

/* -----------------------------------------
   CAROUSEL + DIRECTORY SURFACES
----------------------------------------- */


.resource-card {
    background: rgba(18, 30, 25, 0.90);
    border: 1px solid rgba(255, 126, 0, 0.75);
    border-radius: 4px;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.25);

    transition:
        border-color 0.25s ease,
        background-color 0.25s ease;
}

/* -----------------------------------------
   DIRECTORY FILTERS
----------------------------------------- */

.resource-directory {
    border-top-color: rgba(255, 126, 0, 0.35);
}

.directory-header {
    border-bottom-color: rgba(255, 126, 0, 0.35);
}

.resource-filter {
    border-color: rgba(255, 126, 0, 0.5);
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-family: "Courier New", Courier, monospace;
}

.resource-filter:hover {
    border-color: #ff7e00;
    color: #ff7e00;
}

.resource-filter.active {
    background: #ff7e00;
    border-color: #ff7e00;
    color: #000;
}

.resource-filter:focus-visible {
    outline-color: rgba(255, 126, 0, 0.65);
}




.resource-card:hover {
    transform: none;

    background: rgba(24, 39, 32, 0.96);
    border-color: #ff7e00;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.30);
}

.resource-puzzle {
    position: relative;

    background: rgba(255, 255, 255, 0.12);

    border: 1px solid rgba(255, 255, 255, 0.30);

    box-shadow:
        inset 0 0 0 1px rgba(255, 126, 0, 0.30),
        0 2px 10px rgba(0, 0, 0, 0.20);
}


.resource-puzzle::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 1;
    pointer-events: none;

    background: rgba(255, 126, 0, 0.08);

    border: 1px solid rgba(255, 126, 0, 0.30);
}

.resource-puzzle-image {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}


.resource-title {
    color: #ffad5c;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.resource-category-tag {
    background: rgba(255, 126, 0, 0.18);
    border: 1px solid rgba(255, 179, 107, 0.35);

    color: #ffe0bd;
}

.resource-links a {
    color: #b6ff62;
    text-decoration: underline;
    text-decoration-color: rgba(182, 255, 98, 0.45);
    text-underline-offset: 3px;
}


.resource-links a:hover {
    color: #ffad5c;
    text-decoration-color: #ffad5c;
}

.resource-links a:focus-visible {
    outline: 2px solid #b6ff62;
    outline-offset: 4px;
}

.resource-empty {
    border: 1px dashed rgba(255, 126, 0, 0.65);
    border-radius: 4px;
    background: rgba(18, 30, 25, 0.90);
    color: #fff;
}


/* -----------------------------------------
   CLOSING NOTE + DISCLAIMER
----------------------------------------- */

.resources-note p {
    font-size: 0.9rem;
    line-height: 1.9;
}

.resources-disclaimer {
    border-top-color: rgba(255, 126, 0, 0.35);
}

.resources-disclaimer h2 {
    color: #ff7e00;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resources-disclaimer p {
    font-size: 0.8rem;
    line-height: 1.8;
}


/* -----------------------------------------
   MOBILE — MATCH REFERENCE SCROLL BEHAVIOR
----------------------------------------- */

@media (max-width: 900px) {
    html,
    body {
        overflow-y: auto;
        overscroll-behavior-y: auto;
    }

    .app-scroll-container {
        position: relative;
        top: 0;
        left: 0;

        width: 100%;
        height: auto;
        min-height: 100vh;

        padding-top: calc(var(--outline) + 110px);
        padding-bottom: calc(var(--outline) + 60px);

        overflow-x: hidden;
        overflow-y: visible;

        scrollbar-gutter: auto;
    }

    main {
        overflow: visible;
    }
}


/* -----------------------------------------
   REDUCED MOTION
----------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .resource-card,
    .resource-filter,
    .resource-links a,
    #top-left-home img {
        transition: none;
    }
}