/* =============================================
   THE INTEGRAL OF LIFE — Main Stylesheet
   Red Centre palette — April 2026
   ============================================= */

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

:root {
    /* Red Centre palette */
    --bg:           #F5EFE4;   /* warm sand */
    --bg-2:         #EDE3D0;   /* deeper sand */
    --header-bg:    #F0E8D8;   /* sand with warmth */

    --tile-1:       #EAD9C0;   /* pale ochre — row 1 */
    --tile-2:       #E2D0B4;   /* ochre mid — row 2 */
    --tile-3:       #DCCBA8;   /* ochre deep — row 3 */
    --tile-hover:   #D4BB94;   /* hover darken */

    --feature-1:    #D8C8B0;   /* companion tile */
    --feature-2:    #CFBFA0;   /* substack tile */

    --ochre:        #C8885A;   /* terracotta accent */
    --ochre-light:  #D9A87A;   /* lighter terracotta */
    --ochre-pale:   #F0DFC8;   /* very pale ochre */
    --terracotta:   #A85C3A;   /* deep terracotta */

    --sky:          #6BAED6;   /* logo sky blue */
    --sky-deep:     #4A90B8;   /* deeper sky — primary interactive */
    --sky-hover:    #3A7AA8;   /* hover state */

    --spinifex:     #8A9E7A;   /* grey-green accent */

    --text-primary: #2C2018;   /* warm charcoal */
    --text-muted:   #5C4A38;   /* mid brown */
    --text-subtle:  #8A7260;   /* light brown */
    --white:        #FFFFFF;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Crimson Pro', Georgia, serif;

    /* Spacing */
    --gap:          20px;
    --tile-radius:  8px;
    --max-width:    1200px;
    --pad-x:        40px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* --- HEADER --- */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(200,136,90,0.25);
    padding: 0 var(--pad-x);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    width: 52px;
    height: auto;
    opacity: 0.92;
}

.site-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.site-tagline {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--text-primary);
    border-color: rgba(74,144,184,0.4);
    background: rgba(74,144,184,0.08);
}

.nav-link--companion {
    border-color: rgba(74,144,184,0.35);
    color: var(--sky-deep);
}

.nav-link--companion:hover {
    background: rgba(74,144,184,0.12);
    border-color: var(--sky-deep);
    color: var(--sky-hover);
}

/* --- INTRO --- */
.intro {
    max-width: var(--max-width);
    margin: 52px auto 12px;
    padding: 0 var(--pad-x);
}

.intro-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text-muted);
    max-width: 720px;
    line-height: 1.7;
    border-left: 2px solid rgba(200,136,90,0.5);
    padding-left: 20px;
}

/* --- TILE GRID --- */
.tile-grid {
    max-width: var(--max-width);
    margin: 36px auto 0;
    padding: 0 var(--pad-x);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

/* --- INDIVIDUAL TILES --- */
.tile {
    display: block;
    border-radius: var(--tile-radius);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    min-height: 175px;
    border: 1px solid rgba(200,136,90,0.15);
}

/* Top accent line on hover */
.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ochre), var(--sky-deep));
    opacity: 0;
    transition: opacity 0.22s ease;
}

.tile:hover::before {
    opacity: 1;
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(44,32,24,0.12), 0 0 0 1px rgba(200,136,90,0.2);
}

/* Row 1 */
.tile--1, .tile--2, .tile--3, .tile--4 {
    background: var(--tile-1);
}

/* Row 2 */
.tile--5, .tile--6, .tile--7, .tile--8 {
    background: var(--tile-2);
}

/* Row 3 */
.tile--9 {
    background: var(--tile-3);
}

/* Companion + Substack — same size as the chapter tiles, kept subtly distinct */
.tile--companion {
    background: var(--feature-1);
}

.tile--substack {
    background: var(--feature-2);
}

/* Contact tile */
.tile--12 {
    background: var(--ochre-pale);
    border: 1px solid rgba(200,136,90,0.3);
}

/* Hover */
.tile:hover {
    background: var(--tile-hover);
}

.tile--12:hover {
    background: #E8D0B0;
}

.tile-inner {
    position: relative;
    z-index: 1;
}

.tile-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sky-deep);
    opacity: 0.85;
    margin-bottom: 10px;
}

.tile-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 10px;
}

.tile-sub {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    font-weight: 300;
}

/* --- FEATURE SECTION: Companion + Substack --- */
.feature-section {
    max-width: var(--max-width);
    margin: var(--gap) auto 0;
    padding: 0 var(--pad-x);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.feature-tile {
    display: block;
    border-radius: var(--tile-radius);
    padding: 32px 30px;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    border: 1px solid rgba(200,136,90,0.25);
}

.feature-tile--companion {
    background: var(--feature-1);
}

.feature-tile--substack {
    background: var(--feature-2);
}

.feature-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(44,32,24,0.12), 0 0 0 1px rgba(200,136,90,0.3);
    background: var(--tile-hover);
}

.feature-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sky-deep);
    margin-bottom: 10px;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 480px;
    margin-bottom: 18px;
}

.feature-cta {
    font-size: 0.82rem;
    color: var(--sky-deep);
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

.feature-tile:hover .feature-cta {
    color: var(--terracotta);
}

/* --- FOOTER --- */
.site-footer {
    max-width: var(--max-width);
    margin: 52px auto 0;
    padding: 24px var(--pad-x) 40px;
    border-top: 1px solid rgba(200,136,90,0.2);
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-subtle);
    font-style: italic;
}
.footer-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.footer-nav .nav-link {
    padding: 5px 12px;
}

@media (max-width: 580px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-nav {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

/* =============================================
   RESPONSIVE — TABLET (900px)
   ============================================= */
@media (max-width: 900px) {
    :root {
        --pad-x: 24px;
        --gap: 16px;
    }

    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-section {
        grid-template-columns: 1fr 1fr;
    }

    .site-title {
        font-size: 1.35rem;
    }

    .header-nav {
        gap: 6px;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* =============================================
   RESPONSIVE — MOBILE (580px)
   ============================================= */
@media (max-width: 580px) {
    :root {
        --pad-x: 16px;
        --gap: 12px;
    }

    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 14px;
        align-items: flex-start;
    }

    .site-header {
        position: relative;
    }

    .logo {
        width: 40px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .header-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .intro-text {
        font-size: 1rem;
    }

    .tile-grid {
        grid-template-columns: 1fr;
    }

    .feature-section {
        grid-template-columns: 1fr;
    }

    .tile {
        min-height: 140px;
        padding: 22px 20px;
    }

    .tile-title {
        font-size: 1.05rem;
    }
}
